MySQL: `REGEXP`/`RLIKE` followed by `NULL` is rejected or misparsed (regression in 0.59.0)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #2791 di @slopgobblercobbler — chiusa senza merge
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 67/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- backend-api-design, databases
Direzione di ricerca
Start by tracing MySQL parsing for REGEXP/RLIKE and how the parser distinguishes NOT REGEXP from a NULL pattern; the issue identifies round-trip behavior as the regression. Compare the affected cases with the behavior in 0.58.0, then add regression tests for the three SQL statements shown. Done means each parses with NULL as the pattern and round-trips without consuming following tokens as part of the pattern.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Since 0.59.0, a NULL pattern after REGEXP or RLIKE is consumed as if it were NOT NULL, and the next token becomes the pattern:
SELECT 'abc' REGEXP NULL
-> sql parser error: Expected: an expression, found: EOF
SELECT a RLIKE NULL FROM t
-> displays as: SELECT a RLIKE FROM AS t (pattern is the identifier FROM, no FROM clause)
SELECT a NOT REGEXP NULL OR b FROM t
-> displays as: SELECT a NOT REGEXP OR AS b FROM t
In 0.58.0 these parsed as Expr::RLike { pattern: Value(Null), .. } and round-tripped.
Tested on main e15e9abf (also 0.63.0; 0.58.0 is fine).
Found with a property-based fuzzer (round trip and statement-separation checks); I used AI assistance for triage and verified every case above.
- Lingua principale
- Rust
- Stelle
- 3.5k
- Fork
- 805
- Merge medio
- 2g 3h
- PR unite (30g)
- 116
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/datafusion-sqlparser-rs
-
Redshift
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/datafusion-sqlparser-rs#2959 ·
I maintainer di solito rispondono entro 1 giorno
-
Redshift
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/datafusion-sqlparser-rs#2958 ·
I maintainer di solito rispondono entro 1 giorno
-
PostgreSQL
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/datafusion-sqlparser-rs#2862 ·
I maintainer di solito rispondono entro 1 giorno
-
PostgreSQL
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/datafusion-sqlparser-rs#2861 ·
I maintainer di solito rispondono entro 1 giorno
-
PostgreSQL
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
apache/datafusion-sqlparser-rs#2858 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/datafusion-sqlparser-rs
Issue simili
-
area:schema documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
ElectronicWave/Elemental#252 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dekobon/big-code-analysis#1887 ·
I maintainer di solito rispondono entro 1 giorno
-
Shell中文符号输入异常Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno