Repository navigation
BigQuery script splitting breaks native quoted and procedural statements #2556
Description
Environment
Chat2DB Edition
Chat2DB Community
Chat2DB Version
ae32183 (source build)
Deployment
Web
Operating System
macOS
Operating System Version
27.0
Database and Version
Google BigQuery; the defect is in local script splitting and was reproduced without a live service.
Problem and Reproduction
Problem Summary
BigQuery inherits PostgreSQL script splitting. PostgreSQL lexical rules do not preserve BigQuery backtick identifiers, triple-quoted strings, or procedural blocks, so semicolons inside valid native constructs can split one statement into several invalid statements.
Steps to Reproduce
- Pass a BigQuery script containing a BEGIN block with internal semicolons to BigQueryParser.parserSqlScript.
- Include a quoted value or triple-quoted string containing a semicolon.
- Append a second top-level statement.
- Inspect the returned statement boundaries.
Expected Behavior
The complete BEGIN block remains one statement, semicolons inside BigQuery quoted constructs remain literal content, and only the next top-level statement creates another split.
Actual Behavior
The inherited PostgreSQL splitter does not model these BigQuery lexical and scripting boundaries and can return invalid partial statements.
Evidence
Logs
N/A. A focused parser regression reproduces statement boundaries deterministically without database access.
Screenshots or Additional Context
PR #2306 contains a BigQuery-only lexical splitter and native-syntax regression coverage. PostgreSQL-backed analysis and completion remain unchanged. No credentials, private URLs, or production data are involved. A live BigQuery integration test was not run.
Impact and Workaround
Impact
Degrades a core workflow. Valid multi-statement BigQuery scripts can fail during import or batch execution after being split incorrectly.
Workaround
A partial workaround exists: execute native procedural blocks separately or avoid using the affected batch-import path.
Submission Checklist
- I reproduced this on the selected Chat2DB edition.
- I searched existing issues for duplicates.
- I removed credentials and private data.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Review
Activity
github-actions commentedon Aug 4, 2026
Thanks for the detailed BigQuery parser report. I understand that
BigQueryParser.parserSqlScriptcan split valid scripts at semicolons inside backtick identifiers, triple-quoted strings, andBEGINprocedural blocks, producing invalid partial statements.All required bug-report fields are present, including a deterministic reproduction and the affected source revision. The next maintainer step is to compare the BigQuery-specific splitter and regression coverage referenced in PR #2306 against the current parser behavior, while keeping PostgreSQL-backed analysis and completion unchanged.