fix: respect backticks when splitting column names in PrepareBatch#1829
fix: respect backticks when splitting column names in PrepareBatch#1829Laotree wants to merge 4 commits intoClickHouse:mainfrom
Conversation
Fixes issue where PrepareBatch would incorrectly split column names on
comma without respecting backticks or double quotes. For example:
INSERT INTO my_table (col1, `my_weird,col2`, col3)
Would incorrectly be parsed as ['col1', 'my_weird', 'col2', 'col3']
instead of ['col1', 'my_weird,col2', 'col3'].
This adds a splitColumnsRespectingQuotes function that properly handles
commas inside backtick-quoted and double-quoted column names.
SummaryThis PR fixes a real parsing bug (#1827) in Should fixMissing regression test in Nits
VerdictApprove — the fix is correct, the helper function is clean, and the unit tests cover both quoting styles. The missing |
|
The unit test cases have already been added to batch_test.go. Writing separate test cases in issue_1827_test.go would be redundant. |
Fixes issue #1827 where PrepareBatch would incorrectly split column names on comma without respecting backticks or double quotes. For example:
Would incorrectly be parsed as ['col1', 'my_weird', 'col2', 'col3'] instead of ['col1', 'my_weird,col2', 'col3'].
This adds a splitColumnsRespectingQuotes function that properly handles commas inside backtick-quoted and double-quoted column names.
Summary
Checklist
Delete items not relevant to your PR: