LucaCappelletti94 opened a new pull request, #2659: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2659
In SQLite `~` is the unary bitwise NOT operator (https://www.sqlite.org/lang_expr.html#operators_and_parse_affecting_attributes), so `SELECT ~~5` applies it twice and returns `5`. The tokenizer always read `~~` as PostgreSQL's `LIKE` match operator, so `SELECT ~~a FROM t` failed to parse with the SQLite dialect (`Expected: an expression, found: ~~`). A new dialect method, `supports_tilde_like_match_operator`, defaults to `true` so every other dialect keeps today's tokenization, and `SQLiteDialect` returns `false`, which makes `~~` and `~~~` tokenize as separate `~` tokens. The SQLite test covers both, and the dialects that keep the operator are tested to still parse `a ~~ b` and still reject a leading `~~`. -- 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]
