yuqi1129 opened a new pull request, #13944:
URL: https://github.com/apache/gravitino/pull/13944
### What changes were proposed in this pull request?
Use the existing `escapeSqlLiteral` helper for all four OceanBase comment
SQL-generation paths: create table, update table comment, add column, and
create/modify column definitions.
Add SQL-generation regression tests and real OceanBase round-trip tests,
including changes that rebuild a column definition while preserving its
existing comment.
### Why are the changes needed?
Unescaped apostrophes break comment DDL, and backslash escapes can change
the stored text. Apply the same literal escaping already used by the MySQL
catalog.
This follows the existing MySQL-compatible literal semantics with backslash
escaping enabled. SQL-mode-aware escaping for `NO_BACKSLASH_ESCAPES` is outside
this patch.
Fix: #13943
### Does this PR introduce _any_ user-facing change?
OceanBase table and column comments containing quotes or backslashes can be
created and altered without corrupting their text. No API or configuration
changes.
### How was this patch tested?
- OceanBase catalog non-Docker unit tests: 25 passed, including 16 new
SQL-generation cases.
- OceanBase catalog tests with Docker enabled: 43 passed, including two real
comment round-trip cases on OceanBase CE 4.2.1.10.
- Actual SQL mode: `STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER`.
- Mutation check: reverting the production fix makes 12 of the 16 new
SQL-generation cases fail; the four cases requiring no escaping still pass.
- OceanBase catalog Spotless checks.
--
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]