mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +01:00
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 ------------------------------------------------------------------------
This commit is contained in:
parent
5618685826
commit
5ccfae8284
7 changed files with 91 additions and 10 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
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:
|
||||
|
|
|
@ -316,7 +316,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);
|
||||
|
@ -429,8 +429,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
|
||||
|
|
18
mysql-test/innodb_bug51920.result
Normal file
18
mysql-test/innodb_bug51920.result
Normal file
|
@ -0,0 +1,18 @@
|
|||
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;
|
||||
SELECT sleep(2);
|
||||
sleep(2)
|
||||
0
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID=@thread_id;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO
|
||||
ERROR 70100: Query execution was interrupted
|
||||
DROP TABLE bug51920;
|
33
mysql-test/innodb_bug51920.test
Normal file
33
mysql-test/innodb_bug51920.test
Normal file
|
@ -0,0 +1,33 @@
|
|||
#
|
||||
# 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;
|
||||
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE INFO="UPDATE bug51920 SET i=2"
|
||||
INTO @thread_id;
|
||||
|
||||
KILL @thread_id;
|
||||
SELECT sleep(2);
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID=@thread_id;
|
||||
|
||||
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_ulonglong) mach_float_read(data);
|
||||
break;
|
||||
|
||||
case DATA_DOUBLE:
|
||||
ut_a(len == sizeof(double));
|
||||
value = mach_double_read(data);
|
||||
value = (ib_ulonglong) mach_double_read(data);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -1609,8 +1609,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;
|
||||
}
|
||||
|
@ -2158,9 +2159,10 @@ loop:
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue