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)
|