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

   SQLite's operator table puts `<`, `<=`, `>` and `>=` one level above `=`, 
`==`, `<>`, `!=`, `IS`, `IN`, `LIKE` and `BETWEEN` 
(https://www.sqlite.org/lang_expr.html#operators_and_parse_affecting_attributes).
 So `a = b < c` means `a = (b < c)`: SQLite 3.51.1 evaluates `SELECT 2 = 1 < 3` 
to `0`, which only holds for `2 = (1 < 3)`. The SQLite dialect used a single 
level for all comparisons and parsed it as `(a = b) < c`.
   
   `SQLiteDialect` now returns a separate precedence for `<`, `<=`, `>` and 
`>=`. Since the default table has no free value between `=` and the bitwise 
operators, the dialect overrides `prec_value` with the default levels shifted 
up by one above `=`. Other dialects are unchanged: PostgreSQL 16 and DuckDB 
1.4.4 reject `2 = 1 < 3` outright, so there is no grouping to match there. 
Tests check the tree for each pairing, `IN` and `BETWEEN` against `<`, and that 
every other dialect still parses `a = b < c` as `(a = b) < c`.


-- 
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]

Reply via email to