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

prepared-plan-cache: the results is different from the prepare statment #29565

Closed
ChenPeng2013 opened this issue Nov 8, 2021 · 1 comment · Fixed by #29579
Closed

prepared-plan-cache: the results is different from the prepare statment #29565

ChenPeng2013 opened this issue Nov 8, 2021 · 1 comment · Fixed by #29579
Assignees
Labels
affects-5.3 This bug affects 5.3.x versions. epic/plan-cache severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

prepared-plan-cache.enabled = true

use test;
drop table if exists PK_SIGNED_10094;
CREATE TABLE `PK_SIGNED_10094` (
  `COL1` decimal(55,0) NOT NULL,
  PRIMARY KEY (`COL1`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
insert into PK_SIGNED_10094  values(-9999999999999999999999999999999999999999999999999999999);


prepare stmt from 'select * from PK_SIGNED_10094 where col1 != ? and col1 + 10 <=> ? + 10';
set @a=7309027171262036496, @b=-9798213896406520625;
execute stmt using @a,@b;
set @a=5408499810319315618, @b=-9999999999999999999999999999999999999999999999999999999;
execute stmt using @a,@b;


prepare stmt from 'select * from PK_SIGNED_10094 where col1 != ? and col1 + 10 <=> ? + 10';
set @a=5408499810319315618, @b=-9999999999999999999999999999999999999999999999999999999;
execute stmt using @a,@b;

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

the results are same

3. What did you see instead (Required)

mysql> execute stmt using @a,@b;
Empty set, 3 warnings (0.00 sec)

mysql>
mysql>
mysql> prepare stmt from 'select * from PK_SIGNED_10094 where col1 != ? and col1 + 10 <=> ? + 10';
Query OK, 0 rows affected (0.00 sec)

mysql> set @a=5408499810319315618, @b=-9999999999999999999999999999999999999999999999999999999;
Query OK, 0 rows affected (0.00 sec)

mysql> execute stmt using @a,@b;
+----------------------------------------------------------+
| COL1                                                     |
+----------------------------------------------------------+
| -9999999999999999999999999999999999999999999999999999999 |
+----------------------------------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

Release Version: v5.4.0-alpha-45-ge98d58757
Edition: Community
Git Commit Hash: e98d587577d66e358c50edaa39f08852a0b3314d
Git Branch: master
UTC Build Time: 2021-11-08 06:43:19
GoVersion: go1.16.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@github-actions
Copy link

github-actions bot commented Nov 9, 2021

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 This bug affects 5.3.x versions. epic/plan-cache severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
2 participants