summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-07-22 17:52:04 +0300
committerunknown <bell@sanja.is.com.ua>2004-07-22 17:52:04 +0300
commitdc4de8d562bf781bc6640a00e2720548f20a53e0 (patch)
tree93275fbebca583b4ac1098787e6492559cfdc5ea /mysql-test
parent48ea6e3be19987a0283ced85b7f73dccf0eb24b3 (diff)
downloadmariadb-git-dc4de8d562bf781bc6640a00e2720548f20a53e0.tar.gz
made different fields for view updatebility in principle and updatability during this execution (BUG#4601)
mysql-test/r/view.result: fixed ps variavles test test of view built over updatable view mysql-test/t/view.test: fixed ps variavles test test of view built over updatable view sql/sql_acl.cc: mpre optimal locking (found by Monty) sql/sql_view.cc: made different fields for view updatebility in principle and updatability during this execution sql/table.h: made different fields for view updatebility in principle and updatability during this execution
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/view.result16
-rw-r--r--mysql-test/t/view.test18
2 files changed, 28 insertions, 6 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 2a593f7c6df..5f399b816ac 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -977,9 +977,19 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s)
drop view v1;
create view v1 (a,a) as select 'a','a';
ERROR 42S21: Duplicate column name 'a'
-create procedure p11 () begin declare v int; create view v1 as select v; end;//
+create procedure p1 () begin declare v int; create view v1 as select v; end;//
Warnings:
Warning 1310 Referring to uninitialized variable v
-call p11();
+call p1();
ERROR HY000: View's SELECT contains a variable or parameter
-drop procedure p11;
+drop procedure p1;
+create table t1 (col1 int,col2 char(22));
+insert into t1 values(5,'Hello, world of views');
+create view v1 as select * from t1;
+create view v2 as select * from v1;
+update v2 set col2='Hello, view world';
+select * from t1;
+col1 col2
+5 Hello, view world
+drop view v2, v1;
+drop table t1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 33ffa114c28..30016b38b16 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -905,8 +905,20 @@ create view v1 (a,a) as select 'a','a';
# SP variables inside view test
#
delimiter //;
-create procedure p11 () begin declare v int; create view v1 as select v; end;//
+create procedure p1 () begin declare v int; create view v1 as select v; end;//
delimiter ;//
-- error 1350
-call p11();
-drop procedure p11;
+call p1();
+drop procedure p1;
+
+#
+# updateablity should be transitive
+#
+create table t1 (col1 int,col2 char(22));
+insert into t1 values(5,'Hello, world of views');
+create view v1 as select * from t1;
+create view v2 as select * from v1;
+update v2 set col2='Hello, view world';
+select * from t1;
+drop view v2, v1;
+drop table t1;