diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2017-09-07 11:13:08 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2017-09-11 09:51:51 +0200 |
commit | 6b5c0effe43d5cfd19d3aff0fdb5fb6f1b6d41d3 (patch) | |
tree | 2e3206afafd33a9353de32c540908da8565684d0 /mysql-test/t/view.test | |
parent | 2425f2aedbaaa79475ebeda3227ccff45b18c176 (diff) | |
download | mariadb-git-6b5c0effe43d5cfd19d3aff0fdb5fb6f1b6d41d3.tar.gz |
MDEV-13436 PREPARE doesn't work as expected & throws errors but MySQL is working fine
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.test | 21 |
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 # |