Bug #106975 the function Item_func_in which returns incorrect result
Submitted: 11 Apr 2022 10:08 Modified: 11 Apr 2022 10:10
Reporter: huahua xu Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version: OS:Linux
Assigned to: CPU Architecture:Any

[11 Apr 2022 10:08] huahua xu
Description:
the function Item_func_in returns incorrect result where the compared field type is datetime.

How to repeat:
mysql> CREATE TABLE t1 ( pk INTEGER PRIMARY KEY, col_date date DEFAULT NULL,col_datetime datetime DEFAULT NULL, col_varchar VARCHAR(1) DEFAULT NULL, KEY (col_varchar));

mysql> INSERT INTO t1 VALUES(5, '2022-02-25', '2022-02-25 11:01:14', 'I');

mysql> INSERT INTO t1 VALUES(6, '2022-02-26', '2022-02-26 21:11:24', 'J');

mysql> SELECT * FROM t1 wHERE pk = 5 AND (col_datetime, col_varchar) IN (('2022-02-25 11:01:14', 'Y'), (92, 'W'));
+----+------------+---------------------+-------------+
| pk | col_date | col_datetime | col_varchar |
+----+------------+---------------------+-------------+
| 5 | 2022-02-25 | 2022-02-25 11:01:14 | I |
+----+------------+---------------------+-------------+

mysql> SELECT * FROM t1 wHERE pk = 5 AND (col_varchar, col_datetime) IN (('Y', '2022-02-25 11:01:14'), ('W', 92));
Empty set, 1 warning (0.00 sec)
[11 Apr 2022 10:10] huahua xu
https://bugs.mysql.com/bug.php?id=106567