LucaCappelletti94 opened a new pull request, #3028: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3028
Postfix `a NOT NULL + 1` means `(a NOT NULL) + 1` in SQLite, but sqlparser printed it as `a IS NOT NULL + 1`. SQLite parses `IS NOT` as a binary operator that binds looser than `+`, so it reads that text as `a IS NOT (NULL + 1)`. When `a` is NULL the input gives 1 and the printed text gives 0. `Expr::IsNull` and `Expr::IsNotNull` do not remember how they were written, so `Display` has no way to choose. Both become struct variants whose `syntax` field records `IS NULL`, `ISNULL`, `IS NOT NULL`, `NOT NULL` or `NOTNULL`, and they print back as written. This breaks code that matches on these two variants, and `x NOTNULL` no longer prints as `x IS NOT NULL` in PostgreSQL and DuckDB. -- 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]
