mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
This commit is contained in:
@@ -9,23 +9,30 @@ insert into t2 values (null, null), (null, get_lock("a", 10));
|
|||||||
select @result /* must be zero either way */;
|
select @result /* must be zero either way */;
|
||||||
@result
|
@result
|
||||||
0
|
0
|
||||||
|
select RELEASE_LOCK("a");
|
||||||
|
RELEASE_LOCK("a")
|
||||||
|
1
|
||||||
delete from t1;
|
delete from t1;
|
||||||
delete from t2;
|
delete from t2;
|
||||||
insert into t1 values (1,1),(2,2);
|
insert into t1 values (1,1),(2,2);
|
||||||
begin;
|
begin;
|
||||||
update t1 set b=11 where a=2;
|
update t1 set b=11 where a=2;
|
||||||
|
begin;
|
||||||
update t1 set b=b+10;
|
update t1 set b=b+10;
|
||||||
kill query ID;
|
kill query ID;
|
||||||
rollback;
|
rollback;
|
||||||
|
rollback;
|
||||||
select * from t1 order by a /* 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
|
a b
|
||||||
1 1
|
1 1
|
||||||
2 2
|
2 2
|
||||||
begin;
|
begin;
|
||||||
delete from t1 where a=2;
|
delete from t1 where a=2;
|
||||||
|
begin;
|
||||||
delete from t1 where a=2;
|
delete from t1 where a=2;
|
||||||
kill query ID;
|
kill query ID;
|
||||||
rollback;
|
rollback;
|
||||||
|
rollback;
|
||||||
select * from t1 order by a /* 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
|
a b
|
||||||
1 1
|
1 1
|
||||||
@@ -51,7 +58,7 @@ RETURNS int(11)
|
|||||||
DETERMINISTIC
|
DETERMINISTIC
|
||||||
begin
|
begin
|
||||||
if @b > 0 then
|
if @b > 0 then
|
||||||
select get_lock("a", 10) into @a;
|
select get_lock("a", 20) into @a;
|
||||||
else
|
else
|
||||||
set @b= 1;
|
set @b= 1;
|
||||||
end if;
|
end if;
|
||||||
@@ -65,7 +72,11 @@ get_lock("a", 20)
|
|||||||
1
|
1
|
||||||
set @b= 0;
|
set @b= 0;
|
||||||
update t4 set b=b + bug27563(b);
|
update t4 set b=b + bug27563(b);
|
||||||
|
select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock';
|
||||||
|
count(*)
|
||||||
|
1
|
||||||
kill query ID;
|
kill query ID;
|
||||||
|
ERROR 70100: Query execution was interrupted
|
||||||
select * from t4 order by b /* must be (1,1), (1,2) */;
|
select * from t4 order by b /* must be (1,1), (1,2) */;
|
||||||
a b
|
a b
|
||||||
1 1
|
1 1
|
||||||
@@ -98,7 +109,11 @@ get_lock("a", 20)
|
|||||||
1
|
1
|
||||||
set @b= 0;
|
set @b= 0;
|
||||||
delete from t4 where b=bug27563(1) or b=bug27563(2);
|
delete from t4 where b=bug27563(1) or b=bug27563(2);
|
||||||
|
select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock';
|
||||||
|
count(*)
|
||||||
|
1
|
||||||
kill query ID;
|
kill query ID;
|
||||||
|
ERROR 70100: Query execution was interrupted
|
||||||
select count(*) from t4 /* must be 1 */;
|
select count(*) from t4 /* must be 1 */;
|
||||||
count(*)
|
count(*)
|
||||||
1
|
1
|
||||||
|
@@ -57,6 +57,8 @@ select @result /* must be zero either way */;
|
|||||||
|
|
||||||
|
|
||||||
--remove_file $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
|
--remove_file $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
|
||||||
|
connection con1;
|
||||||
|
select RELEASE_LOCK("a");
|
||||||
|
|
||||||
#
|
#
|
||||||
# bug#27571 asynchronous setting mysql_`query`::error and Query_log_e::error_code
|
# bug#27571 asynchronous setting mysql_`query`::error and Query_log_e::error_code
|
||||||
@@ -77,6 +79,7 @@ begin; update t1 set b=11 where a=2;
|
|||||||
|
|
||||||
connection con2;
|
connection con2;
|
||||||
let $ID= `select connection_id()`;
|
let $ID= `select connection_id()`;
|
||||||
|
begin;
|
||||||
send update t1 set b=b+10;
|
send update t1 set b=b+10;
|
||||||
|
|
||||||
connection con1;
|
connection con1;
|
||||||
@@ -84,9 +87,18 @@ connection con1;
|
|||||||
eval kill query $ID;
|
eval kill query $ID;
|
||||||
rollback;
|
rollback;
|
||||||
|
|
||||||
|
# Bug #32148 killi query may be ineffective
|
||||||
|
# forced to comment out the test's outcome
|
||||||
|
# and mask out ineffective ER_QUERY_INTERRUPTED
|
||||||
|
# todo1: revert back upon fixing bug#32148
|
||||||
|
# todo2: the tests need refining in that
|
||||||
|
# killing should wait till the victim requested
|
||||||
|
# its lock (wait_condition available in 5.1 tests)
|
||||||
|
|
||||||
connection con2;
|
connection con2;
|
||||||
--error 0,ER_QUERY_INTERRUPTED
|
--error 0,ER_QUERY_INTERRUPTED
|
||||||
reap;
|
reap;
|
||||||
|
rollback;
|
||||||
select * from t1 order by a /* 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) */;
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -121,6 +133,7 @@ begin; delete from t1 where a=2;
|
|||||||
|
|
||||||
connection con2;
|
connection con2;
|
||||||
let $ID= `select connection_id()`;
|
let $ID= `select connection_id()`;
|
||||||
|
begin;
|
||||||
send delete from t1 where a=2;
|
send delete from t1 where a=2;
|
||||||
|
|
||||||
connection con1;
|
connection con1;
|
||||||
@@ -131,8 +144,11 @@ rollback;
|
|||||||
connection con2;
|
connection con2;
|
||||||
--error 0,ER_QUERY_INTERRUPTED
|
--error 0,ER_QUERY_INTERRUPTED
|
||||||
reap;
|
reap;
|
||||||
|
rollback;
|
||||||
|
# todo1,2 above
|
||||||
select * from t1 order by a /* 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
|
# multi delete
|
||||||
# the same as for multi-update
|
# the same as for multi-update
|
||||||
@@ -176,6 +192,7 @@ rollback;
|
|||||||
connection con2;
|
connection con2;
|
||||||
--error 0,ER_QUERY_INTERRUPTED
|
--error 0,ER_QUERY_INTERRUPTED
|
||||||
reap;
|
reap;
|
||||||
|
# todo 1,2 above
|
||||||
rollback;
|
rollback;
|
||||||
select * from t1 /* must be the same as before (1,1),(2,2) */;
|
select * from t1 /* must be the same as before (1,1),(2,2) */;
|
||||||
|
|
||||||
@@ -192,7 +209,7 @@ RETURNS int(11)
|
|||||||
DETERMINISTIC
|
DETERMINISTIC
|
||||||
begin
|
begin
|
||||||
if @b > 0 then
|
if @b > 0 then
|
||||||
select get_lock("a", 10) into @a;
|
select get_lock("a", 20) into @a;
|
||||||
else
|
else
|
||||||
set @b= 1;
|
set @b= 1;
|
||||||
end if;
|
end if;
|
||||||
@@ -216,11 +233,15 @@ set @b= 0;
|
|||||||
send update t4 set b=b + bug27563(b);
|
send update t4 set b=b + bug27563(b);
|
||||||
|
|
||||||
connection con1;
|
connection con1;
|
||||||
|
let $wait_condition= select count(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock';
|
||||||
|
source include/wait_condition.inc;
|
||||||
|
select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock';
|
||||||
|
|
||||||
--replace_result $ID ID
|
--replace_result $ID ID
|
||||||
eval kill query $ID;
|
eval kill query $ID;
|
||||||
|
|
||||||
connection con2;
|
connection con2;
|
||||||
--error 0,ER_QUERY_INTERRUPTED
|
--error ER_QUERY_INTERRUPTED
|
||||||
reap;
|
reap;
|
||||||
select * from t4 order by b /* must be (1,1), (1,2) */;
|
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() */;
|
select @b /* must be 1 at the end of a stmt calling bug27563() */;
|
||||||
@@ -259,11 +280,14 @@ set @b= 0;
|
|||||||
send delete from t4 where b=bug27563(1) or b=bug27563(2);
|
send delete from t4 where b=bug27563(1) or b=bug27563(2);
|
||||||
|
|
||||||
connection con1;
|
connection con1;
|
||||||
|
let $wait_condition= select count(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock';
|
||||||
|
source include/wait_condition.inc;
|
||||||
|
select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock';
|
||||||
--replace_result $ID ID
|
--replace_result $ID ID
|
||||||
eval kill query $ID;
|
eval kill query $ID;
|
||||||
|
|
||||||
connection con2;
|
connection con2;
|
||||||
--error 0,ER_QUERY_INTERRUPTED
|
--error ER_QUERY_INTERRUPTED
|
||||||
reap;
|
reap;
|
||||||
select count(*) from t4 /* must be 1 */;
|
select count(*) from t4 /* must be 1 */;
|
||||||
select @b /* must be 1 at the end of a stmt calling bug27563() */;
|
select @b /* must be 1 at the end of a stmt calling bug27563() */;
|
||||||
|
@@ -106,9 +106,3 @@ connection slave;
|
|||||||
sync_with_master;
|
sync_with_master;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
# The A->B->A replication causes the master to start writing relay logs
|
|
||||||
# in var/run, remove them
|
|
||||||
remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.000001;
|
|
||||||
remove_file $MYSQLTEST_VARDIR/run/master-relay-bin.index;
|
|
||||||
|
@@ -208,8 +208,9 @@ select * from t1;
|
|||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
--remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
|
||||||
|
|
||||||
# Delete the anonymous users
|
# Delete the anonymous users
|
||||||
source include/delete_anonymous_users.inc;
|
source include/delete_anonymous_users.inc;
|
||||||
|
|
||||||
# End of 5.1 tests
|
# End of tests
|
||||||
|
10
sql/log.cc
10
sql/log.cc
@@ -2157,13 +2157,9 @@ const char *MYSQL_LOG::generate_name(const char *log_name,
|
|||||||
{
|
{
|
||||||
if (!log_name || !log_name[0])
|
if (!log_name || !log_name[0])
|
||||||
{
|
{
|
||||||
/*
|
strmake(buff, pidfile_name, FN_REFLEN - strlen(suffix) - 1);
|
||||||
TODO: The following should be using fn_format(); We just need to
|
return (const char *)
|
||||||
first change fn_format() to cut the file name if it's too long.
|
fn_format(buff, buff, "", suffix, MYF(MY_REPLACE_EXT|MY_REPLACE_DIR));
|
||||||
*/
|
|
||||||
strmake(buff, pidfile_name, FN_REFLEN - 5);
|
|
||||||
strmov(fn_ext(buff), suffix);
|
|
||||||
return (const char *)buff;
|
|
||||||
}
|
}
|
||||||
// get rid of extension if the log is binary to avoid problems
|
// get rid of extension if the log is binary to avoid problems
|
||||||
if (strip_ext)
|
if (strip_ext)
|
||||||
|
Reference in New Issue
Block a user