HexyinUESTC commented on code in PR #43038:
URL: https://github.com/apache/doris/pull/43038#discussion_r1825426021


##########
fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java:
##########
@@ -195,6 +198,24 @@ private void handleExecute() {
         handleExecute(preparedStatementContext.command, stmtId, 
preparedStatementContext);
     }
 
+    private String parseRealSql(String origStmt, Map<PlaceholderId, 
Expression> idExpressionMap) {
+        if (idExpressionMap.isEmpty()) {
+            return origStmt;
+        }
+        // To maintain the original order of replace, sort the entries 
accordingly.
+        List<Map.Entry<PlaceholderId, Expression>> sortedEntries = new 
ArrayList<>(idExpressionMap.entrySet());
+        sortedEntries.sort(Comparator.comparingInt(entry -> 
entry.getKey().asInt()));
+        for (Map.Entry<PlaceholderId, Expression> entry : sortedEntries) {
+            Expression expr = entry.getValue();
+            String value = "";
+            if (!expr.isNullLiteral()) {
+                value = expr.toString();
+            }
+            origStmt = origStmt.replaceFirst("\\?", value);

Review Comment:
   Thank you for your correction.I will modify it to skip `?` enclosed in 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to