Output of getNonParametrizedQueryString wrong
GoogleCodeExporter opened this issue · comments
Google Code Exporter commented
Example:
updateCharacteristicStm = provider.createPreparedStatement("UPDATE
characteristics SET ? WHERE ? << id");
String val = "City";
String id = "3074820921864052268";
updateCharacteristicStm.setString(0, val);
updateCharacteristicStm.setString(1, id);
System.out.println(updateCharacteristicStm.getNonParametrizedQueryString());
Output:
UPDATE characteristics SET Cityliner WHERE 3074820921864052268 << id
Expected Output:
UPDATE characteristics SET "Cityliner" WHERE "3074820921864052268" << id
Funny fact, executing:
UPDATE characteristics SET "Cityliner" WHERE 3074820921864052268 << id
works.. why?
Original issue reported on code.google.com by h.niederhausen@googlemail.com
on 17 Feb 2011 at 6:11
Google Code Exporter commented
It looks like, that the prepared statement only use the toString method of each
given construct.
It is not a funny fact, that the thrid query works. The provided id of a topic
map construct can be a long or a string value, depends on the underlying topic
maps engine, e.g. MaJorToM supports ids as string and long. The tmql4j engine
try to fetch a construct by its id using a string or long value.
Original comment by Sven.Kro...@googlemail.com
on 18 Feb 2011 at 6:05
Google Code Exporter commented
Original comment by Sven.Kro...@googlemail.com
on 18 Feb 2011 at 6:06
- Changed state: Started
Google Code Exporter commented
The strings parameters will be transformed correctly.
e.g. ? << id
1) param = "Hans" --> "Hans" << id
2) param = "Hans\"" --> """Hans\"""" << id
3) param = "Hans\"\"\"" --> """Hans\\\"\\\"\\\"""" << id
Original comment by Sven.Kro...@googlemail.com
on 18 Feb 2011 at 6:40
- Changed state: Fixed