summaryrefslogtreecommitdiff
path: root/storage/maria/ma_blockrec.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/maria/ma_blockrec.c')
-rw-r--r--storage/maria/ma_blockrec.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index 05040d962eb..baa777edcf0 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -921,7 +921,7 @@ static my_bool extend_area_on_page(MARIA_HA *info,
DBUG_PRINT("error", ("Not enough space: "
"length: %u request_length: %u",
length, request_length));
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_RETURN(1); /* Error in block */
}
*empty_space= length; /* All space is here */
@@ -1788,7 +1788,10 @@ static my_bool get_head_or_tail_page(MARIA_HA *info,
page_link.changed= res->buff != 0;
push_dynamic(&info->pinned_pages, (void*) &page_link);
if (!page_link.changed)
- goto crashed;
+ {
+ _ma_set_fatal_error(info, my_errno);
+ DBUG_RETURN(1);
+ }
DBUG_ASSERT((uint) (res->buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) ==
page_type);
@@ -1826,7 +1829,7 @@ static my_bool get_head_or_tail_page(MARIA_HA *info,
crashed:
DBUG_ASSERT(!maria_assert_if_crashed_table);
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD); /* File crashed */
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD); /* File crashed */
DBUG_RETURN(1);
}
@@ -1884,7 +1887,10 @@ static my_bool get_rowpos_in_head_or_tail_page(MARIA_HA *info,
page_link.changed= buff != 0;
push_dynamic(&info->pinned_pages, (void*) &page_link);
if (!page_link.changed) /* Read error */
- goto err;
+ {
+ _ma_set_fatal_error(info, my_errno);
+ DBUG_RETURN(1);
+ }
DBUG_ASSERT((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) ==
(uchar) page_type);
if ((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) != (uchar) page_type)
@@ -1921,7 +1927,7 @@ static my_bool get_rowpos_in_head_or_tail_page(MARIA_HA *info,
err:
DBUG_ASSERT(!maria_assert_if_crashed_table);
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD); /* File crashed */
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD); /* File crashed */
DBUG_RETURN(1);
}
@@ -2146,7 +2152,7 @@ static my_bool write_full_pages(MARIA_HA *info,
{
if (!--sub_blocks)
{
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_RETURN(1);
}
@@ -3475,7 +3481,7 @@ static my_bool write_block_record(MARIA_HA *info,
crashed:
DBUG_ASSERT(!maria_assert_if_crashed_table);
/* Something was wrong with data on page */
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
disk_err:
/**
@@ -3759,7 +3765,10 @@ static my_bool _ma_update_block_record2(MARIA_HA *info,
page_link.changed= buff != 0;
push_dynamic(&info->pinned_pages, (void*) &page_link);
if (!buff)
+ {
+ _ma_set_fatal_error(info, my_errno);
goto err;
+ }
org_empty_size= uint2korr(buff + EMPTY_SPACE_OFFSET);
rownr= ma_recordpos_to_dir_entry(record_pos);
@@ -3947,7 +3956,10 @@ static my_bool _ma_update_at_original_place(MARIA_HA *info,
page_link.changed= buff != 0;
push_dynamic(&info->pinned_pages, (void*) &page_link);
if (!buff)
+ {
+ _ma_set_fatal_error(info, my_errno);
goto err;
+ }
org_empty_size= uint2korr(buff + EMPTY_SPACE_OFFSET);
dir= dir_entry_pos(buff, block_size, rownr);
@@ -3958,7 +3970,7 @@ static my_bool _ma_update_at_original_place(MARIA_HA *info,
("org_empty_size: %u head_length: %u length_on_page: %u",
org_empty_size, (uint) cur_row->head_length,
length_on_head_page));
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
goto err;
}
@@ -4200,7 +4212,10 @@ static my_bool delete_head_or_tail(MARIA_HA *info,
page_link.changed= buff != 0;
push_dynamic(&info->pinned_pages, (void*) &page_link);
if (!buff)
+ {
+ _ma_set_fatal_error(info, my_errno);
DBUG_RETURN(1);
+ }
DBUG_ASSERT((buff[PAGE_TYPE_OFFSET] & PAGE_TYPE_MASK) ==
(head ? HEAD_PAGE : TAIL_PAGE));
@@ -4608,7 +4623,7 @@ static uchar *read_next_extent(MARIA_HA *info, MARIA_EXTENT_CURSOR *extent,
crashed:
DBUG_ASSERT(!maria_assert_if_crashed_table);
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_PRINT("error", ("wrong extent information"));
DBUG_RETURN(0);
}
@@ -4754,7 +4769,7 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
{
/* File crashed */
DBUG_ASSERT(!maria_assert_if_crashed_table);
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_RETURN(HA_ERR_WRONG_IN_RECORD);
}
if (!trnman_can_read_from(info->trn, cur_row->trid))
@@ -5042,7 +5057,7 @@ err:
DBUG_ASSERT(!maria_assert_if_crashed_table);
/* Something was wrong with data on record */
DBUG_PRINT("error", ("Found record with wrong data"));
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_RETURN(HA_ERR_WRONG_IN_RECORD);
}
@@ -5554,7 +5569,7 @@ restart_bitmap_scan:
(uint) (uchar) info->scan.page_buff[DIR_COUNT_OFFSET]) == 0)
{
DBUG_PRINT("error", ("Wrong page header"));
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_RETURN(HA_ERR_WRONG_IN_RECORD);
}
DBUG_PRINT("info", ("Page %lu has %u rows",
@@ -5601,7 +5616,7 @@ restart_bitmap_scan:
err:
DBUG_ASSERT(!maria_assert_if_crashed_table);
DBUG_PRINT("error", ("Wrong data on page"));
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
DBUG_RETURN(HA_ERR_WRONG_IN_RECORD);
}
@@ -6523,7 +6538,7 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
DBUG_RETURN(result);
crashed_file:
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
err:
error= my_errno;
if (lock_method == PAGECACHE_LOCK_LEFT_WRITELOCKED)
@@ -6611,7 +6626,7 @@ uint _ma_apply_redo_purge_row_head_or_tail(MARIA_HA *info, LSN lsn,
if (delete_dir_entry(share, buff, rownr, &empty_space) < 0)
{
- _ma_set_fatal_error(share, HA_ERR_WRONG_IN_RECORD);
+ _ma_set_fatal_error(info, HA_ERR_WRONG_IN_RECORD);
goto err;
}