Below is the list of changes that have just been committed into a local
5.1 repository of elkin. When elkin does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-11-05 22:10:25+02:00, aelkin@stripped +3 -0
bug#27571 asynchronous setting mysql_`query`::error and Query_log_e::error_code
refining tests as they appear to be non-deterministic.
mysql-test/suite/binlog/r/binlog_killed.result@stripped, 2007-11-05 22:10:18+02:00, aelkin@stripped +32 -23
results changed
mysql-test/suite/binlog/t/binlog_killed.test@stripped, 2007-11-05 22:10:18+02:00, aelkin@stripped +31 -19
restructuring the test to deliver more deterministic outcome.
order-by for update and delete did not guaratee the order of scanning.
--error are masked with zero in order to catch more info if killing
really will happen to be non-deterministic on some platform (witnessed
something like that on dl145j)
mysql-test/suite/binlog/t/binlog_killed_simulate.test@stripped, 2007-11-05 22:10:18+02:00, aelkin@stripped +1 -0
important guard added
diff -Nrup a/mysql-test/suite/binlog/r/binlog_killed.result b/mysql-test/suite/binlog/r/binlog_killed.result
--- a/mysql-test/suite/binlog/r/binlog_killed.result 2007-10-31 11:48:43 +02:00
+++ b/mysql-test/suite/binlog/r/binlog_killed.result 2007-11-05 22:10:18 +02:00
@@ -17,8 +17,7 @@ update t1 set b=11 where a=2;
update t1 set b=b+10;
kill query ID;
rollback;
-ERROR 70100: Query execution was interrupted
-select * from t1 /* must be the same as before (1,1),(2,2) */;
+select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
a b
1 1
2 2
@@ -27,8 +26,7 @@ delete from t1 where a=2;
delete from t1 where 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) */;
+select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
a b
1 1
2 2
@@ -41,39 +39,45 @@ begin;
insert into t1 select * from t4 for update;
kill query ID;
rollback;
-ERROR 70100: Query execution was interrupted
rollback;
select * from t1 /* must be the same as before (1,1),(2,2) */;
a b
1 1
2 2
drop table t4;
+create table t4 (a int, b int) ENGINE=MyISAM /* for killing update and delete */;
create function bug27563(n int)
RETURNS int(11)
DETERMINISTIC
begin
-if n > 1 then
+if @b > 0 then
select get_lock("a", 10) into @a;
+else
+set @b= 1;
end if;
return n;
end|
-delete from t2;
-insert into t2 values (1,1), (2,2);
+delete from t4;
+insert into t4 values (1,1), (1,1);
reset master;
select get_lock("a", 20);
get_lock("a", 20)
1
-update t2 set b=b + bug27563(b) order by a;
+set @b= 0;
+update t4 set b=b + bug27563(b);
kill query ID;
-ERROR 70100: Query execution was interrupted
-select * from t2 /* must be (1,2), (2,2) */;
+select * from t4 order by b /* must be (1,1), (1,2) */;
a b
+1 1
1 2
-2 2
-must have the update event more to FD
+select @b /* must be 1 at the end of a stmt calling bug27563() */;
+@b
+1
+must have the update query event more to FD
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; update t2 set b=b + bug27563(b) order by a
+master-bin.000001 # User var # # @`b`=0
+master-bin.000001 # Query # # use `test`; update t4 set b=b + bug27563(b)
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
is not null;
@@ -86,22 +90,26 @@ select 0 /* must return 0 to mean the ki
select RELEASE_LOCK("a");
RELEASE_LOCK("a")
1
-delete from t2;
-insert into t2 values (1,1), (2,2);
+delete from t4;
+insert into t4 values (1,1), (2,2);
reset master;
select get_lock("a", 20);
get_lock("a", 20)
1
-delete from t2 where a=1 or a=bug27563(2) order by a;
+set @b= 0;
+delete from t4 where b=bug27563(1) or b=bug27563(2);
kill query ID;
-ERROR 70100: Query execution was interrupted
-select * from t2 /* must be (1,2), (2,2) */;
-a b
-1 1
-2 2
-must have the update event more to FD
+select count(*) from t4 /* must be 1 */;
+count(*)
+1
+select @b /* must be 1 at the end of a stmt calling bug27563() */;
+@b
+1
+must have the delete query event more to FD
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # User var # # @`b`=0
+master-bin.000001 # Query # # use `test`; delete from t4 where b=bug27563(1) or b=bug27563(2)
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
is not null;
@@ -114,6 +122,7 @@ select 0 /* must return 0 to mean the ki
select RELEASE_LOCK("a");
RELEASE_LOCK("a")
1
+drop table t4;
drop function bug27563;
drop table t1,t2,t3;
end of the tests
diff -Nrup a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
--- a/mysql-test/suite/binlog/t/binlog_killed.test 2007-10-31 11:48:43 +02:00
+++ b/mysql-test/suite/binlog/t/binlog_killed.test 2007-11-05 22:10:18 +02:00
@@ -68,7 +68,6 @@ select @result /* must be zero either wa
delete from t1;
delete from t2;
insert into t1 values (1,1),(2,2);
-let $ID= `select connection_id()`;
#
# simple update
@@ -77,6 +76,7 @@ connection con1;
begin; update t1 set b=11 where a=2;
connection con2;
+let $ID= `select connection_id()`;
send update t1 set b=b+10;
connection con1;
@@ -85,9 +85,9 @@ eval kill query $ID;
rollback;
connection con2;
---error ER_QUERY_INTERRUPTED
+--error 0,ER_QUERY_INTERRUPTED
reap;
-select * from t1 /* must be the same as before (1,1),(2,2) */;
+select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
#
# multi update
@@ -120,6 +120,7 @@ connection con1;
begin; delete from t1 where a=2;
connection con2;
+let $ID= `select connection_id()`;
send delete from t1 where a=2;
connection con1;
@@ -128,9 +129,9 @@ eval kill query $ID;
rollback;
connection con2;
---error ER_QUERY_INTERRUPTED
+--error 0,ER_QUERY_INTERRUPTED
reap;
-select * from t1 /* must be the same as before (1,1),(2,2) */;
+select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
#
# multi delete
@@ -163,6 +164,7 @@ insert into t4 values (3, 3);
begin; insert into t1 values (3, 3);
connection con2;
+let $ID= `select connection_id()`;
begin;
send insert into t1 select * from t4 for update;
@@ -172,7 +174,7 @@ eval kill query $ID;
rollback;
connection con2;
---error ER_QUERY_INTERRUPTED
+--error 0,ER_QUERY_INTERRUPTED
reap;
rollback;
select * from t1 /* must be the same as before (1,1),(2,2) */;
@@ -182,13 +184,17 @@ drop table t4; # cleanup for the sub-cas
###
## non-ta table case: killing must be recorded in binlog
###
+create table t4 (a int, b int) ENGINE=MyISAM /* for killing update and delete */;
+
delimiter |;
create function bug27563(n int)
RETURNS int(11)
DETERMINISTIC
begin
- if n > 1 then
+ if @b > 0 then
select get_lock("a", 10) into @a;
+ else
+ set @b= 1;
end if;
return n;
end|
@@ -198,25 +204,27 @@ delimiter ;|
# update
#
-delete from t2;
-insert into t2 values (1,1), (2,2);
+delete from t4;
+insert into t4 values (1,1), (1,1);
reset master;
connection con1;
select get_lock("a", 20);
connection con2;
let $ID= `select connection_id()`;
-send update t2 set b=b + bug27563(b) order by a;
+set @b= 0;
+send update t4 set b=b + bug27563(b);
connection con1;
--replace_result $ID ID
eval kill query $ID;
connection con2;
---error ER_QUERY_INTERRUPTED
+--error 0,ER_QUERY_INTERRUPTED
reap;
-select * from t2 /* must be (1,2), (2,2) */;
---echo must have the update event more to FD
+select * from t4 order by b /* must be (1,1), (1,2) */;
+select @b /* must be 1 at the end of a stmt calling bug27563() */;
+--echo must have the update query event more to FD
source include/show_binlog_events.inc;
# a proof the query is binlogged with an error
@@ -239,25 +247,27 @@ select RELEASE_LOCK("a");
# delete
#
-delete from t2;
-insert into t2 values (1,1), (2,2);
+delete from t4;
+insert into t4 values (1,1), (2,2);
reset master;
connection con1;
select get_lock("a", 20);
connection con2;
let $ID= `select connection_id()`;
-send delete from t2 where a=1 or a=bug27563(2) order by a;
+set @b= 0;
+send delete from t4 where b=bug27563(1) or b=bug27563(2);
connection con1;
--replace_result $ID ID
eval kill query $ID;
connection con2;
---error ER_QUERY_INTERRUPTED
+--error 0,ER_QUERY_INTERRUPTED
reap;
-select * from t2 /* must be (1,2), (2,2) */;
---echo must have the update event more to FD
+select count(*) from t4 /* must be 1 */;
+select @b /* must be 1 at the end of a stmt calling bug27563() */;
+--echo must have the delete query event more to FD
source include/show_binlog_events.inc;
# a proof the query is binlogged with an error
@@ -275,6 +285,8 @@ eval select $error_code /* must return 0
connection con1;
select RELEASE_LOCK("a");
--remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
+
+drop table t4;
#
# load data - see simulation tests
diff -Nrup a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test
--- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test 2007-10-31 11:48:43 +02:00
+++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test 2007-11-05 22:10:18 +02:00
@@ -1,3 +1,4 @@
+-- source include/have_debug.inc
-- source include/have_binlog_format_mixed_or_statement.inc
#
# bug#27571 asynchronous setting mysql_$query()'s local error and
| Thread |
|---|
| • bk commit into 5.1 tree (aelkin:1.2611) BUG#27571 | Andrei Elkin | 5 Nov |