TeslaCN commented on code in PR #27909:
URL: https://github.com/apache/shardingsphere/pull/27909#discussion_r1294443911
##########
proxy/frontend/type/postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/parse/PostgreSQLComParseExecutor.java:
##########
@@ -61,6 +62,11 @@ public Collection<DatabasePacket> execute() {
SQLParserEngine sqlParserEngine =
createShardingSphereSQLParserEngine(connectionSession.getDatabaseName());
String sql = packet.getSQL();
SQLStatement sqlStatement = sqlParserEngine.parse(sql, true);
+ String escapedSql = escape(sqlStatement, sql);
+ if (!escapedSql.equalsIgnoreCase(sql)) {
+ sqlStatement = sqlParserEngine.parse(escapedSql, true);
Review Comment:
Is `??&` a valid PostgreSQL syntax? If we escape `?` here, maybe parsing SQL
contains `??&` should be failed?
--
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]