Fix Bug #14753402 - FAILING ASSERTION: LEN == IFIELD->FIXED_LEN

rb://1411 approved by Marko
This commit is contained in:
Jimmy Yang 2012-11-14 17:00:41 +08:00
parent fcf17c39c3
commit 7a6479d18f
4 changed files with 49 additions and 3 deletions

View file

@ -0,0 +1,5 @@
CREATE TABLE bug14753402(a34 INT, col8953 NATIONAL CHAR(231) NOT NULL)
ENGINE=INNODB ROW_FORMAT=REDUNDANT;
INSERT INTO bug14753402 VALUES(1, 'aa');
CREATE INDEX idx1 ON bug14753402(col8953(165));
DROP TABLE bug14753402;

View file

@ -0,0 +1,13 @@
#
# Test Bug 14753402 - FAILING ASSERTION: LEN == IFIELD->FIXED_LEN
#
-- source include/have_innodb.inc
CREATE TABLE bug14753402(a34 INT, col8953 NATIONAL CHAR(231) NOT NULL)
ENGINE=INNODB ROW_FORMAT=REDUNDANT;
INSERT INTO bug14753402 VALUES(1, 'aa');
CREATE INDEX idx1 ON bug14753402(col8953(165));
DROP TABLE bug14753402;

View file

@ -819,10 +819,19 @@ rec_get_converted_size_comp_prefix(
it is 128 or more, or when the field is stored externally. */
if (field->fixed_len) {
ut_ad(len == field->fixed_len);
#ifdef UNIV_DEBUG
ulint mbminlen = DATA_MBMINLEN(col->mbminmaxlen);
ulint mbmaxlen = DATA_MBMAXLEN(col->mbminmaxlen);
ut_ad(len <= field->fixed_len);
ut_ad(!mbmaxlen || len >= mbminlen
* (field->fixed_len / mbmaxlen));
/* dict_index_add_col() should guarantee this */
ut_ad(!field->prefix_len
|| field->fixed_len == field->prefix_len);
#endif /* UNIV_DEBUG */
} else if (dfield_is_ext(&fields[i])) {
ut_ad(col->len >= 256 || col->mtype == DATA_BLOB);
extra_size += 2;
@ -1169,8 +1178,17 @@ rec_convert_dtuple_to_rec_comp(
0..127. The length will be encoded in two bytes when
it is 128 or more, or when the field is stored externally. */
if (fixed_len) {
ut_ad(len == fixed_len);
#ifdef UNIV_DEBUG
ulint mbminlen = DATA_MBMINLEN(
ifield->col->mbminmaxlen);
ulint mbmaxlen = DATA_MBMAXLEN(
ifield->col->mbminmaxlen);
ut_ad(len <= fixed_len);
ut_ad(!mbmaxlen || len >= mbminlen
* (fixed_len / mbmaxlen));
ut_ad(!dfield_is_ext(field));
#endif /* UNIV_DEBUG */
} else if (dfield_is_ext(field)) {
ut_ad(ifield->col->len >= 256
|| ifield->col->mtype == DATA_BLOB);

View file

@ -347,8 +347,18 @@ row_merge_buf_add(
ut_ad(len <= col->len || col->mtype == DATA_BLOB);
if (ifield->fixed_len) {
ut_ad(len == ifield->fixed_len);
#ifdef UNIV_DEBUG
ulint mbminlen = DATA_MBMINLEN(col->mbminmaxlen);
ulint mbmaxlen = DATA_MBMAXLEN(col->mbminmaxlen);
/* len should be between size calcualted base on
mbmaxlen and mbminlen */
ut_ad(len <= ifield->fixed_len);
ut_ad(!mbmaxlen || len >= mbminlen
* (ifield->fixed_len / mbmaxlen));
ut_ad(!dfield_is_ext(field));
#endif /* UNIV_DEBUG */
} else if (dfield_is_ext(field)) {
extra_size += 2;
} else if (len < 128