summaryrefslogtreecommitdiff
path: root/storage/maria/ma_dynrec.c
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2022-06-06 15:22:24 +0300
committerSergei Petrunia <sergey@mariadb.com>2022-06-07 20:43:11 +0300
commit3d241eb948855dbe0688a04c8111cc78deac3c1c (patch)
treefb4419ec163dffd9780afef2c5083a988d94b91f /storage/maria/ma_dynrec.c
parent1de18a836f1abbe76632337f9296f402bbdf4cfc (diff)
downloadmariadb-git-3d241eb948855dbe0688a04c8111cc78deac3c1c.tar.gz
Improve error reporting in Aria
This patch fixes the following issues in Aria error reporting in case of read errors & crashed tables: - Added the table name to the most error messages, including in case of read errors or when encrypting/decrypting a table. The format for error messages was changed sligtly to accomodate logging of errors from lower level routines. - If we got an read error from storage (hard disk, ssd, S3 etc) we only reported 'table is crashed'. Now the error number from the storage is reported. - Added checking of read failure from records_in_range() - Calls to ma_set_fatal_error() did not inform the SQL level of errors (to not spam the user with multiple error messages). Now the first error message and any fatal error messages are reported to the user.
Diffstat (limited to 'storage/maria/ma_dynrec.c')
-rw-r--r--storage/maria/ma_dynrec.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c
index 7bd85ae5fd1..33f238d9754 100644
--- a/storage/maria/ma_dynrec.c
+++ b/storage/maria/ma_dynrec.c
@@ -415,7 +415,7 @@ static int _ma_find_writepos(MARIA_HA *info,
BLOCK_DELETED))
{
DBUG_PRINT("error",("Delete link crashed"));
- _ma_set_fatal_error(info->s, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error_with_share(info->s, HA_ERR_WRONG_IN_RECORD);
DBUG_RETURN(-1);
}
info->s->state.dellink=block_info.next_filepos;
@@ -544,7 +544,7 @@ static my_bool update_backward_delete_link(MARIA_HA *info,
}
else
{
- _ma_set_fatal_error(info->s, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_RETURN(1); /* Wrong delete link */
}
}
@@ -577,7 +577,7 @@ static my_bool delete_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS filepos,
(length=(uint) (block_info.filepos-filepos) +block_info.block_len) <
MARIA_MIN_BLOCK_LENGTH)
{
- _ma_set_fatal_error(info->s, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_RETURN(1);
}
/* Check if next block is a delete block */
@@ -863,7 +863,7 @@ static my_bool update_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS filepos,
{
DBUG_PRINT("error",("Got wrong block info"));
if (!(error & BLOCK_FATAL_ERROR))
- _ma_set_fatal_error(info->s, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
goto err;
}
length=(ulong) (block_info.filepos-filepos) + block_info.block_len;
@@ -1381,7 +1381,7 @@ size_t _ma_rec_unpack(register MARIA_HA *info, register uchar *to, uchar *from,
DBUG_RETURN(found_length);
err:
- _ma_set_fatal_error(info->s, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_PRINT("error",("to_end: %p -> %p from_end: %p -> %p",
to, to_end, from, from_end));
DBUG_DUMP("from", info->rec_buff, info->s->base.min_pack_length);
@@ -1580,7 +1580,7 @@ err:
DBUG_RETURN(my_errno);
panic:
- _ma_set_fatal_error(info->s, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
goto err;
}
@@ -1686,7 +1686,7 @@ my_bool _ma_cmp_dynamic_record(register MARIA_HA *info,
}
} else if (reclength < block_info.data_len)
{
- _ma_set_fatal_error(info->s, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
goto err;
}
reclength-= block_info.data_len;
@@ -1925,7 +1925,7 @@ int _ma_read_rnd_dynamic_record(MARIA_HA *info,
if (my_errno == HA_ERR_FILE_TOO_SHORT)
{
/* Unexpected end of file */
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
}
goto err;
}
@@ -1954,7 +1954,7 @@ int _ma_read_rnd_dynamic_record(MARIA_HA *info,
panic:
/* Something is fatal wrong */
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
err:
fast_ma_writeinfo(info);
DBUG_RETURN(my_errno);
@@ -2103,7 +2103,7 @@ err:
if (!handler->in_check_table)
{
/* We may be scanning the table for new rows; Don't give an error */
- _ma_set_fatal_error(handler->s, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(handler, HA_ERR_WRONG_IN_RECORD);
}
return BLOCK_ERROR;
}