pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.23k stars 5.84k forks source link

overflow will cause error in plan cache #44230

Open aytrack opened 1 year ago

aytrack commented 1 year ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `IDT_MULTI15847STROBJSTROBJ` (
  `COL1` enum('^YSQT0]V@9TFN>^WB6G?NG@S8>VYOM;BSC@<BCQ6','T\\NKZQQ=C1@IH9W>64=ZISGS?O[JDFBI5M]QXJYQNSKU>NGAWLXS26LMTZ2YNN`XKIUGKY0IHDWV>E[BJJCABOKH1M^CB5E@DLS7Q88PWZTEAY]1ZQMN5NX[I<KBBK','PXWTHJ?R]P=`Y','OFJHCEKCQGT:MXI7P3[YO4N0DF=2XJWJ4Z9Z;HQ8TMUTZV8YLQAHWJ4BDZHR3A','@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13QW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE','NL3V:J9LM4U5KUCV<RIJ_RKMZ4;CXD_0:K`HCO=P1YNYTHX8KYZRQ?PL01HLNSUC_R7:I5<V[HV0BIDEBZAPT73R7`DP43XXPLQCEI8>R;P','M5=T5FLQEZMPZAXH]4G:TSYYYVQ7O@4S6C3N8WPFKSP;SRD6VW@94BBH8XCT','P]I52Y46F?@RMOOF6;FWDTO`7FIT]R:]ELHD[CNLDSHC7FPBYOOJXLZSBV^5C^AAF6J5BCKE4V9==@H=4C]GMZXPNM','ECIQWH>?MK=ARGI0WVJNIBZFCFVJHFIUYJ:2?2WWZBNBWTPFNQPLLBFP9R_','E<<T9UUF2?XM8TWS_','W[5E_U1J?YSOQISL1KD','M@V^`^8I','5UTEJUZIQJOJU_D6@V2DSVOIK@LUT^E?RTL>_Y9OT@SOPYR72VIJVMBWIVPF@TTBZ@8ZPBZL=LXZF`WM4V2?K>AT','PZ@PR6XN28JL`B','ZOHBSCRMZPOI`IVTSEZAIDAF7DS@1TT20AP9','QLDIOY[Y:JZR@OL__I^@FBO=O_?WOOR:2BE:QJC','BI^TGJ_N<H:7OW8XXITM@FBWDNJ=KA`X:9@BUY4UHKSHFP`EAWR9_QS^HR2AI39MGVXWVD]RUI46SHU=GXAX;RT765X:CU7M4XOD^S9JFZI=HTTS?C0CT','M@HGGFM43C7','@M`IHSJQ8HBTGOS`=VW]QBMLVWN`SP;E>EEXYKV1POHTOJQPGCPVR=TYZMGWABUQR07J8U::W4','N`ZN4P@9T[JW;FR6=FA4WP@APNPG[XQVIK4]F]2>EC>JEIOXC``;;?OHP') COLLATE utf8mb4_bin DEFAULT NULL,
  `COL2` smallint DEFAULT NULL,
  `COL3` timestamp(5) NULL DEFAULT NULL,
  KEY `U_M_COL4` (`COL1`,`COL2`),
  KEY `U_M_COL5` (`COL3`,`COL2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
INSERT INTO `IDT_MULTI15847STROBJSTROBJ` VALUES
('@M`IHSJQ8HBTGOS`=VW]QBMLVWN`SP;E>EEXYKV1POHTOJQPGCPVR=TYZMGWABUQR07J8U::W4',-21679,'2035-10-14 00:33:10.00000'),
('PZ@PR6XN28JL`B',20882,'2028-10-29 12:44:57.00000'),
('^YSQT0]V@9TFN>^WB6G?NG@S8>VYOM;BSC@<BCQ6',-6912,'1979-07-27 02:36:46.00000'),
('P]I52Y46F?@RMOOF6;FWDTO`7FIT]R:]ELHD[CNLDSHC7FPBYOOJXLZSBV^5C^AAF6J5BCKE4V9==@H=4C]GMZXPNM',19327,'2033-01-24 02:47:56.00000'),
('@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13\ZQW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE',9385,'1987-07-06 03:08:39.00000'),
('@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13\ZQW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE',-21890,'2004-08-30 16:40:37.00000'),
('@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13\ZQW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE',10525,'2020-04-14 01:58:41.00000'),
('W[5E_U1J?YSOQISL1KD',10880,'2026-04-05 15:16:57.00000'),
('NL3V:J9LM4U5KUCV<RIJ_RKMZ4;CXD_0:K`HCO=P1YNYTHX8KYZRQ?PL01HLNSUC_R7:I5<V[HV0BIDEBZAPT73R7`DP43XXPLQCEI8>R;P',-32318,'2023-05-28 15:58:08.00000'),
('PXWTHJ?R]P=`Y',-4733,'1974-09-07 22:05:59.00000'),
('W[5E_U1J?YSOQISL1KD',-29098,'2030-11-10 22:10:27.00000'),
('ECIQWH>?MK=ARGI0WVJNIBZFCFVJHFIUYJ:2?2WWZBNBWTPFNQPLLBFP9R_',-9815,'1986-04-28 13:06:28.00000'),
('E<<T9UUF2?XM8TWS_',-14040,'1996-09-07 22:44:35.00000'),
('E<<T9UUF2?XM8TWS_',1870,'1977-11-05 13:41:04.00000'),
('PZ@PR6XN28JL`B',8393,'2004-09-09 04:23:18.00000'),
('M@V^`^8I',4704,'1998-02-23 19:33:26.00000'),
('@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13\ZQW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE',-10852,'1981-11-17 21:04:08.00000'),
('M@V^`^8I',3763,'1981-07-08 13:10:46.00000'),
('@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13\ZQW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE',10322,'1991-04-04 09:12:38.00000'),
('ECIQWH>?MK=ARGI0WVJNIBZFCFVJHFIUYJ:2?2WWZBNBWTPFNQPLLBFP9R_',18529,'1984-11-19 06:07:30.00000'),
('M@HGGFM43C7',16882,'2016-11-01 15:12:33.00000'),
('ECIQWH>?MK=ARGI0WVJNIBZFCFVJHFIUYJ:2?2WWZBNBWTPFNQPLLBFP9R_',5570,'1997-04-30 20:15:05.00000'),
('E<<T9UUF2?XM8TWS_',22097,'1995-03-23 00:12:54.00000'),
('BI^TGJ_N<H:7OW8XXITM@FBWDNJ=KA`X:9@BUY4UHKSHFP`EAWR9_QS^HR2AI39MGVXWVD]RUI46SHU=GXAX;RT765X:CU7M4XOD^S9JFZI=HTTS?C0CT',-19140,'2032-06-24 22:47:29.00000'),
('M@HGGFM43C7',-25314,'2005-11-28 12:42:20.00000'),
('E<<T9UUF2?XM8TWS_',-32035,'2027-12-31 00:45:39.00000'),
('ZOHBSCRMZPOI`IVTSEZAIDAF7DS@1TT20AP9',26670,'2006-09-19 18:44:18.00000'),
('M@V^`^8I',6418,'2016-01-26 03:21:21.00000'),
('E<<T9UUF2?XM8TWS_',-16205,'1986-06-01 23:24:00.00000'),
('QLDIOY[Y:JZR@OL__I^@FBO=O_?WOOR:2BE:QJC',-9927,'1975-12-21 22:02:40.00000'),
('ZOHBSCRMZPOI`IVTSEZAIDAF7DS@1TT20AP9',18548,'1992-01-15 07:53:14.00000'),
('M@V^`^8I',-20034,'2036-08-31 01:15:57.00000'),
('M@HGGFM43C7',-20318,'1975-04-12 23:58:02.00000'),
('@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13\ZQW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE',-10602,'1991-12-16 03:28:02.00000'),
('QLDIOY[Y:JZR@OL__I^@FBO=O_?WOOR:2BE:QJC',-16781,'1990-05-18 23:54:45.00000'),
('QLDIOY[Y:JZR@OL__I^@FBO=O_?WOOR:2BE:QJC',7264,'2018-01-18 13:07:41.00000'),
('NL3V:J9LM4U5KUCV<RIJ_RKMZ4;CXD_0:K`HCO=P1YNYTHX8KYZRQ?PL01HLNSUC_R7:I5<V[HV0BIDEBZAPT73R7`DP43XXPLQCEI8>R;P',-26266,'1973-10-12 13:35:56.00000'),
('@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13\ZQW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE',13789,'2015-01-17 10:15:50.00000'),
('PXWTHJ?R]P=`Y',-11215,'2030-05-16 01:13:38.00000'),
('N`ZN4P@9T[JW;FR6=FA4WP@APNPG[XQVIK4]F]2>EC>JEIOXC``;;?OHP',7042,'2032-02-28 11:32:21.00000'),
('ZOHBSCRMZPOI`IVTSEZAIDAF7DS@1TT20AP9',3513,'2000-04-15 02:14:19.00000'),
('5UTEJUZIQ\ZJOJU_D6@V2DSVOIK@LUT^E?RTL>_Y9OT@SOPYR72VIJVMBWIVPF@TTBZ@8ZPBZL=LXZF`WM4V2?K>AT',9638,'1997-03-08 23:32:00.00000'),
('PXWTHJ?R]P=`Y',28145,'1971-04-10 09:54:39.00000'),
('E<<T9UUF2?XM8TWS_',1672,'2032-09-29 14:20:11.00000'),
('QLDIOY[Y:JZR@OL__I^@FBO=O_?WOOR:2BE:QJC',-1109,'1979-06-09 23:12:31.00000'),
('BI^TGJ_N<H:7OW8XXITM@FBWDNJ=KA`X:9@BUY4UHKSHFP`EAWR9_QS^HR2AI39MGVXWVD]RUI46SHU=GXAX;RT765X:CU7M4XOD^S9JFZI=HTTS?C0CT',21964,'2030-05-25 13:56:50.00000'),
('BI^TGJ_N<H:7OW8XXITM@FBWDNJ=KA`X:9@BUY4UHKSHFP`EAWR9_QS^HR2AI39MGVXWVD]RUI46SHU=GXAX;RT765X:CU7M4XOD^S9JFZI=HTTS?C0CT',7484,'2015-06-01 21:17:20.00000'),
('P]I52Y46F?@RMOOF6;FWDTO`7FIT]R:]ELHD[CNLDSHC7FPBYOOJXLZSBV^5C^AAF6J5BCKE4V9==@H=4C]GMZXPNM',21180,'2019-01-02 23:29:25.00000'),
('M@V^`^8I',1401,'2008-03-24 22:17:33.00000'),
('ZOHBSCRMZPOI`IVTSEZAIDAF7DS@1TT20AP9',10338,'1997-06-25 16:39:26.00000'),
('E<<T9UUF2?XM8TWS_',-27243,'1981-01-05 03:13:11.00000'),
('NL3V:J9LM4U5KUCV<RIJ_RKMZ4;CXD_0:K`HCO=P1YNYTHX8KYZRQ?PL01HLNSUC_R7:I5<V[HV0BIDEBZAPT73R7`DP43XXPLQCEI8>R;P',-30039,'2031-10-13 03:56:30.00000'),
('^YSQT0]V@9TFN>^WB6G?NG@S8>VYOM;BSC@<BCQ6',-22575,'1972-11-05 18:41:00.00000'),
('^YSQT0]V@9TFN>^WB6G?NG@S8>VYOM;BSC@<BCQ6',-9287,'1974-03-28 05:01:34.00000'),
('E<<T9UUF2?XM8TWS_',7459,'2027-06-07 07:21:39.00000'),
('^YSQT0]V@9TFN>^WB6G?NG@S8>VYOM;BSC@<BCQ6',-19748,'2010-09-04 13:41:48.00000'),
('N`ZN4P@9T[JW;FR6=FA4WP@APNPG[XQVIK4]F]2>EC>JEIOXC``;;?OHP',-17366,'1991-11-07 10:09:45.00000'),
('M@V^`^8I',5510,'2031-12-09 21:34:46.00000'),
('E<<T9UUF2?XM8TWS_',-12595,'2023-01-12 10:31:02.00000'),
('T\\NKZQQ=C1@IH9W>64=ZISGS?O[JDFBI5M]QXJYQNSKU>NGAWLXS26LMTZ2YNN`XKIUGKY0IHDWV>E[BJJCABOKH1M^CB5E@DLS7Q88PWZTEAY]1ZQMN5NX[I<KBBK',13330,'1974-04-20 04:46:12.00000'),
('ECIQWH>?MK=ARGI0WVJNIBZFCFVJHFIUYJ:2?2WWZBNBWTPFNQPLLBFP9R_',-356,'2013-05-25 10:16:46.00000'),
('T\\NKZQQ=C1@IH9W>64=ZISGS?O[JDFBI5M]QXJYQNSKU>NGAWLXS26LMTZ2YNN`XKIUGKY0IHDWV>E[BJJCABOKH1M^CB5E@DLS7Q88PWZTEAY]1ZQMN5NX[I<KBBK',-17797,'1997-10-02 21:17:21.00000'),
('QLDIOY[Y:JZR@OL__I^@FBO=O_?WOOR:2BE:QJC',-3333,'2021-04-22 15:36:23.00000'),
('M5=T5FLQEZMPZAXH]4G:TSYYYVQ7O@4S6C3N8WPFKSP;SRD6VW@94BBH8XCT',24020,'1995-03-18 03:15:01.00000'),
('ECIQWH>?MK=ARGI0WVJNIBZFCFVJHFIUYJ:2?2WWZBNBWTPFNQPLLBFP9R_',-11633,'1991-08-14 09:55:05.00000'),
('T\\NKZQQ=C1@IH9W>64=ZISGS?O[JDFBI5M]QXJYQNSKU>NGAWLXS26LMTZ2YNN`XKIUGKY0IHDWV>E[BJJCABOKH1M^CB5E@DLS7Q88PWZTEAY]1ZQMN5NX[I<KBBK',-32216,'1985-09-19 16:26:17.00000'),
('P]I52Y46F?@RMOOF6;FWDTO`7FIT]R:]ELHD[CNLDSHC7FPBYOOJXLZSBV^5C^AAF6J5BCKE4V9==@H=4C]GMZXPNM',19380,'2015-08-12 21:36:11.00000'),
('@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13\ZQW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE',-8842,'2025-07-10 00:29:24.00000'),
('PZ@PR6XN28JL`B',8622,'2026-07-06 01:58:03.00000'),
('T\\NKZQQ=C1@IH9W>64=ZISGS?O[JDFBI5M]QXJYQNSKU>NGAWLXS26LMTZ2YNN`XKIUGKY0IHDWV>E[BJJCABOKH1M^CB5E@DLS7Q88PWZTEAY]1ZQMN5NX[I<KBBK',-758,'2033-11-12 20:06:12.00000'),
('M@V^`^8I',-11501,'2035-11-14 09:05:36.00000'),
('@[ETQPEKKDD;9INXAQISU0O65J86AWQ2SZ8=ZZW6TKT4GCF_O13\ZQW_S>FIYA983K:E4N77@FINM5HVGQCUCVNF5WLOOOEORAM=_JLMVFURMUASTVDBE',-11478,'2020-09-17 19:16:29.00000'),
('^YSQT0]V@9TFN>^WB6G?NG@S8>VYOM;BSC@<BCQ6',357,'2013-01-15 06:00:29.00000'),
('^YSQT0]V@9TFN>^WB6G?NG@S8>VYOM;BSC@<BCQ6',-12500,'1990-10-28 04:16:34.00000');

prepare stmt from 'SELECT * FROM IDT_MULTI15847STROBJSTROBJ WHERE col2 = ? AND COL2 * ? > ?;';
  set @a=28145, @b=28145, @c=28145;
  execute stmt using @a,@b,@c;
  set @a=-32318, @b=-32318, @c=-32318;
  execute stmt using @a,@b,@c;
  set @a=-9287, @b=-9815, @c=-19748;
  execute stmt using @a,@b,@c;
  set @a=-360860821470, @b=1037975153909, @c=687344291891;
  execute stmt using @a,@b,@c;

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

follow sql query success

  set @a=-360860821470, @b=1037975153909, @c=687344291891;
  execute stmt using @a,@b,@c;

3. What did you see instead (Required)

 set @a=-360860821470, @b=1037975153909, @c=687344291891;
 execute stmt using @a,@b,@c;
(1815, 'expression gt(mul(-360860821470, 1037975153909), 687344291891) cannot be pushed down')

-- wait some time
TiDB root@127.0.0.1:new_data> execute stmt using @a,@b,@c;
+------+------+------+
| COL1 | COL2 | COL3 |
+------+------+------+
+------+------+------+

the plan changed.

  1. query failed plan

    mysql> explain for connection  8625184934786498979 ;
    +-------------------------+----------+---------+-----------+----------------------------------+----------------+-----------------------------------------------------------------------------------------+--------+------+
    | id                      | estRows  | actRows | task      | access object                    | execution info | operator info                                                                           | memory | disk |
    +-------------------------+----------+---------+-----------+----------------------------------+----------------+-----------------------------------------------------------------------------------------+--------+------+
    | TableReader_7           | 10.00    | 0       | root      |                                  |                | data:Selection_6                                                                        | N/A    | N/A  |
    | └─Selection_6           | 10.00    | 0       | cop[tikv] |                                  |                | eq(new_data.idt_multi15847strobjstrobj.col2, -360860821470), not recognized const vanue | N/A    | N/A  |
    |   └─TableFullScan_5     | 10000.00 | 0       | cop[tikv] | table:IDT_MULTI15847STROBJSTROBJ |                | keep order:false, stats:pseudo                                                          | N/A    | N/A  |
    +-------------------------+----------+---------+-----------+----------------------------------+----------------+-----------------------------------------------------------------------------------------+--------+------+
    3 rows in set (0.01 sec)
  2. query success

mysql> explain for connection 8625184934786498979 ; +-------------------------+---------+---------+-----------+----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+--------+------+ | id | estRows | actRows | task | access object | execution info | operator info | memory | disk | +-------------------------+---------+---------+-----------+----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+--------+------+ | TableReader_7 | 0.06 | 0 | root | | time:2.01ms, loops:1, cop_task: {num: 1, max: 1.93ms, proc_keys: 74, tot_proc: 127.5µs, tot_wait: 185.4µs, rpc_num: 1, rpc_time: 1.88ms, copr_cache_hit_ratio: 0.00, build_task_duration: 19.9µs, max_distsql_concurrency: 1} | data:Selection_6 | N/A | N/A | | └─Selection_6 | 0.06 | 0 | cop[tikv] | | tikv_task:{time:0s, loops:2}, scan_detail: {total_process_keys: 74, total_process_keys_size: 3922, total_keys: 75, get_snapshot_time: 144.1µs, rocksdb: {key_skipped_count: 74, block: {}}} | eq(new_data.idt_multi15847strobjstrobj.col2, -360860821470), gt(mul(-360860821470, 1037975153909), 687344291891) | N/A | N/A | | └─TableFullScan_5 | 74.00 | 74 | cop[tikv] | table:IDT_MULTI15847STROBJSTROBJ | tikv_task:{time:0s, loops:2} | keep order:false, stats:pseudo | N/A | N/A | +-------------------------+---------+---------+-----------+----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+--------+------+

### 4. What is your TiDB version? (Required)
```sql
mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                               |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.1.0
Edition: Community
Git Commit Hash: f8f6cda58bb892c9cba4031b004cb6015eacc830
Git Branch: heads/refs/tags/v7.1.0
UTC Build Time: 2023-05-26 05:56:50
GoVersion: go1.20.3
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
qw4990 commented 1 year ago

Caused by https://github.com/pingcap/tidb/pull/43009

qw4990 commented 1 year ago

The minimum reproducible case:

create table t (a smallint);
prepare stmt from 'SELECT * FROM t WHERE a = ? AND a * ? > ?;';
set @a=28145, @b=28145, @c=28145;
execute stmt using @a,@b,@c;
set @a=-360860821470, @b=1037975153909, @c=687344291891;
execute stmt using @a,@b,@c;
qw4990 commented 1 year ago

The new value is too large BIGINT value is out of range in '(-360860821470 * 1037975153909)':

[2023/05/30 15:07:01.237 +08:00] [ERROR] [expr_to_pb.go:108] ["eval constant or correlated column"] [expression="not recognized const vanue"] [error="[types:1690]BIGINT value is out of range in '(-360860821470 * 1037975153909)'"]
qw4990 commented 1 year ago

The minimum reproducible case:

create table t (a smallint);
prepare stmt from 'SELECT * FROM t WHERE a = ? AND a * ? > ?;';
set @a=28145, @b=28145, @c=28145;
execute stmt using @a,@b,@c;
set @a=-360860821470, @b=1037975153909, @c=687344291891;
execute stmt using @a,@b,@c;

After const propagation, the predicate a = ? and a * ? > ? is converted to ? * ? > ?. In the first execution, the result of 28145 * 28145 is OK and can be handled by INT. In the second execution, the result of -360860821470 * 1037975153909 is too large for INT, and the execution returns some error.

qw4990 commented 1 year ago

A minimum reproducible case:

prepare stmt from 'SELECT * FROM t WHERE ? * ? > ?;';
set @a=28145, @b=28145, @c=28145;
execute stmt using @a,@b,@c;
set @a=-360860821470, @b=1037975153909, @c=687344291891;
execute stmt using @a,@b,@c;
qw4990 commented 1 year ago

v6.5.0 has the same issue:

mysql> execute stmt using @a,@b,@c;
ERROR 1815 (HY000): expression gt(mul(-360860821470, 1037975153909), 687344291891) cannot be pushed down
mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                          |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.4.0-20230324
Edition: Community
Git Commit Hash: 706c3fa3c526cdba5b3e9f066b1a568fb96c56e3
Git Branch: HEAD
UTC Build Time: 2023-05-30 08:05:32
GoVersion: go1.20.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
qw4990 commented 1 year ago

I'll fix it later on.