-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
charset: fix incorrect result when querying in-txn updates when new collation is enabled #18703
Conversation
…ollation is enabled
7f5cbc0
to
f1aba80
Compare
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
/merge |
/run-all-tests |
@bb7133 merge failed. |
/run-integration-copr-test |
/run-check_dev |
The decoding status can be tracked by the type system. This can help prevent bugs such as the one fixed here: pingcap#18703
What problem does this PR solve?
Issue Number: close #18702
Problem Summary:
In TiDB, an uncommitted update within an ongoing transaction is saved in a memory buffer. When read by the ongoing transaction, the value in the memory buffer is supposed to be returned. However, for a column with new collation(when the config
new_collations_enabled_on_first_bootstrap
is set to true) and the ongoing transaction is reading the uncommitted update with a unique index, the value is wrongly decoded. As a result, the uncommitted update is not included in the result and thus causes the bug.What is changed and how it works?
What's Changed and how it works:
The
DecodeIndexHandle
is used to decode the handle from the index value in the memory buffer, fix it by adding support for the new collation:tidb/executor/mem_reader.go
Line 350 in 1077b04
Check List
Tests
See the charset: incorrect result when querying in-txn updates when new collation is enabled #18702
Side effects
Release note