From 3bc2b8f1589c44d5c12784b67df2b232f9529735 Mon Sep 17 00:00:00 2001 From: marko <> Date: Mon, 29 Jun 2009 07:52:30 +0000 Subject: [PATCH] branches/zip: ha_innobase::add_index(), ha_innobase::final_drop_index(): Start prebuilt->trx before locking the table. This should fix Issue #293 and could fix Issue #229. Approved by Sunny (over IM). --- ChangeLog | 7 +++++++ handler/handler0alter.cc | 2 ++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 98b6d832117..90bb25210f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-29 The InnoDB Team + + * handler/handler0alter.cc: + Start the user transaction prebuilt->trx if it was not started + before adding or dropping an index. Without this fix, the + table could be locked outside an active transaction. + 2009-06-25 The InnoDB Team * handler/ha_innodb.cc, diff --git a/handler/handler0alter.cc b/handler/handler0alter.cc index a5b6d9e41f1..12f6099eeb3 100644 --- a/handler/handler0alter.cc +++ b/handler/handler0alter.cc @@ -647,6 +647,7 @@ ha_innobase::add_index( /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads. */ trx_search_latch_release_if_reserved(prebuilt->trx); + trx_start_if_not_started(prebuilt->trx); /* Create a background transaction for the operations on the data dictionary tables. */ @@ -1136,6 +1137,7 @@ ha_innobase::final_drop_index( update_thd(); trx_search_latch_release_if_reserved(prebuilt->trx); + trx_start_if_not_started(prebuilt->trx); /* Create a background transaction for the operations on the data dictionary tables. */