Details
Description
setup database
|
DROP TABLE IF EXISTS t0; |
DROP TABLE IF EXISTS t1; |
|
CREATE TABLE t0 ( |
wkey INTEGER |
);
|
|
CREATE TABLE t1 ( |
pkey INTEGER PRIMARY KEY, |
c1 INTEGER |
);
|
|
INSERT INTO t1 VALUES(2,3); |
INSERT INTO t0 VALUES(1); |
|
In mariadb he returns an error. But it doesn't seem to return an error.
--mariadb
|
SELECT * |
FROM t0 |
WHERE EXISTS ( |
SELECT |
*
|
FROM |
(t1 AS ref_1 |
JOIN ( |
SELECT |
t0.wkey AS c1 |
FROM |
t0 AS ref_4 |
) AS subq_0 |
ON true )); |
|
|
ERROR 1054 (42S22): Unknown column 't0.wkey' in 'field list' |
|
|
And in mysql it does not return error.
--mysql
|
SELECT * |
FROM t0 |
WHERE EXISTS ( |
SELECT |
*
|
FROM |
(t1 AS ref_1 |
JOIN ( |
SELECT |
t0.wkey AS c1 |
FROM |
t0 AS ref_4 |
) AS subq_0 |
ON true )); |
|
+------+ |
| wkey |
|
+------+ |
| 1 |
|
+------+ |
1 row in set (0.00 sec) |
|
|
I found that after removing AS ref_4 , error is not returned in mariadb. It seems that there is a problem with this as processing.
--mariadb
|
SELECT * |
FROM t0 |
WHERE EXISTS ( |
SELECT |
*
|
FROM |
(t1 AS ref_1 |
JOIN ( |
SELECT |
t0.wkey AS c1 |
FROM |
t0
|
) AS subq_0 |
ON true )); |
+------+ |
| wkey |
|
+------+ |
| 1 |
|
+------+ |
1 row in set (0.00 sec) |
|
|