summaryrefslogtreecommitdiff
path: root/mysql-test/main/derived.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/derived.test')
-rw-r--r--mysql-test/main/derived.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/main/derived.test b/mysql-test/main/derived.test
index 904114e33b9..e25c1c89ad3 100644
--- a/mysql-test/main/derived.test
+++ b/mysql-test/main/derived.test
@@ -1126,3 +1126,23 @@ analyze select * from t1 , ( (select t2.a from t2 order by c) union all (select
select * from t1 , ( (select t2.a from t2 order by c) union all (select t2.a from t2 order by c) except(select t3.a from t3 order by b))q where t1.a=q.a;
drop table t1,t2,t3;
+
+
+--echo #
+--echo # MDEV-16549: Server crashes in Item_field::fix_fields on query with
+--echo # view and subquery, Assertion `context' failed, Assertion `field' failed
+--echo #
+
+CREATE TABLE t1 (a DECIMAL, b INT);
+INSERT INTO t1 VALUES (1,1),(2,2); # optional
+CREATE VIEW v1 AS SELECT * FROM ( SELECT * FROM t1 WHERE a <> RAND() ) sq;
+
+SELECT * FROM v1 WHERE b > 0;
+
+# Cleanup
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.3 tests
+--echo #