[jdbc-v2] Test backtick-quoted INSERT columns via RowBinary writer (#2978) - #2979
Merged
Merged
Conversation
…RowBinary writer Issue #2978 reports that an INSERT with backtick-quoted column names throws NoSuchColumnException under the beta RowBinary writer (WriterStatementImpl). The functional fix already landed in #2899 (SqlParserFacade.enterInsertStmt unescapes each identifier component before the by-name schema lookup); this adds the end-to-end regression coverage for the WriterStatementImpl path that #2978 flagged as uncovered. Verified the test fails with "NoSuchColumnException: Result has no column with name '`field1`'" when the #2899 unescape is reverted, and passes with it. Closes: #2978
|
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
chernser
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Closes #2978.
Issue #2978 reports that
INSERT INTO t (\c1`, `c2`) VALUES (?, ?)throwsNoSuchColumnException: Result has no column with name '`c1`'under the betaRowBinarywriter (WriterStatementImpl`), because the parsed column names keeptheir backticks and fail the by-name schema lookup.
The functional fix already landed in #2899 (commit
1fb7a2b):SqlParserFacade'senterInsertStmtnow unescapes each identifier component and rejoins with.beforethe names are matched against the server schema. Because
ConnectionImpl.prepareStatementfeeds the same parsed statement to both thebeta (
WriterStatementImpl) and non-beta (PreparedStatementImpl) paths, that singlefix already covers the
BETA_ROW_BINARY_WRITERpath — so the bug does not reproduceon current
main.This PR adds the end-to-end regression coverage for the
WriterStatementImplpaththat #2978 flagged as uncovered: the existing
#2896regression test is at the parserunit level, and
WriterStatementImplTesthad no test that actually inserts a row usingquoted column names and reads it back.
Note: the reported exception only arises under an ANTLR4 parser — the default
JAVACCbackend does not extract an explicit INSERT column list at all — so the testselects
jdbc_sql_parser=ANTLR4to exercise the name→schema lookup.Changes
jdbc-v2/.../WriterStatementImplTest.java: new@DataProvider-driven integrationtest
testInsertWithQuotedColumnNamesthat, with the beta RowBinary writer enabled,inserts a row via an INSERT whose columns are backtick-quoted (the reported form)
and, as a contrast row, unquoted; then reads the row back and asserts every column.
No production code changes.
Test
testInsertWithQuotedColumnNamescreates(field1 String, field2 Int32, field3 String),inserts
('alpha', 42, 'gamma')throughWriterStatementImpl, and asserts the fullround-trip (the
Int32sits mid-schema between twoStrings, so a misrouted/unmatchedcolumn is detected, not just the exception). Verified both directions:
error
NoSuchColumnException: Result has no column with name '\field1`'`; the unquotedcontrast row still passes.
Run:
mvn -B -pl jdbc-v2 -DskipUTs=true -Dit.test=WriterStatementImplTest verify→Tests run: 3, Failures: 0.Pre-PR validation gate
@DataProvider(no N near-identical methods), no issue-numberreferences inside test code, integration test on the live insert/read path, async
insert set
OFFfor a deterministic read-back (matching the module's other insert tests)entry already exists (added with [jdbc-v2] Backtick-quoted (Nested) INSERT column names are not unescaped before schema lookup in WriterStatementImpl #2896)