summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-08-28 02:00:46 +0300
committerunknown <heikki@hundin.mysql.fi>2003-08-28 02:00:46 +0300
commit235cb5ba3764dd8a39ba549fd589cb58913f37cf (patch)
tree2c5f6e29e82b4c221a7e38f7224f76ceb897005f /innobase
parent9d64b924c992ba06209350d4837ff3b7c2bc136e (diff)
downloadmariadb-git-235cb5ba3764dd8a39ba549fd589cb58913f37cf.tar.gz
btr0btr.c:
Fix bug: if the user created a prefix column key on a fixed length char column, then InnoDB claimed in CHECK TABLE that the table is corrupt dict0dict.c: Fix bug 1151: if the user created a prefix column primary key on a fixed length char column, then InnoDB crashed in a simple SELECT innobase/dict/dict0dict.c: Fix bug 1151: if the user created a prefix column primary key on a fixed length char column, then InnoDB crashed in a simple SELECT innobase/btr/btr0btr.c: Fix bug: if the user created a prefix column key on a fixed length char column, then InnoDB claimed in CHECK TABLE that the table is corrupt
Diffstat (limited to 'innobase')
-rw-r--r--innobase/btr/btr0btr.c11
-rw-r--r--innobase/dict/dict0dict.c7
2 files changed, 16 insertions, 2 deletions
diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c
index d8a0959e47f..1af9336ce72 100644
--- a/innobase/btr/btr0btr.c
+++ b/innobase/btr/btr0btr.c
@@ -2376,8 +2376,15 @@ btr_index_rec_validate(
type = dict_index_get_nth_type(index, i);
- if (len != UNIV_SQL_NULL && dtype_is_fixed_size(type)
- && len != dtype_get_fixed_size(type)) {
+ if ((dict_index_get_nth_field(index, i)->prefix_len == 0
+ && len != UNIV_SQL_NULL && dtype_is_fixed_size(type)
+ && len != dtype_get_fixed_size(type))
+ ||
+ (dict_index_get_nth_field(index, i)->prefix_len > 0
+ && len != UNIV_SQL_NULL && dtype_is_fixed_size(type)
+ && len !=
+ dict_index_get_nth_field(index, i)->prefix_len)) {
+
fprintf(stderr,
"InnoDB: Record in index %s in table %s, page %lu, at offset %lu\n"
"InnoDB: field %lu len is %lu, should be %lu\n",
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 924fa3ecf95..a576a886b97 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -1596,6 +1596,13 @@ dict_index_build_internal_clust(
break;
}
+ if (dict_index_get_nth_field(new_index, i)->prefix_len
+ > 0) {
+ new_index->trx_id_offset = 0;
+
+ break;
+ }
+
new_index->trx_id_offset += fixed_size;
}