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

tree: fix DatumPrev for collated string #97435

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

yuzefovich
Copy link
Member

@yuzefovich yuzefovich commented Feb 22, 2023

This commit removes the support of collated strings from DatumPrev. As it turns out, the comparison of collated strings is done by comparing their collation keys, and the current method of generating the previous string (simply subtracting 1 from the last non-zero byte) doesn't work. Similar bug in DatumNext was fixed in
1902d3d (which added the collated strings into randomly generated types), but I didn't stress the test to catch this bug. The impact of the bug is minor since it's only used in debug statement-bundle recreate command.

Epic: None

Release note: None

This commit removes the support of collated strings from `DatumPrev`. As
it turns out, the comparison of collated strings is done by comparing
their collation keys, and the current method of generating the previous
string (simply subtracting 1 from the last non-zero byte) doesn't work.
Similar bug in `DatumNext` was fixed in
1902d3d (which added the collated
strings into randomly generated types), but I didn't stress the test to
catch this bug. The impact of the bug is minor since it's only used in
`debut statement-bundle recreate` command.

Epic: None

Release note: None
@yuzefovich yuzefovich requested review from rytaft, michae2 and a team February 22, 2023 02:55
@yuzefovich yuzefovich requested a review from a team as a code owner February 22, 2023 02:55
@blathers-crl
Copy link

blathers-crl bot commented Feb 22, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @michae2)

@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 22, 2023

Build succeeded:

@craig craig bot merged commit ba65327 into cockroachdb:master Feb 22, 2023
@yuzefovich yuzefovich deleted the fix-datum-prev branch February 22, 2023 05:05
@yuzefovich yuzefovich restored the fix-datum-prev branch February 22, 2023 17:10
@yuzefovich yuzefovich deleted the fix-datum-prev branch February 22, 2023 17:10
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