mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Merge from innodb-branches-5.1
This commit is contained in:
commit
6f2f0704cb
3 changed files with 58 additions and 5 deletions
18
storage/innobase/mysql-test/innodb_bug51920.result
Normal file
18
storage/innobase/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
storage/innobase/mysql-test/innodb_bug51920.test
Normal file
33
storage/innobase/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
|
|
@ -1554,8 +1554,9 @@ srv_suspend_mysql_thread(
|
|||
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
||||
if (srv_lock_wait_timeout < 100000000
|
||||
&& wait_time > (double)srv_lock_wait_timeout) {
|
||||
if (trx_is_interrupted(trx)
|
||||
|| (srv_lock_wait_timeout < 100000000
|
||||
&& wait_time > (double)srv_lock_wait_timeout)) {
|
||||
|
||||
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
|
||||
}
|
||||
|
@ -2104,9 +2105,10 @@ loop:
|
|||
|
||||
wait_time = ut_difftime(ut_time(), slot->suspend_time);
|
||||
|
||||
if (srv_lock_wait_timeout < 100000000
|
||||
&& (wait_time > (double) srv_lock_wait_timeout
|
||||
|| wait_time < 0)) {
|
||||
if (trx_is_interrupted(thr_get_trx(slot->thr))
|
||||
|| (srv_lock_wait_timeout < 100000000
|
||||
&& (wait_time > (double) srv_lock_wait_timeout
|
||||
|| wait_time < 0))) {
|
||||
|
||||
/* Timeout exceeded or a wrap-around in system
|
||||
time counter: cancel the lock request queued
|
||||
|
|
Loading…
Reference in a new issue