planner: incompatible behavior between prepared statements and non-prep statements #42439
Closed
Description
opened on Mar 21, 2023
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE UK_MU16407 (COL3 timestamp NULL DEFAULT NULL, UNIQUE KEY U3(COL3));
insert into UK_MU16407 values("1985-08-31 18:03:27");
SELECT COL3 FROM UK_MU16407 WHERE COL3>'2039-1-19 3:14:40';
PREPARE st FROM 'SELECT COL3 FROM UK_MU16407 WHERE COL3>?';
set @a='2039-1-19 3:14:40';
execute st using @a;
2. What did you expect to see? (Required)
No error in the above SQLs;
3. What did you see instead (Required)
mysql> execute st using @a;
ERROR 1292 (22007): Incorrect timestamp value: '2039-01-19 03:14:40.000000'
4. What is your TiDB version? (Required)
+-----------------------------------------+
| version() |
+-----------------------------------------+
| 5.7.25-TiDB-v7.1.0-alpha-93-g0d1d140ba1 |
+-----------------------------------------+
Activity