diff options
author | unknown <bell@sanja.is.com.ua> | 2005-04-01 13:02:29 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-04-01 13:02:29 +0300 |
commit | 8af8c530404c63ea9ded5fe5e89b1255cee5c91c (patch) | |
tree | e76b7cb6fc7a1b94e97279a599ad81923224a0c7 /mysql-test/r | |
parent | ec6ce01565bbb1a56b342a2dd4607869c0d93278 (diff) | |
parent | daddf263e5b347dd4ce763674c6c3b37af2d0803 (diff) | |
download | mariadb-git-8af8c530404c63ea9ded5fe5e89b1255cee5c91c.tar.gz |
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-multi-5.0
mysql-test/r/view.result:
Auto merged
sql/sql_derived.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/lowercase_view.result | 105 | ||||
-rw-r--r-- | mysql-test/r/view.result | 136 |
2 files changed, 234 insertions, 7 deletions
diff --git a/mysql-test/r/lowercase_view.result b/mysql-test/r/lowercase_view.result index 0644b32015c..37252c6dde7 100644 --- a/mysql-test/r/lowercase_view.result +++ b/mysql-test/r/lowercase_view.result @@ -11,16 +11,109 @@ vie CREATE ALGORITHM=UNDEFINED VIEW `mysqltest`.`vie` AS select `mysqltest`.`tab drop database MySQLTest; use test; create table t1Aa (col1 int); -create table t2Aa (col1 int); -create view v1Aa as select * from t1Aa; -create view v2Aa as select * from v1Aa; -update v2aA set col1 = (select max(col1) from v1aA); +create table t2aA (col1 int); +create view v1Aa as select * from t1aA; +create view v2aA as select * from v1aA; +create view v3Aa as select v2Aa.col1 from v2aA,t2Aa where v2Aa.col1 = t2aA.col1; +update v2aA set col1 = (select max(col1) from v1Aa); ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause -delete from v2aA where col1 = (select max(col1) from v1aA); +update v2Aa set col1 = (select max(col1) from t1Aa); ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +update v2aA set col1 = (select max(col1) from v2Aa); +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +update v2aA,t2Aa set v2Aa.col1 = (select max(col1) from v1aA) where v2aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +update t1aA,t2Aa set t1Aa.col1 = (select max(col1) from v1Aa) where t1aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't1aa' for update in FROM clause +update v1aA,t2Aa set v1Aa.col1 = (select max(col1) from v1aA) where v1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause +update t2Aa,v2Aa set v2aA.col1 = (select max(col1) from v1aA) where v2Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't2aa' for update in FROM clause +update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from v1Aa) where t1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't2aa' for update in FROM clause +update t2Aa,v1aA set v1Aa.col1 = (select max(col1) from v1aA) where v1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't2aa' for update in FROM clause +update v2aA,t2Aa set v2Aa.col1 = (select max(col1) from t1aA) where v2aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +update t1Aa,t2Aa set t1aA.col1 = (select max(col1) from t1Aa) where t1aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't1aa' for update in FROM clause +update v1aA,t2Aa set v1Aa.col1 = (select max(col1) from t1Aa) where v1aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause +update t2Aa,v2Aa set v2aA.col1 = (select max(col1) from t1aA) where v2Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't2aa' for update in FROM clause +update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from t1Aa) where t1aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't2aa' for update in FROM clause +update t2Aa,v1Aa set v1aA.col1 = (select max(col1) from t1Aa) where v1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't2aa' for update in FROM clause +update v2aA,t2Aa set v2Aa.col1 = (select max(col1) from v2aA) where v2Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +update t1aA,t2Aa set t1Aa.col1 = (select max(col1) from v2aA) where t1aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't1aa' for update in FROM clause +update v1aA,t2Aa set v1Aa.col1 = (select max(col1) from v2Aa) where v1aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause +update t2Aa,v2aA set v2Aa.col1 = (select max(col1) from v2aA) where v2Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't2aa' for update in FROM clause +update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from v2aA) where t1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't2aa' for update in FROM clause +update t2Aa,v1Aa set v1aA.col1 = (select max(col1) from v2Aa) where v1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't2aa' for update in FROM clause +update v3aA set v3Aa.col1 = (select max(col1) from v1aA); +ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause +update v3aA set v3Aa.col1 = (select max(col1) from t1aA); +ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause +update v3aA set v3Aa.col1 = (select max(col1) from v2aA); +ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause +update v3aA set v3Aa.col1 = (select max(col1) from v3aA); +ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause +delete from v2Aa where col1 = (select max(col1) from v1Aa); +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +delete from v2aA where col1 = (select max(col1) from t1Aa); +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +delete from v2Aa where col1 = (select max(col1) from v2aA); +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +delete v2Aa from v2aA,t2Aa where (select max(col1) from v1aA) > 0 and v2Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +delete t1aA from t1Aa,t2Aa where (select max(col1) from v1Aa) > 0 and t1aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't1aa' for update in FROM clause +delete v1aA from v1Aa,t2Aa where (select max(col1) from v1aA) > 0 and v1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause +delete v2aA from v2Aa,t2Aa where (select max(col1) from t1Aa) > 0 and v2aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +delete t1aA from t1Aa,t2Aa where (select max(col1) from t1aA) > 0 and t1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't1aa' for update in FROM clause +delete v1aA from v1Aa,t2Aa where (select max(col1) from t1aA) > 0 and v1aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause +delete v2Aa from v2aA,t2Aa where (select max(col1) from v2Aa) > 0 and v2aA.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +delete t1Aa from t1aA,t2Aa where (select max(col1) from v2Aa) > 0 and t1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 't1aa' for update in FROM clause +delete v1Aa from v1aA,t2Aa where (select max(col1) from v2aA) > 0 and v1Aa.col1 = t2aA.col1; +ERROR HY000: You can't specify target table 'v1aa' for update in FROM clause +insert into v2Aa values ((select max(col1) from v1aA)); +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +insert into t1aA values ((select max(col1) from v1Aa)); +ERROR HY000: You can't specify target table 't1aa' for update in FROM clause insert into v2aA values ((select max(col1) from v1aA)); ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause -drop view v2Aa,v1Aa; +insert into v2Aa values ((select max(col1) from t1Aa)); +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +insert into t1aA values ((select max(col1) from t1Aa)); +ERROR HY000: You can't specify target table 't1aa' for update in FROM clause +insert into v2aA values ((select max(col1) from t1aA)); +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +insert into v2Aa values ((select max(col1) from v2aA)); +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +insert into t1Aa values ((select max(col1) from v2Aa)); +ERROR HY000: You can't specify target table 't1aa' for update in FROM clause +insert into v2aA values ((select max(col1) from v2Aa)); +ERROR HY000: You can't specify target table 'v2aa' for update in FROM clause +insert into v3Aa (col1) values ((select max(col1) from v1Aa)); +ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause +insert into v3aA (col1) values ((select max(col1) from t1aA)); +ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause +insert into v3Aa (col1) values ((select max(col1) from v2aA)); +ERROR HY000: You can't specify target table 'v3aa' for update in FROM clause +drop view v3aA,v2Aa,v1aA; drop table t1Aa,t2Aa; create table t1Aa (col1 int); create view v1Aa as select col1 from t1Aa as AaA; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index c5fe4bf8565..f0faf1b3770 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -1176,13 +1176,121 @@ create table t1 (col1 int); create table t2 (col1 int); create view v1 as select * from t1; create view v2 as select * from v1; +create view v3 as select v2.col1 from v2,t2 where v2.col1 = t2.col1; update v2 set col1 = (select max(col1) from v1); ERROR HY000: You can't specify target table 'v2' for update in FROM clause +update v2 set col1 = (select max(col1) from t1); +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +update v2 set col1 = (select max(col1) from v2); +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +update v2,t2 set v2.col1 = (select max(col1) from v1) where v2.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +update t1,t2 set t1.col1 = (select max(col1) from v1) where t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +update v1,t2 set v1.col1 = (select max(col1) from v1) where v1.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v1' for update in FROM clause +update t2,v2 set v2.col1 = (select max(col1) from v1) where v2.col1 = t2.col1; +ERROR HY000: You can't specify target table 't2' for update in FROM clause +update t2,t1 set t1.col1 = (select max(col1) from v1) where t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't2' for update in FROM clause +update t2,v1 set v1.col1 = (select max(col1) from v1) where v1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't2' for update in FROM clause +update v2,t2 set v2.col1 = (select max(col1) from t1) where v2.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +update v1,t2 set v1.col1 = (select max(col1) from t1) where v1.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v1' for update in FROM clause +update t2,v2 set v2.col1 = (select max(col1) from t1) where v2.col1 = t2.col1; +ERROR HY000: You can't specify target table 't2' for update in FROM clause +update t2,t1 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't2' for update in FROM clause +update t2,v1 set v1.col1 = (select max(col1) from t1) where v1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't2' for update in FROM clause +update v2,t2 set v2.col1 = (select max(col1) from v2) where v2.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +update t1,t2 set t1.col1 = (select max(col1) from v2) where t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +update v1,t2 set v1.col1 = (select max(col1) from v2) where v1.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v1' for update in FROM clause +update t2,v2 set v2.col1 = (select max(col1) from v2) where v2.col1 = t2.col1; +ERROR HY000: You can't specify target table 't2' for update in FROM clause +update t2,t1 set t1.col1 = (select max(col1) from v2) where t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't2' for update in FROM clause +update t2,v1 set v1.col1 = (select max(col1) from v2) where v1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't2' for update in FROM clause +update v3 set v3.col1 = (select max(col1) from v1); +ERROR HY000: You can't specify target table 'v3' for update in FROM clause +update v3 set v3.col1 = (select max(col1) from t1); +ERROR HY000: You can't specify target table 'v3' for update in FROM clause +update v3 set v3.col1 = (select max(col1) from v2); +ERROR HY000: You can't specify target table 'v3' for update in FROM clause +update v3 set v3.col1 = (select max(col1) from v3); +ERROR HY000: You can't specify target table 'v3' for update in FROM clause delete from v2 where col1 = (select max(col1) from v1); ERROR HY000: You can't specify target table 'v2' for update in FROM clause +delete from v2 where col1 = (select max(col1) from t1); +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +delete from v2 where col1 = (select max(col1) from v2); +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +delete v2 from v2,t2 where (select max(col1) from v1) > 0 and v2.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +delete t1 from t1,t2 where (select max(col1) from v1) > 0 and t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +delete v1 from v1,t2 where (select max(col1) from v1) > 0 and v1.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v1' for update in FROM clause +delete v2 from v2,t2 where (select max(col1) from t1) > 0 and v2.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +delete t1 from t1,t2 where (select max(col1) from t1) > 0 and t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +delete v1 from v1,t2 where (select max(col1) from t1) > 0 and v1.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v1' for update in FROM clause +delete v2 from v2,t2 where (select max(col1) from v2) > 0 and v2.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +delete t1 from t1,t2 where (select max(col1) from v2) > 0 and t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +delete v1 from v1,t2 where (select max(col1) from v2) > 0 and v1.col1 = t2.col1; +ERROR HY000: You can't specify target table 'v1' for update in FROM clause insert into v2 values ((select max(col1) from v1)); ERROR HY000: You can't specify target table 'v2' for update in FROM clause -drop view v2,v1; +insert into t1 values ((select max(col1) from v1)); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +insert into v2 values ((select max(col1) from v1)); +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +insert into v2 values ((select max(col1) from t1)); +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +insert into t1 values ((select max(col1) from t1)); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +insert into v2 values ((select max(col1) from t1)); +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +insert into v2 values ((select max(col1) from v2)); +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +insert into t1 values ((select max(col1) from v2)); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +insert into v2 values ((select max(col1) from v2)); +ERROR HY000: You can't specify target table 'v2' for update in FROM clause +insert into v3 (col1) values ((select max(col1) from v1)); +ERROR HY000: You can't specify target table 'v3' for update in FROM clause +insert into v3 (col1) values ((select max(col1) from t1)); +ERROR HY000: You can't specify target table 'v3' for update in FROM clause +insert into v3 (col1) values ((select max(col1) from v2)); +ERROR HY000: You can't specify target table 'v3' for update in FROM clause +insert into v3 (col1) values ((select CONVERT_TZ('20050101000000','UTC','MET') from v2)); +ERROR HY000: You can't specify target table 'v3' for update in FROM clause +insert into v3 (col1) values ((select CONVERT_TZ('20050101000000','UTC','MET') from t2)); +insert into mysql.time_zone values ('', (select CONVERT_TZ('20050101000000','UTC','MET') from t2)); +ERROR 23000: Column 'Use_leap_seconds' cannot be null +create algorithm=temptable view v4 as select * from t1; +insert into t1 values (1),(2),(3); +insert into t1 (col1) values ((select max(col1) from v4)); +select * from t1; +col1 +NULL +1 +2 +3 +3 +drop view v4,v3,v2,v1; drop table t1,t2; create table t1 (s1 int); create view v1 as select * from t1; @@ -1687,6 +1795,8 @@ delete from v3; ERROR HY000: Can not delete from join view 'test.v3' delete v3,t1 from v3,t1; ERROR HY000: Can not delete from join view 'test.v3' +delete t1,v3 from t1,v3; +ERROR HY000: Can not delete from join view 'test.v3' delete from t1; prepare stmt1 from "insert into v3(a) values (?);"; set @a= 100; @@ -1778,3 +1888,27 @@ select s2 from v1 vq1 where 2 = (select count(*) aa from v1 vq2 having vq1.s2 = s2 drop view v1; drop table t1; +CREATE TABLE t1 (a1 int); +CREATE TABLE t2 (a2 int); +INSERT INTO t1 VALUES (1), (2), (3), (4); +INSERT INTO t2 VALUES (1), (2), (3); +CREATE VIEW v1(a,b) AS SELECT a1,a2 FROM t1 JOIN t2 ON a1=a2 WHERE a1>1; +SELECT * FROM v1; +a b +2 2 +3 3 +CREATE TABLE t3 SELECT * FROM v1; +SELECT * FROM t3; +a b +2 2 +3 3 +DROP VIEW v1; +DROP TABLE t1,t2,t3; +create table t1 (a int); +create table t2 like t1; +create table t3 like t1; +create view v1 as select t1.a x, t2.a y from t1 join t2 where t1.a=t2.a; +insert into t3 select x from v1; +insert into t2 select x from v1; +drop view v1; +drop table t1,t2,t3; |