summaryrefslogtreecommitdiff
path: root/innobase/dict
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-12-11 13:32:31 +0200
committerunknown <monty@mashka.mysql.fi>2002-12-11 13:32:31 +0200
commit3c9b877b19bd4eaa4734ea5d699add9ca70a4e53 (patch)
tree13f329218555066905528ead26fa433e37531ab1 /innobase/dict
parent3bbf4e9701699de6b129743321ad9fb3d6a61175 (diff)
parent49162e0e54c085ecefb6893a5bd662e4f7b2f56a (diff)
downloadmariadb-git-3c9b877b19bd4eaa4734ea5d699add9ca70a4e53.tar.gz
Merge with 3.23
innobase/dict/dict0dict.c: Auto merged libmysql/libmysql.c: Auto merged scripts/make_binary_distribution.sh: Auto merged sql/mysqld.cc: Auto merged sql/sql_udf.cc: Auto merged sql/ha_innodb.cc: Auto merged innobase/include/db0err.h: Skiped merge (Heikki wants to do this) innobase/row/row0mysql.c: Skiped merge (Heikki wants to do this) sql/sql_show.cc: Use local code
Diffstat (limited to 'innobase/dict')
-rw-r--r--innobase/dict/dict0dict.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 18f27602cf0..563ca2521a4 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -1113,6 +1113,7 @@ dict_index_add_to_cache(
ulint n_ord;
ibool success;
ulint i;
+ ulint j;
ut_ad(index);
ut_ad(mutex_own(&(dict_sys->mutex)));
@@ -1143,6 +1144,26 @@ dict_index_add_to_cache(
return(FALSE);
}
+ /* Check that the same column does not appear twice in the index.
+ InnoDB assumes this in its algorithms, e.g., update of an index
+ entry */
+
+ for (i = 0; i < dict_index_get_n_fields(index); i++) {
+
+ for (j = 0; j < i; j++) {
+ if (dict_index_get_nth_field(index, j)->col
+ == dict_index_get_nth_field(index, i)->col) {
+
+ fprintf(stderr,
+"InnoDB: Error: column %s appears twice in index %s of table %s\n"
+"InnoDB: This is not allowed in InnoDB.\n"
+"InnoDB: UPDATE can cause such an index to become corrupt in InnoDB.\n",
+ dict_index_get_nth_field(index, i)->col->name,
+ index->name, table->name);
+ }
+ }
+ }
+
/* Build the cache internal representation of the index,
containing also the added system fields */