Commit b3b01c1c authored by marko's avatar marko

branches/zip: ha_innobase::add_index(): Split some assertions.

Remove the variable parent_trx.

Call innobase_register_stmt() in order to work around a MySQL bug
in mysql_alter_table(), which, as of

ChangeSet@1.2482.61.2, 2007-06-07 16:37:15+02:00, joerg@trift2. +8 -0

commits the transaction before calling ha_innobase::add_index().
Without re-registering the statement, the ha_commit_stmt(thd)
in mysql_alter_table() would not invoke innobase_commit.
parent 73feaa11
......@@ -8117,7 +8117,6 @@ ha_innobase::add_index(
merge_index_def_t* index_defs; /* Index definitions */
mem_heap_t* heap; /* Heap for index definitions */
trx_t* trx; /* Transaction */
trx_t* parent_trx;
ulint num_of_idx;
ulint num_created;
ibool dict_locked = FALSE;
......@@ -8126,20 +8125,21 @@ ha_innobase::add_index(
ulint error;
DBUG_ENTER("ha_innobase::add_index");
ut_a(table && key_info && num_of_keys);
ut_a(table);
ut_a(key_info);
ut_a(num_of_keys);
update_thd(ha_thd());
heap = mem_heap_create_noninline(1024);
parent_trx = check_trx_exists(user_thd);
trx_search_latch_release_if_reserved(parent_trx);
trx = parent_trx;
ut_a(trx);
trx = check_trx_exists(user_thd);
trx_search_latch_release_if_reserved(trx);
trx_start_if_not_started_noninline(trx);
innobase_register_stmt(ht, user_thd);
trx->mysql_thd = user_thd;
trx->mysql_query_str = thd_query(user_thd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment