Commit 20f9d908 authored by mmakela's avatar mmakela

branches/innodb+: Merge revisions r6897:6925 from branches/zip.

Skip r6900, which was backported from branches/innodb+ 6899.
  ------------------------------------------------------------------------
  r6919 | mmakela | 2010-03-31 11:34:22 +0300 (Wed, 31 Mar 2010) | 54 lines
  Changed paths:
     M /branches/zip/ChangeLog
     M /branches/zip/handler/ha_innodb.cc
     M /branches/zip/mysql-test/innodb_bug38231.test
     A /branches/zip/mysql-test/innodb_bug51920.result
     A /branches/zip/mysql-test/innodb_bug51920.test
     M /branches/zip/row/row0sel.c
     M /branches/zip/srv/srv0srv.c

  branches/zip: Merge revisions 6788:6918 from branches/5.1:

    ------------------------------------------------------------------------
    r6822 | vasil | 2010-03-15 10:17:31 +0200 (Mon, 15 Mar 2010) | 12 lines
    Changed paths:
       M /branches/5.1/row/row0sel.c

    branches/5.1:

    Typecast to silence a compiler warning:

    row/row0sel.c: 4548
            C4244: '=' : conversion from 'float' to 'ib_ulonglong', possible loss of data
    row/row0sel.c: 4553
            C4244: '=' : conversion from 'double' to 'ib_ulonglong', possible loss of data

    Reported by:	Jonas Oreland <Jonas.Oreland@Sun.COM>
    Discussed with:	Sunny Bains <sunny.bains@oracle.com>
    ------------------------------------------------------------------------
    r6884 | vdimov | 2010-03-26 13:05:03 +0200 (Fri, 26 Mar 2010) | 6 lines
    Changed paths:
       M /branches/5.1/mysql-test/innodb_bug38231.test

    branches/5.1:

    Fix a non-determinism in innodb_bug38231.

    Reported by:	Sergey Vojtovich <svoj@Sun.COM>
    ------------------------------------------------------------------------
    r6911 | vdimov | 2010-03-30 11:39:02 +0300 (Tue, 30 Mar 2010) | 2 lines
    Changed paths:
       M /branches/5.1/handler/ha_innodb.cc

    branches/5.1: Whitespace fixup
    ------------------------------------------------------------------------
    r6912 | vdimov | 2010-03-30 12:18:46 +0300 (Tue, 30 Mar 2010) | 2 lines
    Changed paths:
       M /branches/5.1/handler/ha_innodb.cc

    branches/5.1: Whitespace fixup on line 354
    ------------------------------------------------------------------------
    r6918 | mmakela | 2010-03-31 11:14:51 +0300 (Wed, 31 Mar 2010) | 6 lines
    Changed paths:
       A /branches/5.1/mysql-test/innodb_bug51920.result
       A /branches/5.1/mysql-test/innodb_bug51920.test
       M /branches/5.1/srv/srv0srv.c

    branches/5.1: Obey KILL during a lock wait (Bug #51920).

    srv_suspend_mysql_thread(), srv_lock_timeout_and_monitor_thread():
    Check trx_is_interrupted() in addition to checking the lock wait timeout.

    rb://279 approved by Sunny Bains
    ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r6920 | mmakela | 2010-03-31 11:49:08 +0300 (Wed, 31 Mar 2010) | 1 line
  Changed paths:
     M /branches/zip/row/row0sel.c

  branches/zip: Fix a compilation error that sneaked in in r6919.
  ------------------------------------------------------------------------
  r6922 | mmakela | 2010-03-31 14:54:30 +0300 (Wed, 31 Mar 2010) | 11 lines
  Changed paths:
     M /branches/zip/mysql-test/innodb_bug51920.result
     M /branches/zip/mysql-test/innodb_bug51920.test

  branches/zip: Merge revisions 6918:6921 from branches/5.1:

    ------------------------------------------------------------------------
    r6921 | mmakela | 2010-03-31 14:33:04 +0300 (Wed, 31 Mar 2010) | 2 lines
    Changed paths:
       M /branches/5.1/mysql-test/innodb_bug51920.result
       M /branches/5.1/mysql-test/innodb_bug51920.test

    branches/5.1: innodb_bug51920.test: Make the test quicker and more
    deterministic.  Suggested by Vasil Dimov.
    ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r6925 | mmakela | 2010-03-31 15:30:56 +0300 (Wed, 31 Mar 2010) | 9 lines

  branches/zip: Merge revisions 6921:6924 from branches/5.1:

    ------------------------------------------------------------------------
    r6924 | mmakela | 2010-03-31 15:28:25 +0300 (Wed, 31 Mar 2010) | 1 line
    Changed paths:
       M /branches/5.1/mysql-test/innodb_bug51920.test

    branches/5.1: innodb_bug51920.test: Fix a race condition.
    ------------------------------------------------------------------------
  ------------------------------------------------------------------------
parent f8f424da
2010-03-31 The InnoDB Team
* mysql-test/innodb_bug51920.test, mysql-test/innodb_bug51920.result,
srv/srv0srv.c:
Fix Bug#51920 InnoDB connections in row lock wait ignore KILL
until lock wait timeout
2010-03-31 The InnoDB Team
* mysql-test/innodb_bug38231.test:
Remove non-determinism in the test case.
2010-03-18 The InnoDB Team
* CMakeLists.txt:
......
......@@ -441,7 +441,7 @@ static MYSQL_THDVAR_ULONG(lock_wait_timeout, PLUGIN_VAR_RQCMDARG,
static handler *innobase_create_handler(handlerton *hton,
TABLE_SHARE *table,
TABLE_SHARE *table,
MEM_ROOT *mem_root)
{
return new (mem_root) ha_innobase(hton, table);
......@@ -554,8 +554,9 @@ static
int
innobase_start_trx_and_assign_read_view(
/*====================================*/
handlerton* hton, /*!< in: Innodb handlerton */
THD* thd); /*!< in: MySQL thread handle of the user for whom
/* out: 0 */
handlerton* hton, /* in: Innodb handlerton */
THD* thd); /* in: MySQL thread handle of the user for whom
the transaction should be committed */
/****************************************************************//**
Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes
......
......@@ -27,6 +27,21 @@ SET autocommit=0;
-- send
LOCK TABLE bug38231 WRITE;
# When con1 does UNLOCK below this will release either con2 or con3 which are
# both waiting on LOCK. At the end we must first --reap and UNLOCK the
# connection that has been released, otherwise it will wait forever. We assume
# that the released connection will be the first one that has gained the LOCK,
# thus we force the order here - con2 does LOCK first, then con3. In other
# words we wait for LOCK from con2 above to be exected before doing LOCK in
# con3.
-- connection con1
let $wait_condition =
SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE info = 'LOCK TABLE bug38231 WRITE';
-- source include/wait_condition.inc
# the above enables query log, re-disable it
-- disable_query_log
-- connection con3
SET autocommit=0;
-- send
......
CREATE TABLE bug51920 (i INT) ENGINE=InnoDB;
INSERT INTO bug51920 VALUES (1);
BEGIN;
SELECT * FROM bug51920 FOR UPDATE;
i
1
UPDATE bug51920 SET i=2;
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE INFO="UPDATE bug51920 SET i=2"
INTO @thread_id;
KILL @thread_id;
ERROR 70100: Query execution was interrupted
DROP TABLE bug51920;
#
# Bug #51920: InnoDB connections in lock wait ignore KILL until timeout
#
-- source include/not_embedded.inc
-- source include/have_innodb.inc
CREATE TABLE bug51920 (i INT) ENGINE=InnoDB;
INSERT INTO bug51920 VALUES (1);
BEGIN;
SELECT * FROM bug51920 FOR UPDATE;
connect (con1,localhost,root,,);
connection con1;
--send
UPDATE bug51920 SET i=2;
connection default;
let $wait_condition =
SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE INFO="UPDATE bug51920 SET i=2";
-- source include/wait_condition.inc
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE INFO="UPDATE bug51920 SET i=2"
INTO @thread_id;
KILL @thread_id;
let $wait_condition =
SELECT COUNT(*)=0 FROM information_schema.processlist WHERE ID=@thread_id;
-- source include/wait_condition.inc
connection con1;
-- error ER_QUERY_INTERRUPTED
reap;
connection default;
DROP TABLE bug51920;
-- disconnect con1
......@@ -4613,12 +4613,12 @@ row_search_autoinc_read_column(
case DATA_FLOAT:
ut_a(len == sizeof(float));
value = mach_float_read(data);
value = (ib_uint64_t) mach_float_read(data);
break;
case DATA_DOUBLE:
ut_a(len == sizeof(double));
value = mach_double_read(data);
value = (ib_uint64_t) mach_double_read(data);
break;
default:
......
......@@ -1627,8 +1627,9 @@ srv_suspend_mysql_thread(
innodb_lock_wait_timeout, because trx->mysql_thd == NULL. */
lock_wait_timeout = thd_lock_wait_timeout(trx->mysql_thd);
if (lock_wait_timeout < 100000000
&& wait_time > (double) lock_wait_timeout) {
if (trx_is_interrupted(trx)
|| (lock_wait_timeout < 100000000
&& wait_time > (double) lock_wait_timeout)) {
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
}
......@@ -2185,9 +2186,10 @@ srv_lock_timeout_thread(
lock_wait_timeout = thd_lock_wait_timeout(
trx->mysql_thd);
if (lock_wait_timeout < 100000000
&& (wait_time > (double) lock_wait_timeout
|| wait_time < 0)) {
if (trx_is_interrupted(trx)
|| (lock_wait_timeout < 100000000
&& (wait_time > (double) lock_wait_timeout
|| wait_time < 0))) {
/* Timeout exceeded or a wrap-around in system
time counter: cancel the lock request queued
......
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