TeslaCN commented on code in PR #27909:
URL: https://github.com/apache/shardingsphere/pull/27909#discussion_r1288014686
##########
proxy/frontend/type/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutor.java:
##########
@@ -87,6 +93,13 @@ private SQLParserEngine
createShardingSphereSQLParserEngine(final String databas
return
sqlParserRule.getSQLParserEngine(protocolType.getTrunkDatabaseType().orElse(protocolType));
}
+ private String escape(final SQLStatement sqlStatement, final String sql) {
+ if (sqlStatement instanceof DMLStatement) {
+ return sql.replace("?", "??");
+ }
+ return sql;
+ }
Review Comment:
I found the doc about escape `?` in the following link. I think the escape
logic could be merged into `convertSQLToJDBCStyle` and invoke the method with
`convertSQLToJDBCStyle(Collections.emptyList(), sql)` if parameter placeholder
is absent.
https://jdbc.postgresql.org/documentation/query/#using-the-statement-or-preparedstatement-interface
--
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]