Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11
-
None
Description
For the following testcase that is a variant of the testcase from main/explain.test for bug #11829785 one can see different results from the first and the second execution of the prepared EXPLAIN:
MariaDB [test]> CREATE TABLE t1(a INT);
|
Query OK, 0 rows affected (0.018 sec)
|
|
MariaDB [test]>
|
MariaDB [test]> INSERT INTO t1 VALUES (0), (0);
|
Query OK, 2 rows affected (0.005 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> PREPARE s FROM
|
-> 'EXPLAIN
|
'> SELECT SUBSTRING(1, (SELECT 1 FROM t1 a1 RIGHT OUTER JOIN t1 ON 0)) AS d
|
'> FROM t1 WHERE 0 > ANY (SELECT @a FROM t1)';
|
Query OK, 0 rows affected (0.002 sec)
|
Statement prepared
|
|
MariaDB [test]> EXECUTE s;
|
ERROR 1242 (21000): Subquery returns more than 1 row
|
MariaDB [test]> EXECUTE s;
|
+------+----------------------+-------+------+---------------+------+---------+------+------+-------------------------------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+----------------------+-------+------+---------------+------+---------+------+------+-------------------------------------------------+
|
| 1 | PRIMARY | t1 | ALL | NULL | NULL | NULL | NULL | 2 | |
|
| 3 | UNCACHEABLE SUBQUERY | t1 | ALL | NULL | NULL | NULL | NULL | 2 | |
|
| 2 | SUBQUERY | t1 | ALL | NULL | NULL | NULL | NULL | 2 | |
|
| 2 | SUBQUERY | a1 | ALL | NULL | NULL | NULL | NULL | 2 | Using where; Using join buffer (flat, BNL join) |
|
+------+----------------------+-------+------+---------------+------+---------+------+------+-------------------------------------------------+
|
4 rows in set (0.002 sec)
|