MDEV-31537 Bulk insert operation aborts the server for redundant table

- InnoDB bulk insert operation aborts the server for redundant
table. InnoDB miscalculates the record size in temporary file
for the redundant table. CHAR in redundant row format table
always fixed length, but in temporary file, it is variable-length
for variable-length character sets.
parent eb6b521f
......@@ -460,3 +460,10 @@ ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
COMMIT;
DROP TABLE t1;
# End of 10.8 tests
#
# MDEV-31537 Bulk insert operation aborts the server
# for redundant table
#
CREATE TABLE t (a CHAR CHARACTER SET utf8) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT t SELECT left(seq,1) FROM seq_1_to_43691;
DROP TABLE t;
......@@ -479,3 +479,11 @@ INSERT INTO t1 VALUES
COMMIT;
DROP TABLE t1;
--echo # End of 10.8 tests
--echo #
--echo # MDEV-31537 Bulk insert operation aborts the server
--echo # for redundant table
--echo #
CREATE TABLE t (a CHAR CHARACTER SET utf8) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT t SELECT left(seq,1) FROM seq_1_to_43691;
DROP TABLE t;
......@@ -479,6 +479,13 @@ static ulint row_merge_bulk_buf_add(row_merge_buf_t* buf,
ulint fixed_len= ifield->fixed_len;
/* CHAR in ROW_FORMAT=REDUNDANT is always
fixed-length, but in the temporary file it is
variable-length for variable-length character sets. */
if (fixed_len && !index->table->not_redundant() &&
col->mbminlen != col->mbmaxlen)
fixed_len= 0;
if (fixed_len);
else if (len < 128 || (!DATA_BIG_COL(col)))
extra_size++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment