1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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
This commit is contained in:
unknown
2004-07-22 17:52:04 +03:00
parent 48ea6e3be1
commit dc4de8d562
5 changed files with 39 additions and 20 deletions

View File

@ -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;

View File

@ -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;