Skip to content

incorrect tableDual plan caused by comparing year with big value #50235

@wjhuang2016

Description

@wjhuang2016

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `tlff7fd271` (
  `col_45` bit(3) NOT NULL DEFAULT b'101',
  `col_46` year(4) NOT NULL DEFAULT '2016',
  `col_47` double NOT NULL DEFAULT '2508.393214016021',
  `col_48` timestamp NOT NULL DEFAULT '2025-11-27 00:00:00',
  KEY `idx_15` (`col_45`,`col_47`),
  PRIMARY KEY (`col_46`,`col_45`,`col_48`) /*T![clustered_index] NONCLUSTERED */,
  KEY `idx_17` (`col_45`,`col_46`,`col_47`),
  UNIQUE KEY `idx_18` (`col_45`,`col_48`,`col_46`)
);
desc SELECT `tlff7fd271`.`col_46` AS `r0` FROM `tlff7fd271` where `col_46` <= 16212511333665770580;

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

TableScan or IndexScan

3. What did you see instead (Required)

mysql> desc SELECT `tlff7fd271`.`col_46` AS `r0` FROM `tlff7fd271` where `col_46` <= 16212511333665770580;
+-------------+---------+------+---------------+---------------+
| id          | estRows | task | access object | operator info |
+-------------+---------+------+---------------+---------------+
| TableDual_5 | 0.00    | root |               | rows:0        |
+-------------+---------+------+---------------+---------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

182efd8

Metadata

Metadata

Labels

affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-7.6affects-8.1This bug affects the 8.1.x(LTS) versions.fuzz/randomtestseverity/majorsig/plannerSIG: Plannertype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions