shuwenwei commented on PR #162:
URL: https://github.com/apache/iotdb-client-go/pull/162#issuecomment-4764032983

   The placeholder binding still rewrites tokens inside SQL literals/comments. 
The latest change only updates `bindPositionalRe` from `[^\\][?]` to 
`(^|[^\\])\?`, which fixes detecting a positional placeholder at the start of 
the query, but it does not make binding SQL-aware.
   
   `bindPositional` still scans every `?` byte and replaces it unless it is 
preceded by `\\`, so queries like `SELECT ?` or `WHERE text = ?` can be 
rewritten incorrectly. `bindNumeric` and `bindNamed` still use global regex 
replacement, so string literals such as `$1` or `@name`, and placeholders 
appearing in comments, can also be replaced or reported as missing arguments.
   
   This should skip placeholders while inside SQL string literals and comments, 
preferably with a small lexer/state machine shared by positional, numeric, and 
named binding. Please also add regression tests for cases like `SELECT ?`, 
`WHERE text = @name`, `$1`, line comments, and block comments.


-- 
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]

Reply via email to