LucaCappelletti94 opened a new pull request, #2664: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2664
In SQLite, comparison operators, `IS`, `LIKE`, `NOTNULL` and `BETWEEN` share one precedence level (https://www.sqlite.org/lang_expr.html#operators_and_parse_affecting_attributes), so the lower bound of a `BETWEEN` extends up to the `AND`: SQLite 3.51.1 runs `2 BETWEEN 1 > 0 AND 3`, `2 BETWEEN NULL IS NULL AND 3`, `2 BETWEEN 'a' LIKE 'a' AND 3` and a nested `BETWEEN` as the lower bound. The SQLite dialect stopped the lower bound at the `BETWEEN` precedence and failed with `Expected: AND, found: >`. A new dialect method, `between_low_bound_precedence`, defaults to the `BETWEEN` precedence, and `SQLiteDialect` returns the `AND` precedence instead. The upper bound is unchanged, so operators after it still apply to the whole `BETWEEN`. Tests check the parsed lower bound and these forms in SQLite, and the unchanged error in the generic dialect. -- 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]
