Commit a930c0aa authored by Shaohua Wang's avatar Shaohua Wang Committed by Marko Mäkelä

BUG#23760086 INNODB: ASSERTION FAILURE: MACH0DATA.IC:56:(N | 0XFFFFUL) <= 0XFFFFUL

Analysis: In row_log_table_delete(), extern size could be greater
than 2 bytes int if there are enough index on blob columns.

Solution: Use 4 bytes int other than 2 bytes for extern size.
Reviewed-by: default avatarMarko Mäkelä <marko.makela@oracle.com>
RB: 13573
parent d3a2f60e
...@@ -649,7 +649,7 @@ row_log_table_delete( ...@@ -649,7 +649,7 @@ row_log_table_delete(
&old_pk_extra_size); &old_pk_extra_size);
ut_ad(old_pk_extra_size < 0x100); ut_ad(old_pk_extra_size < 0x100);
mrec_size = 4 + old_pk_size; mrec_size = 6 + old_pk_size;
/* Log enough prefix of the BLOB unless both the /* Log enough prefix of the BLOB unless both the
old and new table are in COMPACT or REDUNDANT format, old and new table are in COMPACT or REDUNDANT format,
...@@ -686,8 +686,8 @@ row_log_table_delete( ...@@ -686,8 +686,8 @@ row_log_table_delete(
*b++ = static_cast<byte>(old_pk_extra_size); *b++ = static_cast<byte>(old_pk_extra_size);
/* Log the size of external prefix we saved */ /* Log the size of external prefix we saved */
mach_write_to_2(b, ext_size); mach_write_to_4(b, ext_size);
b += 2; b += 4;
rec_convert_dtuple_to_temp( rec_convert_dtuple_to_temp(
b + old_pk_extra_size, new_index, b + old_pk_extra_size, new_index,
...@@ -2441,14 +2441,14 @@ row_log_table_apply_op( ...@@ -2441,14 +2441,14 @@ row_log_table_apply_op(
break; break;
case ROW_T_DELETE: case ROW_T_DELETE:
/* 1 (extra_size) + 2 (ext_size) + at least 1 (payload) */ /* 1 (extra_size) + 4 (ext_size) + at least 1 (payload) */
if (mrec + 4 >= mrec_end) { if (mrec + 6 >= mrec_end) {
return(NULL); return(NULL);
} }
extra_size = *mrec++; extra_size = *mrec++;
ext_size = mach_read_from_2(mrec); ext_size = mach_read_from_4(mrec);
mrec += 2; mrec += 4;
ut_ad(mrec < mrec_end); ut_ad(mrec < mrec_end);
/* We assume extra_size < 0x100 for the PRIMARY KEY prefix. /* We assume extra_size < 0x100 for the PRIMARY KEY prefix.
...@@ -2459,6 +2459,10 @@ row_log_table_apply_op( ...@@ -2459,6 +2459,10 @@ row_log_table_apply_op(
rec_init_offsets_temp(mrec, new_index, offsets); rec_init_offsets_temp(mrec, new_index, offsets);
next_mrec = mrec + rec_offs_data_size(offsets) + ext_size; next_mrec = mrec + rec_offs_data_size(offsets) + ext_size;
if (log->table->n_v_cols) { if (log->table->n_v_cols) {
if (next_mrec + 2 >= mrec_end) {
return(NULL);
}
next_mrec += mach_read_from_2(next_mrec); next_mrec += mach_read_from_2(next_mrec);
} }
......
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