mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 22:12:30 +01:00
branches/zip: Remove an assertion failure when the InnoDB data dictionary
is inconsistent with the MySQL .frm file. ha_innobase::index_read(): When the index cannot be found, return an error. ha_innobase::change_active_index(): When prebuilt->index == NULL, set also prebuilt->index_usable = FALSE. This is not needed for correctness, because prebuilt->index_usable is only checked by row_search_for_mysql(), which requires prebuilt->index != NULL. This addresses Issue #349. Approved by Heikki Tuuri over IM.
This commit is contained in:
parent
6b711d0616
commit
cf0210a706
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2009-09-28 The InnoDB Team
|
||||
|
||||
* handler/ha_innodb.cc:
|
||||
When a secondary index exists in the MySQL .frm file but not in
|
||||
the InnoDB data dictionary, return an error instead of letting an
|
||||
assertion fail in index_read.
|
||||
|
||||
2009-09-28 The InnoDB Team
|
||||
|
||||
* btr/btr0btr.c, buf/buf0buf.c,
|
||||
|
|
|
@ -5060,6 +5060,11 @@ ha_innobase::index_read(
|
|||
|
||||
index = prebuilt->index;
|
||||
|
||||
if (UNIV_UNLIKELY(index == NULL)) {
|
||||
prebuilt->index_usable = FALSE;
|
||||
DBUG_RETURN(HA_ERR_CRASHED);
|
||||
}
|
||||
|
||||
/* Note that if the index for which the search template is built is not
|
||||
necessarily prebuilt->index, but can also be the clustered index */
|
||||
|
||||
|
@ -5219,6 +5224,7 @@ ha_innobase::change_active_index(
|
|||
if (UNIV_UNLIKELY(!prebuilt->index)) {
|
||||
sql_print_warning("InnoDB: change_active_index(%u) failed",
|
||||
keynr);
|
||||
prebuilt->index_usable = FALSE;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue