summaryrefslogtreecommitdiff
path: root/mysql-test/t/multi_update.test
diff options
context:
space:
mode:
authorMatthias Leich <Matthias.Leich@sun.com>2008-11-25 12:52:32 +0100
committerMatthias Leich <Matthias.Leich@sun.com>2008-11-25 12:52:32 +0100
commitddf5c19272e8e3353e9fd95359d2d5d22e3a413b (patch)
tree0c6cac1e3c524a757a7fd52ad9d3b568238ef4e8 /mysql-test/t/multi_update.test
parentdf8a5474f8a904b4e254e446fd6ea61a94c98e2a (diff)
parent87c97b4785cb0634bcb0cfda81115ccf05c9b258 (diff)
downloadmariadb-git-ddf5c19272e8e3353e9fd95359d2d5d22e3a413b.tar.gz
Merge of fix for Bug 26890 into GCA tree
Diffstat (limited to 'mysql-test/t/multi_update.test')
-rw-r--r--mysql-test/t/multi_update.test57
1 files changed, 11 insertions, 46 deletions
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 37cdfcf5f26..2bb3b17340c 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -9,9 +9,9 @@
drop table if exists t1,t2,t3;
drop database if exists mysqltest;
drop view if exists v1;
---error 0,1141,1147
+--error 0,ER_NONEXISTING_GRANT,ER_NONEXISTING_TABLE_GRANT
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
---error 0,1141,1147
+--error 0,ER_NONEXISTING_GRANT,ER_NONEXISTING_TABLE_GRANT
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
--enable_warnings
@@ -159,9 +159,9 @@ create table t2 (n int(10) not null primary key, d int(10));
insert into t1 values(1,1);
insert into t2 values(1,10),(2,20);
LOCK TABLES t1 write, t2 read;
---error 1099
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
DELETE t1.*, t2.* FROM t1,t2 where t1.n=t2.n;
---error 1099
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
unlock tables;
@@ -182,7 +182,7 @@ create table t1 (n int(10), d int(10));
create table t2 (n int(10), d int(10));
insert into t1 values(1,1);
insert into t2 values(1,10),(2,20);
---error 1175
+--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
set sql_safe_updates=0;
drop table t1,t2;
@@ -195,7 +195,7 @@ set timestamp=1038000000;
UPDATE t1,t2 SET t1.d=t2.d WHERE t1.n=t2.n;
select n,d,unix_timestamp(t) from t1;
select n,d,unix_timestamp(t) from t2;
---error 1064
+--error ER_PARSE_ERROR
UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n;
drop table t1,t2;
set timestamp=0;
@@ -323,41 +323,6 @@ delete t1, t2 from t2,t1
drop table t1,t2;
#
-# Test for bug #1820.
-#
-
-create table t1 ( a int not null, b int not null) ;
---disable_query_log
-insert into t1 values (1,1),(2,2),(3,3),(4,4);
-let $1=19;
-set @d=4;
-while ($1)
-{
- eval insert into t1 select a+@d,b+@d from t1;
- eval set @d=@d*2;
- dec $1;
-}
-
---enable_query_log
-alter table t1 add index i1(a);
-delete from t1 where a > 2000000;
-create table t2 like t1;
-insert into t2 select * from t1;
-
-select 't2 rows before small delete', count(*) from t1;
-delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2;
-select 't2 rows after small delete', count(*) from t2;
-select 't1 rows after small delete', count(*) from t1;
-
-## Try deleting many rows
-
-delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
-select 't2 rows after big delete', count(*) from t2;
-select 't1 rows after big delete', count(*) from t1;
-
-drop table t1,t2;
-
-#
# Test alias (this is not correct in 4.0)
#
@@ -366,7 +331,7 @@ CREATE TABLE t2 ( a int );
DELETE t1 FROM t1, t2 AS t3;
DELETE t4 FROM t1, t1 AS t4;
DELETE t3 FROM t1 AS t3, t1 AS t4;
---error 1109
+--error ER_UNKNOWN_TABLE
DELETE t1 FROM t1 AS t3, t2 AS t4;
INSERT INTO t1 values (1),(2);
INSERT INTO t2 values (1),(2);
@@ -421,7 +386,7 @@ drop database mysqltest;
create table t1 (a int, primary key (a));
create table t2 (a int, primary key (a));
create table t3 (a int, primary key (a));
--- error 1109
+-- error ER_UNKNOWN_TABLE
delete t1,t3 from t1,t2 where t1.a=t2.a and t2.a=(select t3.a from t3 where t1.a=t3.a);
drop table t1, t2, t3;
@@ -430,9 +395,9 @@ drop table t1, t2, t3;
#
create table t1 (col1 int);
create table t2 (col1 int);
--- error 1093
+-- error ER_UPDATE_TABLE_USED
update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
--- error 1093
+-- error ER_UPDATE_TABLE_USED
delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
drop table t1,t2;
@@ -457,7 +422,7 @@ drop table t1, t2;
#
create table t1(a int);
create table t2(a int);
---error 1093
+--error ER_UPDATE_TABLE_USED
delete from t1,t2 using t1,t2 where t1.a=(select a from t1);
drop table t1, t2;
# End of 4.1 tests