summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Yang <jimmy.yang@oracle.com>2010-05-28 06:17:37 -0700
committerJimmy Yang <jimmy.yang@oracle.com>2010-05-28 06:17:37 -0700
commitd02ec3463ee7adf16b807102b8300c735221285d (patch)
treefe009815e8efef437803d3326b711e622db43d36
parent6734ce935e0c7aad8122ecfb45cfc4ffde392648 (diff)
downloadmariadb-git-d02ec3463ee7adf16b807102b8300c735221285d.tar.gz
This is to fix a special case for the fix on bug #53592, where the
err_index could be not a member of the share structure or prebuilt structure passed from MySQL. For now, we resort to the traditional way of scanning index->table for the index number.
-rw-r--r--storage/innodb_plugin/handler/ha_innodb.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
index f753e2d1cbd..c65ba3163fc 100644
--- a/storage/innodb_plugin/handler/ha_innodb.cc
+++ b/storage/innodb_plugin/handler/ha_innodb.cc
@@ -7418,6 +7418,26 @@ innobase_get_mysql_key_number_for_index(
ut_ad(table);
ut_ad(share);
+ /* If index does not belong to the table of share structure. Search
+ index->table instead */
+ if (index->table != ib_table
+ && strcmp(index->table->name, share->table_name)) {
+ i = 0;
+ ind = dict_table_get_first_index(index->table);
+
+ while (index != ind) {
+ ind = dict_table_get_next_index(ind);
+ i++;
+ }
+
+ if (row_table_got_default_clust_index(index->table)) {
+ ut_a(i > 0);
+ i--;
+ }
+
+ return(i);
+ }
+
/* If index translation table exists, we will first check
the index through index translation table for a match. */
if (share->idx_trans_tbl.index_mapping) {