mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
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
This commit is contained in:
parent
20a1226ca6
commit
5c4c294a42
2 changed files with 16 additions and 2 deletions
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue