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

Wrong result for partition table with order by + limit #43158

Closed
Defined2014 opened this issue Apr 18, 2023 · 0 comments · Fixed by #43173
Closed

Wrong result for partition table with order by + limit #43158

Defined2014 opened this issue Apr 18, 2023 · 0 comments · Fixed by #43173
Assignees
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@Defined2014
Copy link
Contributor

Defined2014 commented Apr 18, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(a int, b int, index idx_bc(a, b)) PARTITION BY HASH (`b`) PARTITIONS 4;
insert into t values (1,2),(1,3),(1,1),(1,5);
analyze table t;
select * from t where a = 1 order by b limit 10;

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

mysql> select * from tcommonhash where a = 1 order by b limit 10;
+------+------+
| a    | b    |
+------+------+
|    1 |    1 |
|    1 |    2 |
|    1 |    3 |
|    1 |    5 |
+------+------+
4 rows in set (0.00 sec)

3. What did you see instead (Required)

mysql> select * from tcommonhash where a = 1 order by b limit 10;
+------+------+
| a    | b    |
+------+------+
|    1 |    1 |
|    1 |    3 |
|    1 |    5 |
|    1 |    2 |
+------+------+
4 rows in set (0.00 sec)

4. What is your TiDB version? (Required)

Only on master branch

@Defined2014 Defined2014 added type/bug The issue is confirmed as a bug. severity/critical labels Apr 18, 2023
@Defined2014 Defined2014 self-assigned this Apr 18, 2023
@ti-chi-bot ti-chi-bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Apr 18, 2023
@Defined2014 Defined2014 removed may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 labels Apr 18, 2023
@jebter jebter added sig/sql-infra SIG: SQL Infra component/tablepartition This issue is related to Table Partition of TiDB. labels Apr 19, 2023
@VelocityLight VelocityLight added the affects-7.1 This bug affects the 7.1.x(LTS) versions. label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants