-
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
Specify non-matching partition insert record fail expectly,but successful #24746
Comments
Issue is that the |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
BugTable/Partition allowed to read from non specified partition when: if value 'v' was not in partition pN, it would still check in the other partition and if found update the value if it would result in partition pN (if not, then it would give the correct error). 1. Root Cause Analysis (RCA) (optional)For insert, only the writing was checked against the given partitions, not the reading. 2. SymptomAllowed to read from non specified partition 3. All Trigger Conditions (optional)partitioned table, insert on duplicate key update reading from non specified partition, but writing to a partition in the given set. 4. Workaround (optional)n/a cannot use explicit partition selection to limit the query for reading (only for writing) 5. Affected versionsAll 6. Fixed versionsTBD |
( FixedVersions AffectedVersions ) fields are empty. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create table t(a int, b varchar(40), c int, primary key(b(8),a)) partition by range(a)(partition p0 values less than (5),partition p1 values less than (10), partition p2 values less than maxvalue);
insert into t partition (p0) values(4,'test',4) on duplicate key update a= a +1;
insert into t partition (p1) values(4,'test',4) on duplicate key update a= a +1;
2. What did you expect to see? (Required)
mysql> insert into t partition (p1) values(4,'test',4) on duplicate key update a= a +1;
ERROR 1748 (HY000): Found a row not matching the given partition set
3. What did you see instead (Required)
mysql> insert into t partition (p1) values(4,'test',4) on duplicate key update a= a +1;
Query OK, 2 rows affected (0.01 sec)
4. What is your TiDB version? (Required)
Release Version: v5.0.1-3-g41c0f1762
Edition: Community
Git Commit Hash: 41c0f17
Git Branch: release-5.0
UTC Build Time: 2021-05-13 17:21:10
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered: