Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Duplicate
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
Description
CREATE TABLE t1 (a INT, b INT); |
INSERT INTO t1 VALUES (2,20),(3,30); |
CREATE TABLE t2 (c INT); |
INSERT INTO t2 VALUES (1),(10),(100); |
|
SELECT a FROM t1 WHERE a IN ( b <= ALL ( SELECT c FROM t2 ) ); |
|
CREATE VIEW v AS |
SELECT a FROM t1 WHERE a IN ( b <= ALL ( SELECT c FROM t2 ) ); |
SELECT * FROM v; |
|
DROP VIEW v; |
DROP TABLE t1, t2; |
Plain query |
MariaDB [test]> SELECT a FROM t1 WHERE a IN ( b <= ALL ( SELECT c FROM t2 ) ); |
Empty set (0.00 sec) |
View |
MariaDB [test]> CREATE VIEW v AS |
-> SELECT a FROM t1 WHERE a IN ( b <= ALL ( SELECT c FROM t2 ) ); |
Query OK, 0 rows affected (0.08 sec) |
|
MariaDB [test]> SELECT * FROM v; |
+------+ |
| a |
|
+------+ |
| 2 |
|
| 3 |
|
+------+ |
2 rows in set (0.00 sec) |
Also reproducible with MySQL 5.5, 5.7. I didn't file a bug for MySQL, though.
Attachments
Issue Links
- duplicates
-
MDEV-30082 View definition losing brackets changes semantics of the query and causes wrong result
- Closed