xgbtxy opened a new pull request, #3053:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3053

   Fixes `Display` for Snowflake `StageParamsObject` (`URL`, `ENDPOINT`) and 
`FileStagingCommand` (`PATTERN`) when single-quoted values contain embedded 
single quotes.
   
   Broken examples:
   ```sql
   CREATE STAGE s URL='s3://bucket/o''reilly/' 
ENDPOINT='https://o''reilly.example.com'
   LIST @s PATTERN='.*o''reilly.*'
   ```
   Previously displayed with unescaped single quotes 
(`URL='s3://bucket/o'reilly/'`, `PATTERN='.*o'reilly.*'`), producing 
unterminated string literals that fail to reparse.
   
   Fix:
   - Escape `url`, `endpoint`, and `pattern` with `escape_single_quote_string` 
in `src/ast/helpers/stmt_data_loading.rs`.
   - Add positive and negative unit tests in `tests/sqlparser_snowflake.rs` and 
a minimal fuzz seed in 
`fuzz/fuzz_seeds/snowflake_stage_single_quote_escape.sql`.
   
   Disclosure: AI assistance was used to help locate the bug, draft the fix, 
and write the tests; all changes and checks were verified locally.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to