Comment 2 for bug 806510

Igor Babaev (igorb-seattle) wrote :

This bug can be reproduced with a view instead if the derived table:

MariaDB [test]> CREATE VIEW v2 AS SELECT * FROM t2;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]> EXPLAIN SELECT * FROM v2 AS alias1 WHERE EXISTS ( SELECT t3.f2 FROM t3 , t1 WHERE t1.f3 = t3.f3 AND alias1.f2 != 0 );
+----+--------------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+--------------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
| 1 | PRIMARY | t2 | ALL | NULL | NULL | NULL | NULL | 2 | Using where |
| 2 | DEPENDENT SUBQUERY | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Impossible WHERE noticed after reading const tables |
+----+--------------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
2 rows in set (0.00 sec)