diff options
Diffstat (limited to 'mysql-test/r/delete.result')
-rw-r--r-- | mysql-test/r/delete.result | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 411cd52b4ca..ddfeeac77b5 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -1,4 +1,4 @@ -drop table if exists t1,t11,t12,t2; +drop table if exists t1,t2,t3,t11,t12; CREATE TABLE t1 (a tinyint(3), b tinyint(5)); INSERT INTO t1 VALUES (1,1); INSERT LOW_PRIORITY INTO t1 VALUES (1,2); @@ -172,3 +172,23 @@ a 0 2 DROP TABLE t1; +CREATE TABLE t1 (a int not null,b int not null); +CREATE TABLE t2 (a int not null, b int not null, primary key (a,b)); +CREATE TABLE t3 (a int not null, b int not null, primary key (a,b)); +insert into t1 values (1,1),(2,1),(1,3); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(1,3); +select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; +a b a b a b +1 1 1 1 1 1 +2 1 2 2 2 1 +1 3 1 1 1 3 +explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 +1 SIMPLE t2 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index +1 SIMPLE t3 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index +delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; +select * from t3; +a b +drop table t1,t2,t3; |