summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2003-01-16 08:06:43 +0200
committerheikki@hundin.mysql.fi <>2003-01-16 08:06:43 +0200
commit01573f0d95ecf1873772e62da65e94d34f325a26 (patch)
tree73df714541c2afb0f7fbc5add2d11c78fb788c9e /sql
parent0efc57eed6936c5336ac954a86715cc520b06bb2 (diff)
downloadmariadb-git-01573f0d95ecf1873772e62da65e94d34f325a26.tar.gz
ha_innodb.cc:
Backport from 4.1: make sure change_active_index is only called with a properly initialized InnoDB table handle
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innodb.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index b71b6e14ab9..f8321064683 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2460,6 +2460,9 @@ 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);
+
active_index = keynr;
if (keynr != MAX_KEY && table->keys > 0) {
@@ -2487,9 +2490,9 @@ ha_innobase::change_active_index(
/* Maybe MySQL changes the active index for a handle also
during some queries, we do not know: then it is safest to build
- the template such that all columns will be fetched */
+ the template such that all columns will be fetched. */
- build_template(prebuilt, user_thd, table, ROW_MYSQL_WHOLE_ROW);
+ build_template(prebuilt, NULL, table, ROW_MYSQL_WHOLE_ROW);
DBUG_RETURN(0);
}