mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
MDEV-19783 Random crashes and corrupt data in INSTANT-added columns
The bug affects MariaDB Server 10.3 or later, but it makes sense to improve CHECK TABLE in earlier versions already. page_validate(): Check REC_INFO_MIN_REC_FLAG in the records. This allows CHECK TABLE to catch more bugs.
This commit is contained in:
committed by
Marko Mäkelä
parent
d480d28f4f
commit
99dc40d6ac
@@ -2392,6 +2392,7 @@ page_validate(
|
||||
ulint data_size;
|
||||
const rec_t* rec;
|
||||
const rec_t* old_rec = NULL;
|
||||
const rec_t* first_rec = NULL;
|
||||
ulint offs;
|
||||
ulint n_slots;
|
||||
ibool ret = FALSE;
|
||||
@@ -2488,6 +2489,21 @@ page_validate(
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
if (rec == first_rec) {
|
||||
if ((rec_get_info_bits(rec, page_is_comp(page))
|
||||
& REC_INFO_MIN_REC_FLAG)
|
||||
&& page_is_leaf(page)) {
|
||||
ib::error() << "REC_INFO_MIN_REC_FLAG "
|
||||
"is set in a leaf-page record";
|
||||
ret = false;
|
||||
}
|
||||
} else if (rec_get_info_bits(rec, page_is_comp(page))
|
||||
& REC_INFO_MIN_REC_FLAG) {
|
||||
ib::error() << "REC_INFO_MIN_REC_FLAG record is not "
|
||||
"first in page";
|
||||
ret = false;
|
||||
}
|
||||
|
||||
/* Check that the records are in the ascending order */
|
||||
if (count >= PAGE_HEAP_NO_USER_LOW
|
||||
&& !page_rec_is_supremum(rec)) {
|
||||
@@ -2599,6 +2615,11 @@ page_validate(
|
||||
old_rec = rec;
|
||||
rec = page_rec_get_next_const(rec);
|
||||
|
||||
if (page_rec_is_infimum(old_rec)
|
||||
&& page_rec_is_user_rec(rec)) {
|
||||
first_rec = rec;
|
||||
}
|
||||
|
||||
/* set old_offsets to offsets; recycle offsets */
|
||||
{
|
||||
ulint* offs = old_offsets;
|
||||
|
||||
Reference in New Issue
Block a user