Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 10.6, 10.4(EOL), 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
Description
CREATE TABLE t1 (id int, d1 TIMESTAMP); |
INSERT INTO t1 (id,d1) VALUES (1,'2022-11-15 11:00:00.0'),(1,'2022-11-15 10:00:00.0'),(1,'2022-11-14 11:00:00.0'); |
|
select * FROM t1 where d1 in (select d1 from t1 ); |
set optimizer_switch='semijoin=off'; |
select * FROM t1 where d1 in (select d1 from t1 ); |
|
MariaDB [test]> select * FROM t1 where d1 in (select d1 from t1 );
|
+------+---------------------+
|
| id | d1 |
|
+------+---------------------+
|
| 1 | 2022-11-15 11:00:00 |
|
| 1 | 2022-11-15 10:00:00 |
|
| 1 | 2022-11-14 11:00:00 |
|
+------+---------------------+
|
3 rows in set (0,002 sec)
|
|
MariaDB [test]> set optimizer_switch='semijoin=off';
|
Query OK, 0 rows affected (0,000 sec)
|
|
MariaDB [test]> select * FROM t1 where d1 in (select d1 from t1 );
|
Empty set (0,002 sec)
|
|
|
MariaDB [test]> analyze select * FROM t1 where d1 in (select t1.d1 from t1 );
|
+------+--------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | r_rows | filtered | r_filtered | Extra |
|
+------+--------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------------+
|
| 1 | PRIMARY | t1 | ALL | NULL | NULL | NULL | NULL | 3 | 3.00 | 100.00 | 0.00 | Using where |
|
| 2 | MATERIALIZED | t1 | ALL | NULL | NULL | NULL | NULL | 3 | NULL | 100.00 | NULL | |
|
+------+--------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------------+
|
2 rows in set (0,002 sec)
|