Parse more variations of bits and bytes #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "parse-binary-better"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds new tokens for bits and bytes. We now support these three variations of bits and bytes syntax:
I've also added a few tests for these new parsers.
This work was triggered to resolve this syntax parsing issue for BigQuery byte strings:

PostgreSQL 14 Reference: https://www.postgresql.org/docs/14/functions-bitstring.html
MySQL 8.0 Reference: https://dev.mysql.com/doc/refman/8.0/en/bit-value-literals.html
BigQuery Example: https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#byte_length
It looks like the
0bformat was parsed by default before and now requires an option to be enabled. Is that intentional?Same question for no longer accepting
0B.You are correct, I have found 0b to be supported in MySQL only, hence only enabling that route for those parsers since PostgreSQL for example would parse it as a integer and then get a syntax error at
b. But I’m open to switch the default if we want to be backwards-compatible.0B is removed because it’s not valid according to MySQL docs.
Thanks, merged as
cc88732(after reindenting the new test file to use 2 spaces).Thank you for prompt feedback and maintaining CodeMirror! ❤️
Pull request closed