Repository navigation
fix(pinot/dremio/ksql/databriks/hive/jdbc-driver): correct SQL parameter escaping - #11374
Conversation
|
Claude finished @ovr's task in 1m 24s —— View job Claude PR ReviewVerdict: LGTM — the mapping and per-driver rewrites are correct, tests cover both directions of the escaping mismatch. 0 blockers, 2 minor observations. Details
Correctness
Minor observations (non-blocking)
Tests
SecurityCorrectly addresses the CVE-class issue: mismatched escaper → literal escape via trailing backslash or backslash-quote. No new injection surface introduced. The QuestDB change is a bonus fix. |
8b16b97 to
cba3cc6
Compare
|
Claude finished @ovr's task in 1m 42s —— View job Claude PR ReviewVerdict: LGTM. Findings: 0 high, 1 low. Details
SummaryThe PR follows the same recipe as the earlier Trino/Presto and Athena fixes, applied consistently across the remaining affected drivers:
Correctness / security
Low —
|
cba3cc6 to
4bb5262
Compare
|
I'll analyze this and get back to you. |
4bb5262 to
e83ea86
Compare
|
Claude finished @ovr's task in 35s —— View job Claude PR ReviewVerdict: LGTM. 0 blockers, 1 low (previously noted). Details
SummaryConsistent application of the Trino/Athena fix pattern to the remaining affected drivers:
Low (previously flagged, non-blocking) —
|
e83ea86 to
deca0d7
Compare
|
Claude finished @ovr's task in 50s —— View job Claude PR ReviewVerdict: LGTM. 0 blockers, 1 low (previously noted, unchanged). Details
SummaryNo substantive change since the previous review. Re-verified:
Low (previously flagged, still non-blocking) —
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11374 +/- ##
==========================================
- Coverage 59.72% 58.98% -0.75%
==========================================
Files 217 223 +6
Lines 17586 17891 +305
Branches 3570 3636 +66
==========================================
+ Hits 10504 10553 +49
- Misses 6569 6819 +250
- Partials 513 519 +6
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:
|
|
Claude finished @ovr's task in 31s —— View job Claude PR ReviewVerdict: LGTM. 0 blockers, 1 low (previously noted, unchanged). Details
New commit
|
|
Claude finished @ovr's task in 33s —— View job Claude PR ReviewVerdict: LGTM. 0 blockers, 1 low (previously noted, unchanged). Details
New commit
|
|
Claude finished @ovr's task in 54s —— View job Claude PR ReviewVerdict: LGTM. 0 blockers, 1 low (previously noted, unchanged). Details
New commit
|
Audit of all 29 driver packages for the escaping bug fixed for Trino/Presto in 463e602 and Athena in 9b23d090e1: `sqlstring` (a MySQL escaper) used to interpolate parameters for engines that are not MySQL. Mismatching the dialect is unsafe in BOTH directions, so there is no safe universal default and each engine has to be handled explicitly: - MySQL rules on a standard-SQL engine emit `\'`. The backslash is data there, so the quote that follows closes the literal and the rest of the statement lands in code position. - Standard-SQL rules on a backslash-escaping engine leave a trailing `\`, which escapes the closing quote and lets the literal run on. | engine | backslash is | correct formatter | | ---------------------------- | ------------ | ----------------- | | Pinot, Dremio (Calcite) | data | `formatAnsi` | | ksqlDB (Presto-derived) | data | `formatAnsi` | | Athena, Presto, Trino | data | `formatAnsi` | | MySQL, Hive, Spark SQL | escape char | `formatMySql` | | ClickHouse, Cube Store | escape char | `formatMySql` |
… parity The escapeStringLiteral suite asserted that the literal is quoted and that its body contains an even number of quotes. That is strictly weaker than the decodeAnsiLiteral round-trip the ANSI and MySQL suites already use, and it accepts escapers that silently corrupt the value: | Mutant escaper | Quote parity | Round-trip | | ----------------------------- | ------------ | ---------- | | strips every quote | passes | fails | | quadruples every quote | passes | fails | escapeStringLiteral is `new SqlEscaper(AnsiSqlDialect).escapeString`, i.e. the exact grammar decodeAnsiLiteral parses, so the payload cases now decode and compare against the input, and the suite gains the same short-combination round-trip loop as its siblings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Spark SQL, Hive and Databricks lexers know backslash escapes only. A doubled quote is not an escape there: it closes the literal and opens the next one, and because adjacent literals are concatenated the corruption is silent — no parse error is raised.
6cc5638 to
33818b5
Compare
|
Claude finished @ovr's task in 3m 40s —— View job Claude PR ReviewVerdict: LGTM. 0 blockers, 2 low, 2 nits. New Details
Latest commits since prior reviews
Verified: the Spark claim holdsThe comment at Correctness
Low — Date values render as ISO-8601, diverging from
|
|
Claude finished @ovr's task in 1m 38s —— View job Claude PR ReviewVerdict: request changes. 1 medium, 0 low. New commit
|

Audit of all 29 driver packages for the escaping bug fixed for Trino/Presto in 463e602 and Athena in 9b23d090e1:
sqlstring(a MySQL escaper) used to interpolate parameters for engines that are not MySQL.Mismatching the dialect is unsafe in BOTH directions, so there is no safe universal default and each engine has to be handled explicitly:
\'. The backslash is data there, so the quote that follows closes the literal and the rest of the statement lands in code position.\, which escapes the closing quote and lets the literal run on.formatAnsiformatAnsiformatAnsiformatMySqlformatMySql