HTHou commented on code in PR #14008:
URL: https://github.com/apache/iotdb/pull/14008#discussion_r1832132591
##########
iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPreparedStatement.java:
##########
@@ -894,9 +894,11 @@ public void setShort(int parameterIndex, short x) throws
SQLException {
@Override
public void setString(int parameterIndex, String x) {
- // if the sql is insert and the value is not a string literal, add double
quotes
- if (sql.trim().toUpperCase().startsWith("INSERT") && !x.startsWith("\"")
&& !x.endsWith("'")) {
- this.parameters.put(parameterIndex, "\"" + x + "\"");
+ // if the sql is insert and the value is not a string literal, add single
quotes
+ // The table model only supports single quotes, tree model all both, but
this method only judges
+ // based on single quotes
Review Comment:
```suggestion
// if the sql is an insert statement and the value is not a string
literal, add single quotes
// The table model only supports single quotes, the tree model sql both
single and double quotes. Therefore this method only judges
// based on single quotes
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]