Repository navigation
Strip trailing semicolon on the unlimited query() path across connectors #2497
Description
Context
Follow-up to #2441 / #2480 (shared strip_trailing_semicolon in connector/base.py).
Several connectors strip the trailing ; only when a limit is supplied (the LIMIT subquery-wrap path). When query() runs with no limit, the SQL is passed through verbatim, so SELECT 1; reaches the engine unstripped. This issue tracks auditing every connector's no-limit path and routing it through the shared helper, in one PR.
Prerequisite: blocked by #2480 — rebase onto it so each change is "import + one call", not a new local copy.
Scope
Connectors with an existing PR — fold in and close
- redshift fix(redshift): strip trailing semicolon on unlimited query path #2482
- canner fix(canner): strip trailing semicolon on unlimited query path #2488
- duckdb fix(duckdb): strip trailing semicolon on unlimited query path #2489
- postgres fix(postgres): strip trailing semicolon on unlimited query path #2490
- databricks fix(databricks): strip trailing semicolon before query execute #2477
- datafusion — query half of fix(datafusion): strip trailing semicolon on unlimited query and dry_run #2483 (dry_run half tracked in Strip trailing semicolon on dry_run / EXPLAIN / describe across connectors #2498)
- spark — query half of fix(spark): strip trailing semicolon before sql/dry_run #2464 (dry_run half tracked in Strip trailing semicolon on dry_run / EXPLAIN / describe across connectors #2498)
Connectors with no existing PR (net-new work)
-
trino —
query()strips insideif limit is not Noneonly; the no-limit path executessqlas-is -
mysql —
query()strips via_apply_limitonly when a limit is applied; the no-limit path executessqlas-isThe multi-semicolon fix for trino/mysql lands via refactor(connector): share strip_trailing_semicolon in base #2480; the (closing) fix(trino): strip multi trailing semicolons before subquery wrap #2474 / fix(mysql): strip multi trailing semicolons before LIMIT/EXPLAIN #2475 did not cover this no-limit path.
Use the shared helper — don't add local copies
spark — and bigquery/mssql/snowflake — are not migrated by #2480, so their entries here must import strip_trailing_semicolon from base, not introduce a per-connector _strip_trailing_semicolon.
Related, evaluate separately (not pure semicolon fixes)
- bigquery fix(bigquery): push LIMIT into SQL and strip trailing semicolon #2465 — the semicolon part folds here; its LIMIT-pushdown change is independent
- mssql fix(mssql): strip trailing semicolons before sqlglot LIMIT rewrite #2476 — the semicolon part folds here; its sqlglot LIMIT-rewrite change is independent
Done when
- Every connector strips on both limited and unlimited query paths via the shared helper
- Listed PRs folded in and closed; trino/mysql no-limit path covered
Activity
goldmedal commentedon Aug 11, 2026
All tasks completed. Thanks @Bartok9 🚀