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

planner: incompatible behavior between prepared statements and non-prep statements #42439

Closed
qw4990 opened this issue Mar 21, 2023 · 0 comments · Fixed by #42443
Closed

planner: incompatible behavior between prepared statements and non-prep statements #42439

qw4990 opened this issue Mar 21, 2023 · 0 comments · Fixed by #42443

Comments

@qw4990
Copy link
Contributor

qw4990 commented 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 |
+-----------------------------------------+
@qw4990 qw4990 added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner severity/moderate epic/plan-cache labels Mar 21, 2023
@qw4990 qw4990 changed the title planner: uncompatible behavior between prepared statements and non-prep statements planner: incompatible behavior between prepared statements and non-prep statements Mar 21, 2023
ti-chi-bot pushed a commit that referenced this issue Mar 22, 2023
YangKeao pushed a commit to YangKeao/tidb that referenced this issue Sep 7, 2023
ti-chi-bot bot pushed a commit that referenced this issue Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants