diff options
author | unknown <monty@mysql.com> | 2005-05-30 20:48:40 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-05-30 20:48:40 +0300 |
commit | e2285c541b027503e3040a85fc618f9c6357a91e (patch) | |
tree | cecbfda09bb93c1c181159eacc7b4e58cac50cf4 /mysql-test/r/delete.result | |
parent | 6a7dedf25909719fe5a8c2f98f87e18e6461b705 (diff) | |
download | mariadb-git-e2285c541b027503e3040a85fc618f9c6357a91e.tar.gz |
Fixed bug in multiple-table-delete where some rows was not deleted
mysql-test/r/delete.result:
Test case for bug in multiple-table-delete where some rows was not deleted
mysql-test/t/delete.test:
Test case for bug in multiple-table-delete where some rows was not deleted
sql/item_subselect.cc:
Code cleanup
sql/opt_range.cc:
Code cleanup
sql/sql_delete.cc:
Fixed bug in multiple-table-delete where some rows was not deleted
This happend when the first table-to-delete-from was not the the table that was scanned.
Fixed this by only doing 'delete-on-the-fly' for the first table.
Fixed also some wrong error handling in multi-table-delete
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; |