Bug #31807 multi-update,delete killing does not report with ER_QUERY_INTERRUPTED
Submitted: 24 Oct 2007 6:14 Modified: 8 Nov 2007 14:20
Reporter: Andrei Elkin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0 OS:Any
Assigned to: Andrei Elkin CPU Architecture:Any

[24 Oct 2007 6:14] Andrei Elkin
Description:
Normally successful killing of a query should result to the error
thrown back to the client.
When multi-table update or delete queries killed the effective error the client sees in "Unknown error" with no valid error code from server.

How to repeat:
# a commented out snippet in binlog_killed to be pushed with bug#27571 fixes

create table t1 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
insert into t1 values (1,1),(2,2);

#
# multi update
#

connection con1;
begin; update t1 set b=b+10;

connection con2;
send update t1 as t_1,t1 as t_2 set t_1.b=11 where t_2.a=2;

connection con1;
--replace_result $ID ID
eval kill query $ID;
rollback;

connection con2;
--error HY000   # not the correct ER_QUERY_INTERRUPTED
[8 Nov 2007 14:20] Alexander Nozdrin
Can not repeat.

The following test case:
-------------------------------------------------------------
--disable_warnings
drop table if exists t1;
drop table if exists t2;
--enable_warnings

create table t1 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
create table t2 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=MyISAM;
insert into t1 values (1,1),(2,2);

connection con1;

begin;
update t1 set b = b + 10;

connection con2;

send update t1 as t_1,t1 as t_2 set t_1.b = 11 where t_2.a = 2;
connection con1;
--replace_result $ID ID
eval kill query $ID;
rollback;
disable_abort_on_error;
connection con2;
--error ER_QUERY_INTERRUPTED
reap;
select * from t1 /* must be the same as before (1,1),(2,2) */;
-------------------------------------------------------------

produces the following output:
-------------------------------------------------------------
drop table if exists t1;
drop table if exists t2;
create table t1 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
create table t2 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=MyISAM;
insert into t1 values (1,1),(2,2);
begin;
update t1 set b = b + 10;
update t1 as t_1,t1 as t_2 set t_1.b = 11 where t_2.a = 2;
kill query ID;
rollback;
ERROR 70100: Query execution was interrupted
select * from t1 /* must be the same as before (1,1),(2,2) */;
a	b
1	1
2	2
-------------------------------------------------------------

Tree: 5.1-runtime.