yuqi1129 opened a new issue, #13943:
URL: https://github.com/apache/gravitino/issues/13943

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   The OceanBase JDBC catalog interpolates table and column comments into 
single-quoted SQL literals without escaping them. A comment such as `customer's 
id` breaks table creation or alteration. Backslashes can also change the 
comment text stored by OceanBase.
   
   The affected paths are table comments during create and update, added-column 
comments, and column definitions used during create and modification.
   
   ### Error message and/or stacktrace
   
   The generated DDL contains an unescaped literal, for example 
`COMMENT='customer's id'`, and OceanBase reports a SQL syntax error.
   
   ### How to reproduce
   
   1. Configure an OceanBase catalog in MySQL compatibility mode with backslash 
escaping enabled (without `NO_BACKSLASH_ESCAPES`).
   2. Create a table with table or column comment `customer's id`.
   3. Repeat with a table-comment update, an added column, or a column-comment 
update.
   4. Use a comment containing a backslash and verify that loading the table 
returns the original text.
   
   ### Additional context
   
   The MySQL catalog already uses `JdbcConnectorUtils.escapeSqlLiteral` for 
these SQL literals. OceanBase should use the same escaping for all four paths 
and preserve comments when rebuilding column definitions.
   


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