From 63a656c55c20773fb6e0923ddacb00bbb038e804 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Mon, 13 Jan 2003 23:25:55 +0200 Subject: [PATCH] ha_innodb.cc: Added some assertions to make sure index_init is only called with a properly prepared InnoDB table handle --- sql/ha_innodb.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index cfec8282e42..cb012d33572 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1600,6 +1600,8 @@ build_template( ibool fetch_all_in_key = FALSE; ulint i; + ut_a(templ_type != ROW_MYSQL_REC_FIELDS || thd == current_thd); + clust_index = dict_table_get_first_index_noninline(prebuilt->table); if (!prebuilt->hint_no_need_to_fetch_extra_cols) { @@ -2466,7 +2468,9 @@ ha_innobase::index_read_last( } /************************************************************************ -Changes the active index of a handle. */ +Changes the active index of a handle. Note that since we build also the +template for a search, update_thd() must already have been called, in +::external_lock, for example. */ int ha_innobase::change_active_index( @@ -2481,6 +2485,10 @@ ha_innobase::change_active_index( statistic_increment(ha_read_key_count, &LOCK_status); DBUG_ENTER("change_active_index"); + ut_a(prebuilt->trx == + (trx_t*) current_thd->transaction.all.innobase_tid); + ut_a(user_thd == current_thd); + active_index = keynr; if (keynr != MAX_KEY && table->keys > 0) {