Repository navigation
fix: Escape quote characters in SQL identifiers - #12622
Conversation
|
Claude finished @ovr's task in 1m 38s —— View job Fix is right where applied, but incomplete — 0 high, 1 medium, 1 low. BigQuery, ClickHouse and ksqlDB can still be injected through identifiers. Review details
Findings
What looks right
DocsNone needed: this is a bug fix with no new options or behaviour for users. Review threadsThe listing returned 0 of my threads (no prior threads), so none were resolved or re-affirmed. Both findings were posted inline. Not runI didn't run the |
|
Claude finished @ovr's task in 1m 54s —— View job LGTM: 0 high, 0 medium, 1 low. The one low is a missing test, already tracked in an existing thread, so nothing new is posted inline. Review detailsChecklist
Correctness: each dialect checked
On the Rust side, Removing the Dremio and Vertica overrides doesn't change normal output: they were identical to the old base method, and the new base method now escapes Findings
Not in this PRDriver DocsNone needed. This is a bug fix with no new options or behaviour that users would need documented. TestsI didn't run them locally: the jest command needed approval in this environment. CI covers the shared and Rust tests. Review threadsThe listing returned 1 of my own threads. I resolved 0 and re-affirmed 1 ( |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12622 +/- ##
==========================================
+ Coverage 83.15% 83.17% +0.01%
==========================================
Files 531 531
Lines 124741 124800 +59
Branches 5294 5308 +14
==========================================
+ Hits 103726 103800 +74
+ Misses 20221 20202 -19
- Partials 794 798 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Identifiers were wrapped in the dialect's quote without escaping that quote inside the name, so a quote character in a member alias ended the identifier early and let the rest of the alias run as SQL. - `escapeColumnName` now uses new `@cubejs-backend/shared` helpers: `escapeIdentifierAnsi` (Base, Vertica, Dremio), `escapeIdentifierMySql` (MySQL, Cube Store), `escapeIdentifierSparkSql` (Hive, Databricks, ksqlDB) and `escapeIdentifierBackslash` (BigQuery, ClickHouse). - The MySQL `quotes/escape` template doubles the backtick instead of `\``, which MySQL reads literally inside an identifier. - `quote_identifier` in Tesseract and cubesql doubles backslashes before a backslash-escaped quote (BigQuery, ClickHouse), so `\` in a name can no longer escape the quote after it. (cherry picked from commit 8c76d4c)
Identifiers were wrapped in the dialect's quote without escaping that quote inside the name, so a quote character in a member alias ended the identifier early and let the rest of the alias run as SQL. - `escapeColumnName` now uses new `@cubejs-backend/shared` helpers: `escapeIdentifierAnsi` (Base, Vertica, Dremio), `escapeIdentifierMySql` (MySQL, Cube Store), `escapeIdentifierSparkSql` (Hive, Databricks, ksqlDB) and `escapeIdentifierBackslash` (BigQuery, ClickHouse). - The MySQL `quotes/escape` template doubles the backtick instead of `\``, which MySQL reads literally inside an identifier. - `quote_identifier` in Tesseract and cubesql doubles backslashes before a backslash-escaped quote (BigQuery, ClickHouse), so `\` in a name can no longer escape the quote after it.
No description provided.