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 list partition prune for non point range #57062

Closed
joechenrh opened this issue Nov 1, 2024 · 2 comments · Fixed by #57072
Closed

wrong list partition prune for non point range #57062

joechenrh opened this issue Nov 1, 2024 · 2 comments · Fixed by #57072
Assignees
Labels
affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. fuzz/randomtest severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@joechenrh
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE t1 (
  col1 int, col2 int
) PARTITION BY LIST (col2)
(PARTITION p0 VALUES IN (1),
 PARTITION p1 VALUES IN (-1));

insert into t1 values (1, -1);

select col1 from t1 where col1 > 0;

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

+------+
| col1 |
+------+
|    1 |
+------+

3. What did you see instead (Required)

Empty set (0.00 sec)

From the plan, we can see that we got a wrong partition.

+-------------------------+---------+-----------+---------------+--------------------------------+
| id                      | estRows | task      | access object | operator info                  |
+-------------------------+---------+-----------+---------------+--------------------------------+
| TableReader_7           | 0.33    | root      | partition:p0  | data:Selection_6               |
| └─Selection_6           | 0.33    | cop[tikv] |               | gt(test.t1.col1, 0)            |
|   └─TableFullScan_5     | 1.00    | cop[tikv] | table:t1      | keep order:false, stats:pseudo |
+-------------------------+---------+-----------+---------------+--------------------------------+
3 rows in set (0.00 sec)

4. What is your TiDB version? (Required)

@joechenrh joechenrh added the type/bug The issue is confirmed as a bug. label Nov 1, 2024
@joechenrh
Copy link
Contributor Author

/component tablepartition

@ti-chi-bot ti-chi-bot bot added the component/tablepartition This issue is related to Table Partition of TiDB. label Nov 1, 2024
@Defined2014 Defined2014 self-assigned this Nov 1, 2024
@Defined2014
Copy link
Contributor

I think it caused by #56725

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/tablepartition This issue is related to Table Partition of TiDB. fuzz/randomtest severity/major 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.

5 participants