Skip to content

BigQuery script splitting breaks native quoted and procedural statements #2556

Description

@openai0229

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

  1. Pass a BigQuery script containing a BEGIN block with internal semicolons to BigQueryParser.parserSqlScript.
  2. Include a quoted value or triple-quoted string containing a semicolon.
  3. Append a second top-level statement.
  4. 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.

Activity

  1. added theissue type on Aug 4, 2026
  2. github-actions commented on Aug 4, 2026

    @github-actions

    Thanks for the detailed BigQuery parser report. I understand that BigQueryParser.parserSqlScript can split valid scripts at semicolons inside backtick identifiers, triple-quoted strings, and BEGIN procedural 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.

    Generated by AI Issue Assistant for #2556 · 9.93 AIC · ⌖ 2.76 AIC · ⊞ 16.4K · ◷

  3. moved this from Inbox to In Review in Chat2DB Communityon Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/backendCommunity backend and domain servicesarea/sql-editorSQL console, editor, completion, and executiondb/bigqueryBigQuery-specific behavioredition/communityChat2DB Community

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions