summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2017-09-07 11:13:08 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2017-09-07 11:13:08 +0200
commit0e931867fd540123679f8af7da0ddf9bd351d546 (patch)
tree09aeeb20545cac731a8764879d3ee98c97d841c1 /mysql-test/t/view.test
parent2b387855df7be57a3017a5c211543574fa4364d4 (diff)
downloadmariadb-git-bb-10.2-MDEV-13436.tar.gz
MDEV-13436 PREPARE doesn't work as expected & throws errors but MySQL is working finebb-10.2-MDEV-13436
Now we allow derived in the from clause of subqueries so set flag which prevent optimisation of subqueries during view creation before derived processing so subquery will be correctly printed in the view .frm.
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index e2164e438dc..a9764bf0668 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -6345,5 +6345,26 @@ use test;
drop database bugTest;
--echo #
+--echo # MDEV-13436: PREPARE doesn't work as expected & throws errors but
+--echo # MySQL is working fine
+--echo #
+
+create table t1 (a int);
+insert into t1 values (1),(2);
+SET @sql_query = "
+ CREATE VIEW v1 AS
+ SELECT * FROM (
+ SELECT CASE WHEN 1 IN (SELECT a from t1 where a < 2) THEN TRUE END AS testcase
+ ) testalias
+";
+PREPARE stmt FROM @sql_query;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+show create view v1;
+SELECT * FROM v1;
+drop view v1;
+drop table t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #