summaryrefslogtreecommitdiff
path: root/innobase/pars
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-09-16 20:50:24 +0300
committerunknown <heikki@hundin.mysql.fi>2004-09-16 20:50:24 +0300
commitcac596f91d8e47eafac45adaba19bd7a49a20d3e (patch)
tree4af62c5047a3c9d07dd0bae6236b6e6677cb207c /innobase/pars
parent9928f51a93f100b08313b781561725b80bccc1bc (diff)
downloadmariadb-git-cac596f91d8e47eafac45adaba19bd7a49a20d3e.tar.gz
dict0dict.h, dict0dict.c, row0row.c, pars0opt.c:
Fix bug #5180: having a column prefix index in the primary key, and the same column fully in a secondary key could cause an assertion failure in row_build_row_ref() innobase/pars/pars0opt.c: Fix bug #5180: having a column prefix index in the primary key, and the same column fully in a secondary key could cause an assertion failure in row_build_row_ref() innobase/row/row0row.c: Fix bug #5180: having a column prefix index in the primary key, and the same column fully in a secondary key could cause an assertion failure in row_build_row_ref() innobase/dict/dict0dict.c: Fix bug #5180: having a column prefix index in the primary key, and the same column fully in a secondary key could cause an assertion failure in row_build_row_ref() innobase/include/dict0dict.h: Fix bug #5180: having a column prefix index in the primary key, and the same column fully in a secondary key could cause an assertion failure in row_build_row_ref()
Diffstat (limited to 'innobase/pars')
-rw-r--r--innobase/pars/pars0opt.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/innobase/pars/pars0opt.c b/innobase/pars/pars0opt.c
index 5cc2e39b438..51aaf02b736 100644
--- a/innobase/pars/pars0opt.c
+++ b/innobase/pars/pars0opt.c
@@ -1094,6 +1094,19 @@ opt_clust_access(
for (i = 0; i < n_fields; i++) {
pos = dict_index_get_nth_field_pos(index, clust_index, i);
+ ut_a(pos != ULINT_UNDEFINED);
+
+ /* We optimize here only queries to InnoDB's internal system
+ tables, and they should not contain column prefix indexes. */
+
+ if (dict_index_get_nth_field(index, pos)->prefix_len != 0
+ || dict_index_get_nth_field(clust_index, i)
+ ->prefix_len != 0) {
+ fprintf(stderr,
+"InnoDB: Error in pars0opt.c: table %s has prefix_len != 0\n",
+ index->table_name);
+ }
+
*(plan->clust_map + i) = pos;
ut_ad((pos != ULINT_UNDEFINED)