BitKeeper/triggers/post-commit

    do REAL_EMAIL magic
mysql-test/mysql-test-run.sh
    added show_failed_diffs
mysql-test/r/bench_count_distinct.result
    tired of waiting :-)
mysql-test/r/rpl000001.result
    new test results after implementing Monty's Hack (TM)
mysql-test/t/bench_count_distinct.test
    tired of waiting
mysql-test/t/rpl000001.test
    implemented Monty's Hack (TM) to kill a query in the middle of update
    without generating a table with 30,000 rows. This will also avoice the
    timing uncertainty
parent 714431e3
...@@ -5,6 +5,13 @@ TO=dev@mysql.com ...@@ -5,6 +5,13 @@ TO=dev@mysql.com
FROM=$USER@mysql.com FROM=$USER@mysql.com
LIMIT=10000 LIMIT=10000
if [ "$REAL_EMAIL" = "" ]
then
echo "Warning: you must set REAL_EMAIL in your profile"
else
FROM=$REAL_EMAIL
fi
BK_STATUS=$BK_STATUS$BK_COMMIT BK_STATUS=$BK_STATUS$BK_COMMIT
if [ "$BK_STATUS" = OK ] if [ "$BK_STATUS" = OK ]
......
...@@ -44,6 +44,7 @@ which () ...@@ -44,6 +44,7 @@ which ()
# No paths below as we can't be sure where the program is! # No paths below as we can't be sure where the program is!
BASENAME=`which basename | head -1` BASENAME=`which basename | head -1`
DIFF=`which diff | head -1`
CAT=cat CAT=cat
CUT=cut CUT=cut
TAIL=tail TAIL=tail
...@@ -283,6 +284,20 @@ prompt_user () ...@@ -283,6 +284,20 @@ prompt_user ()
read unused read unused
} }
show_failed_diff ()
{
reject_file=r/$1.reject
result_file=r/$1.result
if [ -x "$DIFF" ] && [ -f $reject_file ]
then
echo "Below are the diffs between actual and expected results:"
echo "-------------------------------------------------------"
$DIFF -u $result_file $reject_file
echo "-------------------------------------------------------"
echo "Please e-mail the above, along with the output of mysqlbug"
echo "and any other relevant info to bugs@lists.mysql.com"
fi
}
error () { error () {
$ECHO "Error: $1" $ECHO "Error: $1"
...@@ -675,6 +690,7 @@ run_testcase () ...@@ -675,6 +690,7 @@ run_testcase ()
$ECHO "$RES$RES_SPACE [ fail ]" $ECHO "$RES$RES_SPACE [ fail ]"
$ECHO $ECHO
error_is error_is
show_failed_diff $tname
$ECHO $ECHO
if [ x$FORCE != x1 ] ; then if [ x$FORCE != x1 ] ; then
$ECHO "Aborting. To continue, re-run with '--force'." $ECHO "Aborting. To continue, re-run with '--force'."
......
count(distinct n) count(distinct n)
10000 100
...@@ -6,8 +6,8 @@ sum(length(word)) ...@@ -6,8 +6,8 @@ sum(length(word))
(@id := id) - id (@id := id) - id
0 0
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter
127.0.0.1 root 9306 1 master-bin.001 1729137 No 1053 Slave: query ' update t1 set n = n + 1' partially completed on the master and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET SQL_SLAVE_SKIP_COUNTER=1; SLAVE START; 0 127.0.0.1 root 9306 1 master-bin.001 939 No 1053 Slave: query ' update t1 set n = n + get_lock('crash_lock', 2)' partially completed on the master and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET SQL_SLAVE_SKIP_COUNTER=1; SLAVE START; 0
count(*) count(*)
30000 10
n n
3456 3456
drop table if exists t1; drop table if exists t1;
create table t1(n int not null, key(n)) delay_key_write = 1; create table t1(n int not null, key(n)) delay_key_write = 1;
let $1=10000; let $1=100;
while ($1) while ($1)
{ {
eval insert into t1 values($1); eval insert into t1 values($1);
......
...@@ -30,7 +30,7 @@ reset slave; ...@@ -30,7 +30,7 @@ reset slave;
connection master; connection master;
drop table if exists t1,t2; drop table if exists t1,t2;
create table t1(n int); create table t1(n int);
let $1=30000; let $1=10;
while ($1) while ($1)
{ {
eval insert into t1 values($1); eval insert into t1 values($1);
...@@ -39,10 +39,17 @@ while ($1) ...@@ -39,10 +39,17 @@ while ($1)
create table t2(id int); create table t2(id int);
insert into t2 values(connection_id()); insert into t2 values(connection_id());
save_master_pos; save_master_pos;
send update t1 set n = n + 1;
connection master1;
#avoid generating result
create temporary table t1_temp(n int);
insert into t1_temp select get_lock('crash_lock', 1) from t2;
connection master;
send update t1 set n = n + get_lock('crash_lock', 2);
connection master1; connection master1;
sleep 2;
select (@id := id) - id from t2; select (@id := id) - id from t2;
sleep 0.1;
kill @id; kill @id;
drop table t2; drop table t2;
connection master; connection master;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment