diff options
author | unknown <bell@sanja.is.com.ua> | 2004-09-08 10:18:04 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-09-08 10:18:04 +0300 |
commit | 7de077f7dfc209bdfcc847920a394ff4c55a2e96 (patch) | |
tree | 09e24097656202a2f0bff94dbc2778035a4118fa /mysql-test/t | |
parent | c647f600afb2f6967519d3262646ab2d98c6c61c (diff) | |
download | mariadb-git-7de077f7dfc209bdfcc847920a394ff4c55a2e96.tar.gz |
test of updating and fetching from the same table check (BUG##5157)
mysql-test/r/lowercase_view.result:
test of updating and fetching from the same table check
mysql-test/r/view.result:
test of updating and fetching from the same table check
mysql-test/t/lowercase_view.test:
test of updating and fetching from the same table check
mysql-test/t/view.test:
test of updating and fetching from the same table check
sql/mysql_priv.h:
unique table test
sql/sql_base.cc:
unique table test which take into account views added
sql/sql_delete.cc:
unique table test which take into account views added
sql/sql_insert.cc:
unique table test which take into account views added
sql/sql_parse.cc:
unique table test which take into account views added
sql/sql_update.cc:
unique table test which take into account views added
sql/sql_view.cc:
unique table test which take into account views added
sql/table.h:
save next independent (do not belong to current view) table
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/lowercase_view.test | 24 | ||||
-rw-r--r-- | mysql-test/t/view.test | 18 |
2 files changed, 41 insertions, 1 deletions
diff --git a/mysql-test/t/lowercase_view.test b/mysql-test/t/lowercase_view.test index 5b1be072c69..2a2757650ae 100644 --- a/mysql-test/t/lowercase_view.test +++ b/mysql-test/t/lowercase_view.test @@ -1,8 +1,12 @@ --disable_warnings +drop table if exists t1Aa,t2Aa,v1Aa,v2Aa; +drop view if exists t1Aa,t2Aa,v1Aa,v2Aa; drop database if exists MySQLTest; --enable_warnings - +# +# different cases in VIEW +# create database MySQLTest; use MySQLTest; create table TaB (Field int); @@ -10,3 +14,21 @@ create view ViE as select * from TAb; show create table VIe; drop database MySQLTest; use test; + +# +# test of updating and fetching from the same table check +# +create table t1Aa (col1 int); +create table t2Aa (col1 int); +create view v1Aa as select * from t1Aa; +create view v2Aa as select * from v1Aa; +-- error 1093 +update v2aA set col1 = (select max(col1) from v1aA); +#update v2aA,t2aA set v2aA.col1 = (select max(col1) from v1aA) where v2aA.col1 = t2aA.col1; +-- error 1093 +delete from v2aA where col1 = (select max(col1) from v1aA); +#delete v2aA from v2aA,t2aA where (select max(col1) from v1aA) > 0 and v2aA.col1 = t2aA.col1; +-- error 1093 +insert into v2aA values ((select max(col1) from v1aA)); +drop view v2Aa,v1Aa; +drop table t1Aa,t2Aa; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 9464e291e05..de9a49f479d 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -1230,3 +1230,21 @@ insert into v1 values (1) on duplicate key update s1 = 7; select * from t1; drop view v1; drop table t1; + +# +# test of updating and fetching from the same table check +# +create table t1 (col1 int); +create table t2 (col1 int); +create view v1 as select * from t1; +create view v2 as select * from v1; +-- error 1093 +update v2 set col1 = (select max(col1) from v1); +#update v2,t2 set v2.col1 = (select max(col1) from v1) where v2.col1 = t2.col1; +-- error 1093 +delete from v2 where col1 = (select max(col1) from v1); +#delete v2 from v2,t2 where (select max(col1) from v1) > 0 and v2.col1 = t2.col1; +-- error 1093 +insert into v2 values ((select max(col1) from v1)); +drop view v2,v1; +drop table t1,t2; |