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

release-21.1: sql/sem/tree: properly serialize physical values of enums #62210

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

ajwerner
Copy link
Contributor

Backport 1/1 commits from #61933.

/cc @cockroachdb/release


The optimizer generates check constraints for enums. It does so by
writing these constraints as physical values. Unfortunately the way
we serialized these physical values was bogus if the enum's physical
value was more than one byte long. The reason was because of a difference
between string literal and byte string literals and their use of \x.

This fixes that by using hex byte string literals for these enum
values.

Fixes #61814

Release note (bug fix): Fixed a bug whereby enums which have large numbers of
values may cause unexpected errors when attempting to read from tables with
columns using that enum.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@ajwerner ajwerner requested a review from arulajmani March 18, 2021 20:18
The optimizer generates check constraints for enums. It does so by
writing these constraints as physical values. Unfortunately the way
we serialized these physical values was bogus if the enum's physical
value was more than one byte long. The reason was because of a difference
between string literal and byte string literals and their use of `\x`.

This fixes that by using hex byte string literals for these enum
values.

Fixes cockroachdb#61814

Release note (bug fix): Fixed a bug whereby enums which have large numbers of
values may cause unexpected errors when attempting to read from tables with
columns using that enum.
@ajwerner ajwerner force-pushed the backport21.1-61933 branch from e08d837 to 5cf07c4 Compare March 25, 2021 03:08
@ajwerner ajwerner merged commit bd7407d into cockroachdb:release-21.1 Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants