summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2010-06-22 15:05:33 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2010-06-22 15:05:33 +0300
commitf776568e32c6180fe9f895b68029eb6ab2e33c10 (patch)
treeafac634be1553d4e098d7b91012c5f80560107eb /storage
parent3ba73a2173fb59e3bcc2b1e231d68e53545b3a2b (diff)
downloadmariadb-git-f776568e32c6180fe9f895b68029eb6ab2e33c10.tar.gz
Merge Bug#54686 fix from mysql-5.1-innodb:
------------------------------------------------------------ revno: 3517 revision-id: marko.makela@oracle.com-20100622115215-kxtzx7xuugcxd375 parent: marko.makela@oracle.com-20100621095148-8g73k8k68dpj080u committer: Marko Mäkelä <marko.makela@oracle.com> branch nick: 5.1-innodb timestamp: Tue 2010-06-22 14:52:15 +0300 message: Bug#54686 "field->col->mtype == type" assertion error at row/row0sel.c ha_innobase::index_read(), ha_innobase::records_in_range(): Check that the index is useable before invoking row_sel_convert_mysql_key_to_innobase(). This fix is based on a suggestion by Yasufumi Kinoshita.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 675edc61ac7..bc8ab206711 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -5568,6 +5568,9 @@ ha_innobase::index_read(
prebuilt->index_usable = FALSE;
DBUG_RETURN(HA_ERR_CRASHED);
}
+ if (UNIV_UNLIKELY(!prebuilt->index_usable)) {
+ DBUG_RETURN(HA_ERR_TABLE_DEF_CHANGED);
+ }
/* Note that if the index for which the search template is built is not
necessarily prebuilt->index, but can also be the clustered index */
@@ -7410,6 +7413,10 @@ ha_innobase::records_in_range(
n_rows = HA_POS_ERROR;
goto func_exit;
}
+ if (UNIV_UNLIKELY(!row_merge_is_index_usable(prebuilt->trx, index))) {
+ n_rows = HA_ERR_TABLE_DEF_CHANGED;
+ goto func_exit;
+ }
heap = mem_heap_create(2 * (key->key_parts * sizeof(dfield_t)
+ sizeof(dtuple_t)));