mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#28266 IS_UPDATABLE field on VIEWS table in I_S database is wrong
IS_UPDATABLE flag is set to 'yes' when the view has at least one updatable column and the algorithm is not 'temporary'. mysql-test/r/information_schema.result: test result mysql-test/r/view.result: test result mysql-test/t/information_schema.test: test case mysql-test/t/view.test: test case sql/sql_show.cc: IS_UPDATABLE flag is set to 'yes' when the view has at least one updatable column and the algorithm is not 'temporary'.
This commit is contained in:
@ -1023,4 +1023,19 @@ where t.table_schema = 'information_schema' and
|
||||
group by c2.column_type order by num limit 1)
|
||||
group by t.table_name order by num1, t.table_name;
|
||||
|
||||
#
|
||||
# Bug#28266 IS_UPDATABLE field on VIEWS table in I_S database is wrong
|
||||
#
|
||||
create table t1(f1 int);
|
||||
create view v1 as select f1+1 as a from t1;
|
||||
create table t2 (f1 int, f2 int);
|
||||
create view v2 as select f1+1 as a, f2 as b from t2;
|
||||
select table_name, is_updatable from information_schema.views;
|
||||
#
|
||||
# Note: we can perform 'delete' for non updatable view.
|
||||
#
|
||||
delete from v1;
|
||||
drop view v1,v2;
|
||||
drop table t1,t2;
|
||||
|
||||
# End of 5.0 tests.
|
||||
|
@ -32,6 +32,7 @@ create view v1 (c,d) as select a,b from t1
|
||||
# simple view
|
||||
create view v1 (c) as select b+1 from t1;
|
||||
select c from v1;
|
||||
select is_updatable from information_schema.views where table_name='v1';
|
||||
|
||||
# temporary table should not hide table of view
|
||||
create temporary table t1 (a int, b int);
|
||||
@ -228,6 +229,8 @@ create table t1 (a int, b int, primary key(a));
|
||||
insert into t1 values (10,2), (20,3), (30,4), (40,5), (50,10);
|
||||
create view v1 (a,c) as select a, b+1 from t1;
|
||||
create algorithm=temptable view v2 (a,c) as select a, b+1 from t1;
|
||||
select is_updatable from information_schema.views where table_name='v2';
|
||||
select is_updatable from information_schema.views where table_name='v1';
|
||||
# try to update expression
|
||||
-- error 1348
|
||||
update v1 set c=a+c;
|
||||
@ -497,6 +500,7 @@ 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 is_updatable from information_schema.views;
|
||||
select * from t1;
|
||||
drop view v2, v1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user