prepared-plan-cache: the results is different from the prepare statment #29565
Closed
Description
opened on Nov 8, 2021
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
Activity