MySQL: `FLUSH TABLES` consumes the `;`, so the next statement is rejected

Offen
#2,764 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

  • #2789 von @slopgobblercobbler — ohne Merge geschlossen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust, sql

Rechercherichtung

Start by reading the MySQL parser handling for FLUSH TABLES and the statement-separation tests; the issue points to #1775 and its fix in #1786 as a precedent. Reproduce the reported cases with FLUSH TABLES; SELECT 1, FLUSH TABLES t1, t2; SELECT 1, and FLUSH TABLES WITH READ LOCK; SELECT 1, then add coverage showing each parses as two statements.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

MySQL Prolific Author

FLUSH TABLES followed by another statement doesn't parse:

FLUSH TABLES; SELECT 1
  -> sql parser error: Expected: end of statement, found: SELECT at Line: 1, Column: 15
FLUSH TABLES t1, t2; SELECT 1
FLUSH TABLES WITH READ LOCK; SELECT 1
  -> same error
FLUSH PRIVILEGES; SELECT 1
  -> 2 statements (fine)

Each statement parses on its own. Snowflake's ALTER SESSION had the same problem (#1775, fixed in #1786).

Tested on main c45d1f4e (also 0.63.0 and 0.58.0).

Found with a property-based fuzzer (round trip and statement-separation checks); I used AI assistance for triage and verified every case above.

Vorherrschende Sprache
Rust
Sterne
3.5k
Forks
805
Ø Merge
2 T. 3 Std.
Gemergte PRs (30 T.)
116

Entwicklungsumgebung

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/datafusion-sqlparser-rs

Alle Issues in apache/datafusion-sqlparser-rs

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.