Skip to content

Partition table work with PointGet plan get a wrong result #61176

@Defined2014

Description

@Defined2014

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `t235e2b52` (
  `col_36` bigint DEFAULT NULL,
  `col_37` varchar(463) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'T',
  `col_39` bigint DEFAULT '272523819217945548',
  `col_40` timestamp DEFAULT '2023-09-11 00:00:00',
  `col_41` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `col_42` bigint unsigned NOT NULL DEFAULT '5329417101757332864',
  PRIMARY KEY (`col_37`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
PARTITION BY RANGE COLUMNS(`col_37`)
(PARTITION `p0` VALUES LESS THAN ('q&Gmxiqq8qDCv1Lc5w'),
 PARTITION `p1` VALUES LESS THAN (MAXVALUE));

insert into t235e2b52(col_37, col_41) values ('YOqtJ', '');
select * from t235e2b52 where col_37 <=> 'YOqtJ';

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

mysql> select * from t235e2b52 where col_37 <=> 'YOqtJ';
+--------+--------+--------------------+---------------------+--------+---------------------+
| col_36 | col_37 | col_39             | col_40              | col_41 | col_42              |
+--------+--------+--------------------+---------------------+--------+---------------------+
|   NULL | YOqtJ  | 272523819217945548 | 2023-09-11 00:00:00 |        | 5329417101757332864 |
+--------+--------+--------------------+---------------------+--------+---------------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

Before #61141, return empty result.

After #61141, report unexpected error like

mysql> select * from t235e2b52 where col_37 <=> 'YOqtJ';
ERROR 1105 (HY000): too many partitions matching for PointGetPlan

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions