MDEV-21899 INSERT into a secondary index with zero-data-length key is not crash-safe
page_cur_insert_rec_low(): Remove a bogus condition that wrongly omitted redo logging when the record contains no data payload bytes. We can have such records in secondary indexes, when the values of the PRIMARY KEY column(s) are the empty string, and the values of secondary key column(s) are are NULL or the empty string. page_apply_delete_dynamic(): Improve the consistency check, and do not allow adjacent records to be less than 5 bytes apart from each other. The fixed-size part of the record header is 5 bytes. Usually there must also be some header or payload bytes, but in an extreme case where all columns are CHAR(0) NOT NULL, the minimum secondary index record size is 5 bytes, and the table can contain at most 1 row. The minimum clustered index record size is 5+6+7 bytes (header, DB_TRX_ID, DB_ROLL_PTR) or x+5+4 bytes (fixed-size header, child page number, and some additional header or payload bytes).
Showing
Please register or sign in to comment