diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-11-07 14:47:25 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-11-07 14:47:25 +0200 |
commit | 4fa5e50edbba856a2fe60d1dde7eb5571f42bd68 (patch) | |
tree | 55c72cdc1d8c91f0b56057c2e2c01f7ce3c93883 /innobase/que/que0que.c | |
parent | 8fc4319ae36e106ed8474a567bd1bd00e6337d5f (diff) | |
download | mariadb-git-4fa5e50edbba856a2fe60d1dde7eb5571f42bd68.tar.gz |
Many files:
Fix hang introduced by selective deadlock resolution
srv0srv.c, row0mysql.c:
Fix hang introduced by selective deadlock resolution + corruption caused by lock timeout or sel deadl res in ON DELETE CASCADE
innobase/include/que0que.h:
Fix hang introduced by selective deadlock resolution
innobase/include/trx0trx.h:
Fix hang introduced by selective deadlock resolution
innobase/include/ut0ut.h:
Fix hang introduced by selective deadlock resolution
innobase/lock/lock0lock.c:
Fix hang introduced by selective deadlock resolution
innobase/log/log0log.c:
Fix hang introduced by selective deadlock resolution
innobase/que/que0que.c:
Fix hang introduced by selective deadlock resolution
innobase/row/row0mysql.c:
Fix hang introduced by selective deadlock resolution + corruption caused by lock timeout or sel deadl res in ON DELETE CASCADE
innobase/srv/srv0srv.c:
Fix hang introduced by selective deadlock resolution + corruption caused by lock timeout or sel deadl res in ON DELETE CASCADE
innobase/trx/trx0sys.c:
Fix hang introduced by selective deadlock resolution
innobase/trx/trx0trx.c:
Fix hang introduced by selective deadlock resolution
Diffstat (limited to 'innobase/que/que0que.c')
-rw-r--r-- | innobase/que/que0que.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c index 7fa444f6741..a96c8840a03 100644 --- a/innobase/que/que0que.c +++ b/innobase/que/que0que.c @@ -1046,14 +1046,16 @@ que_thr_stop( } /************************************************************************** -A patch for MySQL used to 'stop' a dummy query thread used in MySQL. */ +A patch for MySQL used to 'stop' a dummy query thread used in MySQL. The +query thread is stopped and made inactive, except in the case where +it was put to the lock wait state in lock0lock.c, but the lock has already +been granted or the transaction chosen as a victim in deadlock resolution. */ void que_thr_stop_for_mysql( /*===================*/ que_thr_t* thr) /* in: query thread */ { - ibool stopped = FALSE; trx_t* trx; trx = thr_get_trx(thr); @@ -1067,13 +1069,10 @@ que_thr_stop_for_mysql( /* Error handling built for the MySQL interface */ thr->state = QUE_THR_COMPLETED; - - stopped = TRUE; - } - - if (!stopped) { - /* It must have been a lock wait but the - lock was already released */ + } else { + /* It must have been a lock wait but the lock was + already released, or this transaction was chosen + as a victim in selective deadlock resolution */ mutex_exit(&kernel_mutex); @@ -1081,6 +1080,10 @@ que_thr_stop_for_mysql( } } + ut_ad(thr->is_active == TRUE); + ut_ad(trx->n_active_thrs == 1); + ut_ad(thr->graph->n_active_thrs == 1); + thr->is_active = FALSE; (thr->graph)->n_active_thrs--; @@ -1132,6 +1135,9 @@ que_thr_stop_for_mysql_no_error( trx_t* trx) /* in: transaction */ { ut_ad(thr->state == QUE_THR_RUNNING); + ut_ad(thr->is_active == TRUE); + ut_ad(trx->n_active_thrs == 1); + ut_ad(thr->graph->n_active_thrs == 1); if (thr->magic_n != QUE_THR_MAGIC_N) { fprintf(stderr, |