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

Partition pruning get wrong partition for PointGet with single int column PK #51797

Closed
mjonss opened this issue Mar 14, 2024 · 0 comments · Fixed by #51796
Closed

Partition pruning get wrong partition for PointGet with single int column PK #51797

mjonss opened this issue Mar 14, 2024 · 0 comments · Fixed by #51796
Labels
severity/critical sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@mjonss
Copy link
Contributor

mjonss commented Mar 14, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t (c int, a int not null primary key, b int) partition by range (a) (partition p0 values less than (10), partition pMax values less than (maxvalue));
insert into t values(1, 13, 1);
select * from t WHERE `a` BETWEEN 13 AND 13;

This is a regression from #49161.

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

The row that was just inserted.

3. What did you see instead (Required)

tidb> create table t (c int, a int not null primary key, b int) partition by range (a) (partition p0 values less than (10), partition pMax values less than (maxvalue));
Query OK, 0 rows affected (0.08 sec)

tidb> insert into t values(1, 13, 1);
Query OK, 1 row affected (0.01 sec)

tidb> select * from t WHERE `a` BETWEEN 13 AND 13;
Empty set (0.00 sec)

tidb> select * from t;
+------+----+------+
| c    | a  | b    |
+------+----+------+
|    1 | 13 |    1 |
+------+----+------+
1 row in set (0.00 sec)

The row exists, but will not be found due to bad partitioning pruning.

4. What is your TiDB version? (Required)

tidb_version(): Release Version: v8.0.0-alpha-491-gb609fa6d27
Edition: Community
Git Commit Hash: b609fa6d271b514dfc83530c5e14812dd043cd2e
Git Branch: HEAD
UTC Build Time: 2024-03-13 19:22:29
GoVersion: go1.21.6
Race Enabled: false
Check Table Before Drop: false
Store: tikv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/critical sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants