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: add BIT(0) type #132944

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mgartner
Copy link
Collaborator

sql: add BIT(0) type

The BIT(0) type is now supported. It represents a BIT type with
unspecified length. This is a divergence from Postgres which does not
allow this type and has no way to represent it in SQL. It is required in
order for it to be correctly serialized into SQL and evaluated during
distributed query execution.VARBIT cannot be used because it has a
different OID.

Fixes #131346

There is no release note because this bug is not present in any previous
releases and there is no need to document this new type.

Release note: None

The `BIT(0)` type is now supported. It represents a `BIT` type with
unspecified length. This is a divergence from Postgres which does not
allow this type and has no way to represent it in SQL. It is required in
order for it to be correctly serialized into SQL and evaluated during
distributed query execution.VARBIT cannot be used because it has a
different OID.

Fixes cockroachdb#131346

There is no release note because this bug is not present in any previous
releases and there is no need to document this new type.

Release note: None
@mgartner mgartner requested review from a team October 18, 2024 17:54
@mgartner mgartner requested review from a team as code owners October 18, 2024 17:54
@mgartner mgartner requested review from DrewKimball and removed request for a team October 18, 2024 17:54
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mgartner
Copy link
Collaborator Author

I welcome bikeshedding on the name of this type. Another option I considered was BIT(-1) which would match its type modifier in pg_catalog, but opted against it because we currently only parse unsigned integers in variable-length types and I didn't want to stray from that. Another option would be give it a unique name, like BITN.

@mgartner mgartner added backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. backport-24.2.x Flags PRs that need to be backported to 24.2 labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. backport-24.2.x Flags PRs that need to be backported to 24.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

roachtest: unoptimized-query-oracle/disable-rules=half/rand-multi-region failed
2 participants