-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: adding too many enum values may render tables using them inaccessible #61814
Comments
random thought: Maybe it relates to the limit on number of times we can find a "midpoint" floating point number. |
it's not a floating point number |
Oh I see now that it's bytes -- I was thinking of this but forgot the details: cockroach/pkg/sql/enum/enum.go Line 51 in 8187c25
|
I got to the bottom of this. It was a misunderstanding of
However, for our
We'd need to encode the enum as:
or
Instead, I'm going to make a change to encode it as:
|
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.
61933: sql/sem/tree: properly serialize physical values of enums r=ajwerner a=ajwerner 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. Co-authored-by: Andrew Werner <awerner32@gmail.com>
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.
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.
Describe the problem
I have no clue why this is happening but this seems quite bad.
@ajwerner I ran into this when trying to test the byte representation stuff we were discussing about on #61406.
Please describe the issue you observed, and any steps we can take to reproduce it:
To Reproduce
The text was updated successfully, but these errors were encountered: