summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <kaa@kaamos.(none)>2008-02-12 22:51:25 +0300
committerunknown <kaa@kaamos.(none)>2008-02-12 22:51:25 +0300
commit00b17696efc6e4ffc70abdbea4b76b88b397b910 (patch)
tree3e6b4f63fa6eadf61a9ea983437390077a4cade3 /mysql-test
parent8fe44ccb796775d703d5ae10860ba96b9a8203b4 (diff)
parent9b483c31f9a10ffbe18f6fcfe2fb73cc77836775 (diff)
downloadmariadb-git-00b17696efc6e4ffc70abdbea4b76b88b397b910.tar.gz
Merge mbp:src/opt/bug33389/my51-bug25162
into kaamos.(none):/data/src/opt/mysql-5.1-opt
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/view.result16
-rw-r--r--mysql-test/t/view.test22
2 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 09b997797b4..cae54562be4 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3613,6 +3613,22 @@ ERROR HY000: Field of view 'test.v1' underlying table doesn't have a default val
set @@sql_mode=@old_mode;
drop view v1;
drop table t1;
+create table t1 (a int, key(a));
+create table t2 (c int);
+create view v1 as select a b from t1;
+create view v2 as select 1 a from t2, v1 where c in
+(select 1 from t1 where b = a);
+insert into t1 values (1), (1);
+insert into t2 values (1), (1);
+prepare stmt from "select * from v2 where a = 1";
+execute stmt;
+a
+1
+1
+1
+1
+drop view v1, v2;
+drop table t1, t2;
End of 5.0 tests.
DROP DATABASE IF EXISTS `d-1`;
CREATE DATABASE `d-1`;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 58ef9c1eff1..dffb6f89e73 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3468,6 +3468,27 @@ set @@sql_mode=@old_mode;
drop view v1;
drop table t1;
+#
+# Bug #33389: Selecting from a view into a table from within SP or trigger
+# crashes server
+#
+
+create table t1 (a int, key(a));
+create table t2 (c int);
+
+create view v1 as select a b from t1;
+create view v2 as select 1 a from t2, v1 where c in
+ (select 1 from t1 where b = a);
+
+insert into t1 values (1), (1);
+insert into t2 values (1), (1);
+
+prepare stmt from "select * from v2 where a = 1";
+execute stmt;
+
+drop view v1, v2;
+drop table t1, t2;
+
--echo End of 5.0 tests.
#
@@ -3541,3 +3562,4 @@ DROP TABLE t1;
--echo
--echo End of 5.1 tests.
+