LucaCappelletti94 opened a new pull request, #2758: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2758
Since version 16, PostgreSQL reads `0x1F`, `0X1F`, `0o17` and `0b101` as integers, with underscores allowed as in `0x_FF_FF` ([docs](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS-NUMERIC)). `PostgreSqlDialect` turned `0x1F` into `Value::HexStringLiteral("1F")`, the same value as the bit string `X'1F'`, and split the other spellings into a zero followed by an alias, so `SELECT 0o17` came back as `SELECT 0 AS o17`. The new `Dialect::supports_non_decimal_integer_literals`, enabled for PostgreSQL, makes the tokenizer read these prefixes into a `Number` token that keeps the literal as written, so it round-trips. With the `bigdecimal` feature the value is stored as its decimal, the same way `10_000` already is. Other dialects, `GenericDialect` included, keep `0x` as a hex string, as MySQL and SQL Server read it. -- 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]
