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

PointGet/BatchPointGet will break partition selection #19141

Closed
zyguan opened this issue Aug 11, 2020 · 2 comments · Fixed by #19164
Closed

PointGet/BatchPointGet will break partition selection #19141

zyguan opened this issue Aug 11, 2020 · 2 comments · Fixed by #19164
Assignees
Labels
priority/release-blocker This issue blocks a release. Please solve it ASAP. severity/critical type/bug The issue is confirmed as a bug.
Milestone

Comments

@zyguan
Copy link
Contributor

zyguan commented Aug 11, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t;
create table t (c_int int, primary key (c_int)) partition by hash ( c_int ) partitions 4;
insert into t values (1), (2), (3), (4);
select * from t partition (p0); -- only 4 is in p0
select * from t partition (p0) where c_int = 1;
update t partition (p0) set c_int = -c_int where c_int in (2, 3);
select * from t;

2. What did you expect to see? (Required)

Partition selection should prevent all rows in other partitions from being selected in any situation.

3. What did you see instead (Required)

mysql> select * from t partition (p0);
+-------+
| c_int |
+-------+
|     4 |
+-------+
1 row in set (0.05 sec)

mysql> select * from t partition (p0) where c_int = 1;
+-------+
| c_int |
+-------+
|     1 |
+-------+
1 row in set (0.05 sec)

mysql> update t partition (p0) set c_int = -c_int where c_int in (2, 3);
Query OK, 2 rows affected (0.05 sec)
Rows matched: 2  Changed: 2  Warnings: 0

mysql> select * from t;
+-------+
| c_int |
+-------+
|     4 |
|    -2 |
|     1 |
|    -3 |
+-------+
4 rows in set (0.06 sec)

4. What is your TiDB version? (Required)

master @ 8978773
release-4.0 @ 3948c7b

@zyguan zyguan added the type/bug The issue is confirmed as a bug. label Aug 11, 2020
@zyguan
Copy link
Contributor Author

zyguan commented Aug 11, 2020

/assign @tiancaiamao

@zyguan
Copy link
Contributor Author

zyguan commented Aug 11, 2020

/label severity/critical

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This issue blocks a release. Please solve it ASAP. severity/critical type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants