summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2019-06-13 17:54:28 +0300
committerMichael Widenius <monty@mariadb.org>2019-06-25 12:07:50 +0300
commit793e5be7707fac95cb71f9c1e74d97424eeef09d (patch)
tree54b63d46b2ebff1d764ce6e3d1ad2b8769838d87
parent204434f2d08fa7b1bcb748b2a07ab76d9ad0ae31 (diff)
downloadmariadb-git-793e5be7707fac95cb71f9c1e74d97424eeef09d.tar.gz
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.
-rw-r--r--storage/maria/ma_loghandler.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index 03faadbb42a..beda5f46ff4 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -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;