Commit 8a03ef79 authored by Vasil Dimov's avatar Vasil Dimov

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
parent 2bd4b5e2
...@@ -202,7 +202,7 @@ eval kill query $ID; ...@@ -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;
......
...@@ -759,6 +759,10 @@ convert_error_code_to_mysql( ...@@ -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
} }
......
...@@ -69,6 +69,9 @@ Created 5/24/1996 Heikki Tuuri ...@@ -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
......
...@@ -483,6 +483,7 @@ handle_new_error: ...@@ -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
......
...@@ -1554,12 +1554,16 @@ srv_suspend_mysql_thread( ...@@ -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
......
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