diff options
author | heikki@hundin.mysql.fi <> | 2002-10-30 09:44:06 +0200 |
---|---|---|
committer | heikki@hundin.mysql.fi <> | 2002-10-30 09:44:06 +0200 |
commit | 48b0cdc43fa68bf6ecf7e8131110c68fb109adcb (patch) | |
tree | 9e3baf8b0540f3ee896d93ec39c6d86490f40dc3 /innobase | |
parent | 93b301ba950ebd53f44f593efe57c1492fd5f13d (diff) | |
download | mariadb-git-48b0cdc43fa68bf6ecf7e8131110c68fb109adcb.tar.gz |
row0undo.c:
Partial fix to a hang introduced in CREATE TABLE in the push last night
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/row/row0undo.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/innobase/row/row0undo.c b/innobase/row/row0undo.c index b40d36533a4..6f1cfc4db9f 100644 --- a/innobase/row/row0undo.c +++ b/innobase/row/row0undo.c @@ -253,9 +253,17 @@ row_undo( } } - /* Prevent DROP TABLE etc. while we are rolling back this row */ + /* Prevent DROP TABLE etc. while we are rolling back this row. + If we are doing a TABLE CREATE or some other dictionary operation, + then we already have dict_operation_lock locked in x-mode. Do not + try to lock again in s-mode, because that would cause a hang. + + TODO: keep track when trx exactly has the latch locked!!! + TODO: trx->dict_operation tells it only in some cases!!! */ - rw_lock_s_lock(&dict_operation_lock); + if (!trx->dict_operation) { + rw_lock_s_lock(&dict_operation_lock); + } if (node->state == UNDO_NODE_INSERT) { @@ -267,7 +275,10 @@ row_undo( err = row_undo_mod(node, thr); } - rw_lock_s_unlock(&dict_operation_lock); + if (!trx->dict_operation) { + + rw_lock_s_unlock(&dict_operation_lock); + } /* Do some cleanup */ btr_pcur_close(&(node->pcur)); |