Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: b'xxxx' should be parsed as a BIT(n) #74579

Open
mgartner opened this issue Jan 7, 2022 · 1 comment
Open

sql: b'xxxx' should be parsed as a BIT(n) #74579

mgartner opened this issue Jan 7, 2022 · 1 comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. E-quick-win Likely to be a quick win for someone experienced. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@mgartner
Copy link
Collaborator

mgartner commented Jan 7, 2022

In Postgres, a literal like b'1001' is parsed as a BIT(4):

marcus=# SELECT pg_typeof(b'1001');
 pg_typeof
-----------
 bit
(1 row)

We know it is not parsed as a VARBIT because the output is bit, instead of bit varying.

In CRDB v21.2.3, it is parsed as a BYTES:

defaultdb> SELECT pg_typeof(b'1001');
  pg_typeof
-------------
  bytea
(1 row)

We should match Postgres for consistency.

Jira issue: CRDB-12158

@mgartner mgartner added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jan 7, 2022
@blathers-crl blathers-crl bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) T-sql-queries SQL Queries Team labels Jan 7, 2022
@rafiss
Copy link
Collaborator

rafiss commented Jan 10, 2022

This seems like a dupe of #26128 but it probably is worth keeping this finer-grained issue. The backwards-incompatibility story on fixing this is rough.

@rafiss rafiss added A-sql-pgcompat Semantic compatibility with PostgreSQL E-quick-win Likely to be a quick win for someone experienced. labels Nov 17, 2022
@exalate-issue-sync exalate-issue-sync bot removed the T-sql-queries SQL Queries Team label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. E-quick-win Likely to be a quick win for someone experienced. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

2 participants