-
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
table: remove reading from non-specificed partitions in IODKU #24872
Conversation
Added missing 'W' in ...TableWithGiven...
In Insert ON DUPLICATE KEY UPDATE, if the inserted row was not in the specified explicit partitioning list, it was still reading from non listed partitions, allowing to alter data outside the given list of partitions.
Minor refactoring, taking advantage of overloading functionality of partitionTableWithGivenSets on top of partitionTable. Also renamed 'partitions' to 'givenSetPartition' for clarity and not overload the partitionTable.partitions variable.
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
@rebelice: Thanks for your review. The bot only counts In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 56f126c
|
/run-cherry-picker |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #25000 |
What problem does this PR solve?
Issue Number: close #24746
Problem Summary: For INSERT, it was only checked that the partition to write to matched the explicit list of partitions, so if the original row was outside the list of partition[s] and ON DUPLICATE KEY was used, it would still read/check the existence of the original row and if existed + resulting row would match the listed partitions, it was allowed.
What is changed and how it works?
What's Changed:
Check the original given rows for INSERT INTO table PARTITION (list_of_partitions) ... ON DUPLICATE KEY UPDATE ... so they match the list_of_partitions.
How it Works:
When
GetPartitionByRow()
is called, also check if there is a specified list of partitions and if so, check the matching partition against that list.Related changes
Check List
Tests
Side effects
Release note
INSERT INTO table PARTITION (<partitions>) ... ON DUPLICATE KEY UPDATE
to read from non-listed partitions