dongjoon-hyun opened a new pull request, #56506:
URL: https://github.com/apache/spark/pull/56506

   ### What changes were proposed in this pull request?
   
   This PR applies `escapeSql` to the `comment` argument of the JDBC dialect 
comment query
   methods: `JdbcDialect.getTableCommentQuery`, 
`JdbcDialect.getSchemaCommentQuery`, and the
   `MySQLDialect.getTableCommentQuery` override.
   
   ### Why are the changes needed?
   
   The `comment` was embedded into a single-quoted SQL literal without 
escaping, so a comment
   containing `'` breaks the statement. `escapeSql` doubles single quotes (`'` 
-> `''`):
   
   - Before: `COMMENT ON TABLE t IS 'a'b'` (invalid)
   - After: `COMMENT ON TABLE t IS 'a''b'` (correct)
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. A table or schema comment containing a single quote is now stored 
correctly instead
   of failing with a SQL syntax error.
   
   ### How was this patch tested?
   
   Pass the CIs with a newly added test case.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 4.8)


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