Commit 793e5be7 authored by Michael Widenius's avatar Michael Widenius

Give a readable error if aria_log page numbers doesn't match

MDEV-18461 Aria crash recovery failures

This does not fix the bug reported in the MDEV, but
now we get an error message of the problem instead of
an assert.
parent 204434f2
......@@ -3856,7 +3856,14 @@ my_bool translog_init_with_table(const char *directory,
my_bool pageok;
DBUG_PRINT("info", ("The log is really present"));
DBUG_ASSERT(sure_page <= last_page);
if (sure_page > last_page)
{
my_printf_error(HA_ERR_GENERIC, "Aria engine: log data error\n"
"last_log_page: " LSN_FMT " is less than\n"
"checkpoint page: " LSN_FMT, MYF(0),
LSN_IN_PARTS(last_page), LSN_IN_PARTS(sure_page));
goto err;
}
/* TODO: check page size */
......@@ -4004,7 +4011,7 @@ my_bool translog_init_with_table(const char *directory,
if (!logs_found)
{
TRANSLOG_FILE *file= (TRANSLOG_FILE*)my_malloc(sizeof(TRANSLOG_FILE),
MYF(0));
MYF(MY_WME));
DBUG_PRINT("info", ("The log is not found => we will create new log"));
if (file == NULL)
goto err;
......
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