1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge from mysql-trunk-innodb into mysql-5.1-innodb/storage/innobase:

------------------------------------------------------------
  revno: 3094
  revision-id: vasil.dimov@oracle.com-20100513074652-0cvlhgkesgbb2bfh
  parent: vasil.dimov@oracle.com-20100512173700-byf8xntxjur1hqov
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  branch nick: mysql-trunk-innodb
  timestamp: Thu 2010-05-13 10:46:52 +0300
  message:
    Followup to Bug#51920, fix binlog.binlog_killed
    
    This is a followup to the fix of
    
    Bug#51920 Innodb connections in row lock wait ignore KILL until lock wait
    timeout
    
    in that fix (rb://279) the behavior was changed to honor when a trx is
    interrupted during lock wait, but the returned error code was still
    "lock wait timeout" when it should be "interrupted".
    
    This change fixes the non-deterministically failing test binlog.binlog_killed,
    that failed like this:
    
    binlog.binlog_killed 'stmt'              [ fail ]
            Test ended at 2010-05-12 11:39:08
    
    CURRENT_TEST: binlog.binlog_killed
    mysqltest: At line 208: query 'reap' failed with wrong errno 1205: 'Lock wait timeout exceeded; try restarting transaction', instead of 0...
    
    Approved by:	Sunny Bains (rb://344)
  ------------------------------------------------------------

This merge is non-trivial since it has to introduce the DB_INTERRUPTED
error code.

Also revert vasil.dimov@oracle.com-20100408165555-9rpjh24o0sa9ad5y
which adjusted the binlog.binlog_killed test to the new (wrong) behavior
This commit is contained in:
Vasil Dimov
2010-05-20 10:39:02 +03:00
parent 3564a2643f
commit 094a1f1e58
5 changed files with 16 additions and 4 deletions

View File

@ -202,7 +202,7 @@ eval kill query $ID;
rollback; rollback;
connection con2; connection con2;
--error 0,ER_QUERY_INTERRUPTED,ER_LOCK_WAIT_TIMEOUT --error 0,ER_QUERY_INTERRUPTED
reap; reap;
# todo 1,2 above # todo 1,2 above
rollback; rollback;

View File

@ -759,6 +759,10 @@ convert_error_code_to_mysql(
} else if (error == DB_UNSUPPORTED) { } else if (error == DB_UNSUPPORTED) {
return(HA_ERR_UNSUPPORTED); return(HA_ERR_UNSUPPORTED);
} else if (error == DB_INTERRUPTED) {
my_error(ER_QUERY_INTERRUPTED, MYF(0));
return(-1);
} else { } else {
return(-1); // Unknown error return(-1); // Unknown error
} }

View File

@ -69,6 +69,9 @@ Created 5/24/1996 Heikki Tuuri
a feature that it can't recoginize or a feature that it can't recoginize or
work with e.g., FT indexes created by work with e.g., FT indexes created by
a later version of the engine. */ a later version of the engine. */
#define DB_INTERRUPTED 49 /* the query has been interrupted with
"KILL QUERY N;" */
/* The following are partial failure codes */ /* The following are partial failure codes */
#define DB_FAIL 1000 #define DB_FAIL 1000
#define DB_OVERFLOW 1001 #define DB_OVERFLOW 1001

View File

@ -483,6 +483,7 @@ handle_new_error:
} else if (err == DB_ROW_IS_REFERENCED } else if (err == DB_ROW_IS_REFERENCED
|| err == DB_NO_REFERENCED_ROW || err == DB_NO_REFERENCED_ROW
|| err == DB_CANNOT_ADD_CONSTRAINT || err == DB_CANNOT_ADD_CONSTRAINT
|| err == DB_INTERRUPTED
|| err == DB_TOO_MANY_CONCURRENT_TRXS) { || err == DB_TOO_MANY_CONCURRENT_TRXS) {
if (savept) { if (savept) {
/* Roll back the latest, possibly incomplete /* Roll back the latest, possibly incomplete

View File

@ -1554,12 +1554,16 @@ srv_suspend_mysql_thread(
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
if (trx_is_interrupted(trx) if (srv_lock_wait_timeout < 100000000
|| (srv_lock_wait_timeout < 100000000 && wait_time > (double)srv_lock_wait_timeout) {
&& wait_time > (double)srv_lock_wait_timeout)) {
trx->error_state = DB_LOCK_WAIT_TIMEOUT; trx->error_state = DB_LOCK_WAIT_TIMEOUT;
} }
if (trx_is_interrupted(trx)) {
trx->error_state = DB_INTERRUPTED;
}
#else /* UNIV_HOTBACKUP */ #else /* UNIV_HOTBACKUP */
/* This function depends on MySQL code that is not included in /* This function depends on MySQL code that is not included in
InnoDB Hot Backup builds. Besides, this function should never InnoDB Hot Backup builds. Besides, this function should never