mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
bug#22725
combining the final result variable in such way that either option of the test execution will yield zero.
This commit is contained in:
parent
2e60009cde
commit
508e17fd93
2 changed files with 15 additions and 31 deletions
|
@ -6,19 +6,7 @@ get_lock("a", 20)
|
||||||
1
|
1
|
||||||
reset master;
|
reset master;
|
||||||
insert into t2 values (null, null), (null, get_lock("a", 10)),(null, get_lock("a", 10));
|
insert into t2 values (null, null), (null, get_lock("a", 10)),(null, get_lock("a", 10));
|
||||||
select count(*) from t2 /* must be 3 */;
|
select @result /* must be zero either way */;
|
||||||
count(*)
|
@result
|
||||||
3
|
0
|
||||||
select
|
|
||||||
(@a:=load_file("MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
|
|
||||||
is not null;
|
|
||||||
(@a:=load_file("MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
|
|
||||||
is not null
|
|
||||||
1
|
|
||||||
select @a like "%#%error_code=0%" /* must return 1 */;
|
|
||||||
@a like "%#%error_code=0%"
|
|
||||||
1
|
|
||||||
select @a like "%insert into%" /* must return 1 */;
|
|
||||||
@a like "%insert into%"
|
|
||||||
1
|
|
||||||
drop table t1,t2,t3;
|
drop table t1,t2,t3;
|
||||||
|
|
|
@ -31,24 +31,12 @@ disable_abort_on_error;
|
||||||
disable_query_log;
|
disable_query_log;
|
||||||
disable_result_log;
|
disable_result_log;
|
||||||
|
|
||||||
while (`select count(*) from t2`)
|
|
||||||
{
|
|
||||||
sleep 0.1;
|
|
||||||
dec $counter;
|
|
||||||
if (!$counter)
|
|
||||||
{
|
|
||||||
die("Waited too long for query to suceed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
eval kill query $ID;
|
eval kill query $ID;
|
||||||
enable_abort_on_error;
|
|
||||||
enable_query_log;
|
|
||||||
enable_result_log;
|
|
||||||
|
|
||||||
connection con2;
|
connection con2;
|
||||||
--error 0,ER_QUERY_INTERRUPTED
|
--error 0,ER_QUERY_INTERRUPTED
|
||||||
reap;
|
reap;
|
||||||
select count(*) from t2 /* must be 3 */;
|
let $rows= `select count(*) from t2 /* must be 1 or 0 */`;
|
||||||
|
|
||||||
--exec $MYSQL_BINLOG --start-position=126 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
|
--exec $MYSQL_BINLOG --start-position=126 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
|
||||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||||
|
@ -56,8 +44,16 @@ eval select
|
||||||
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
|
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
|
||||||
is not null;
|
is not null;
|
||||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||||
eval select @a like "%#%error_code=0%" /* must return 1 */;
|
let $error_code= `select @a like "%#%error_code=0%" /* must return 1 or 0*/`;
|
||||||
eval select @a like "%insert into%" /* must return 1 */;
|
let $insert_binlogged= `select @a like "%insert into%" /* must return 1 or 0 */`;
|
||||||
|
eval set @result= $rows-2*$error_code - $insert_binlogged;
|
||||||
|
|
||||||
|
enable_abort_on_error;
|
||||||
|
enable_query_log;
|
||||||
|
enable_result_log;
|
||||||
|
|
||||||
|
select @result /* must be zero either way */;
|
||||||
|
|
||||||
# the functions are either *insensitive* to killing or killing can cause
|
# the functions are either *insensitive* to killing or killing can cause
|
||||||
# strange problmes with the error propagation out of SF's stack
|
# strange problmes with the error propagation out of SF's stack
|
||||||
# Bug#27563, Bug#27565, BUG#24971
|
# Bug#27563, Bug#27565, BUG#24971
|
||||||
|
@ -245,7 +241,7 @@ drop function bug27563;
|
||||||
drop function bug27565;
|
drop function bug27565;
|
||||||
}
|
}
|
||||||
|
|
||||||
#system rm $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog ;
|
system rm $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog ;
|
||||||
|
|
||||||
drop table t1,t2,t3;
|
drop table t1,t2,t3;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue