MySQL: `REGEXP`/`RLIKE` followed by `NULL` is rejected or misparsed (regression in 0.59.0)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
- #2791 de @slopgobblercobbler — fechado sem integrar
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 67/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Domínio
- backend-api-design, databases
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Rust
- Estrelas
- 3.5k
- Forks
- 805
- Merge médio
- 2d 3h
- PRs com merge (30d)
- 116
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/datafusion-sqlparser-rs
-
Redshift
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
apache/datafusion-sqlparser-rs#2959 ·
Mantenedores costumam responder em até 1 dia
-
Redshift
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
apache/datafusion-sqlparser-rs#2958 ·
Mantenedores costumam responder em até 1 dia
-
PostgreSQL
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
apache/datafusion-sqlparser-rs#2862 ·
Mantenedores costumam responder em até 1 dia
-
PostgreSQL
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
apache/datafusion-sqlparser-rs#2861 ·
Mantenedores costumam responder em até 1 dia
-
PostgreSQL
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
apache/datafusion-sqlparser-rs#2858 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de apache/datafusion-sqlparser-rs
Issues semelhantes
-
P3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
HerringtonDarkholme/hd-lang#1770 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
jonathanong/no-mistakes#3332 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
swc-project/swc-next-issues#310 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
swc-project/swc-ai-issues#653 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
lbjlaq/Antigravity-Manager#3937 ·
Mantenedores costumam responder em até 1 dia