Skip to content

wrong list partition prune for non point range #57062

@joechenrh

Description

@joechenrh

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions