LucaCappelletti94 opened a new pull request, #3070:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3070

   Under `SQLiteDialect`, `a GLOB 'p' = 1` parsed as `a GLOB ('p' = 1)`. 
SQLite's grammar puts `LIKE`, `GLOB`, `MATCH` and `REGEXP` on the same 
left-associative level as `=` and `<>` 
([parse.y](https://sqlite.org/src/file?name=src/parse.y&ci=trunk), `%left IS 
MATCH LIKE_KW BETWEEN IN ISNULL NOTNULL NE EQ`), and `sqlite3` returns 1 for 
`SELECT 'a' GLOB 'a' = 1`, which only the left-grouped reading gives. This came 
up in review on 
https://github.com/apache/datafusion-sqlparser-rs/pull/3043#issuecomment-7237899559.
   
   The dialect ranked `Precedence::Like` one step below `Precedence::Eq`, so 
the pattern operand absorbed a following `=`, `<>`, `BETWEEN` or `IN`. Moving 
`Precedence::Like` to the level of `Precedence::Eq` in 
`SQLiteDialect::prec_value` regroups every operator that takes its level from 
that lookup, the `NOT` forms and the `ESCAPE` operand included. Other dialects 
keep their own tables.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

  • [PR] SQLite: Group LIKE, GLOB, M... LucaCappelletti94 (via GitHub) via github

Reply via email to