MySQL: `REGEXP`/`RLIKE` followed by `NULL` is rejected or misparsed (regression in 0.59.0)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #2791 de @slopgobblercobbler — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 67/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- backend-api-design, databases
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 3.5k
- Forks
- 805
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 116
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/datafusion-sqlparser-rs
-
Redshift
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
apache/datafusion-sqlparser-rs#2959 ·
Los mantenedores suelen responder en 1 día
-
Redshift
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/datafusion-sqlparser-rs#2958 ·
Los mantenedores suelen responder en 1 día
-
PostgreSQL
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/datafusion-sqlparser-rs#2862 ·
Los mantenedores suelen responder en 1 día
-
PostgreSQL
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/datafusion-sqlparser-rs#2861 ·
Los mantenedores suelen responder en 1 día
-
PostgreSQL
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
apache/datafusion-sqlparser-rs#2858 ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/datafusion-sqlparser-rs
Issues similares
-
area:schema documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ElectronicWave/Elemental#252 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dekobon/big-code-analysis#1887 ·
Los mantenedores suelen responder en 1 día
-
Shell中文符号输入异常Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día