From 2264b644735e869fdbb16397c75170d86e2de127 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 May 2006 00:32:59 +0400 Subject: Fixed bug#19225: unchecked error results in server crash In multi-table delete a table for delete can't be used for selecting in subselects. Appropriate error was raised but wasn't checked which leads to a crash at the execution phase. The mysql_execute_command() now checks for errors before executing select for multi-delete. mysql-test/t/multi_update.test: Added test case for bug#19225: unchecked error results in server crash mysql-test/r/multi_update.result: Added test case for bug#19225: unchecked error results in server crash sql/sql_parse.cc: Fixed bug#19225: unchecked error results in server crash The mysql_execute_command() now checks for errors before executing select for multi-delete. --- mysql-test/r/multi_update.result | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mysql-test/r/multi_update.result') diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index dba10296063..ee62bd3bce6 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -475,3 +475,8 @@ aclid bigint, index idx_acl(aclid) insert into t2 values(1,null); delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; drop table t1, t2; +create table t1(a int); +create table t2(a int); +delete from t1,t2 using t1,t2 where t1.a=(select a from t1); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +drop table t1, t2; -- cgit v1.2.1 From 63d6336465c13c010977c04a037468e55b68e9e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 May 2006 23:05:34 +0400 Subject: item_cmpfunc.cc, func_in.result, multi_update.result: After merge fix mysql-test/r/multi_update.result: After merge fix mysql-test/r/func_in.result: After merge fix sql/item_cmpfunc.cc: After merge fix --- mysql-test/r/multi_update.result | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/r/multi_update.result') diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 8d56cf6f2dc..b4a7aa5cb76 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -480,6 +480,7 @@ create table t1(a int); create table t2(a int); delete from t1,t2 using t1,t2 where t1.a=(select a from t1); ERROR HY000: You can't specify target table 't1' for update in FROM clause +drop table t1, t2; create table t1 ( c char(8) not null ) engine=innodb; insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'); insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F'); -- cgit v1.2.1