From 7de5fd6d975a862b9d139d135f4661036a0dedd9 Mon Sep 17 00:00:00 2001 From: marko <> Date: Wed, 2 Nov 2005 07:51:47 +0000 Subject: [PATCH] branches/zip: Slightly improve error handling. --- btr/btr0cur.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/btr/btr0cur.c b/btr/btr0cur.c index d6215736e3e..0fcb22263b3 100644 --- a/btr/btr0cur.c +++ b/btr/btr0cur.c @@ -2303,12 +2303,15 @@ btr_cur_del_mark_set_clust_rec( rw_lock_x_lock(&btr_search_latch); } - btr_rec_set_deleted_flag(rec, page_zip, val); + if (!btr_rec_set_deleted_flag(rec, page_zip/* 5 bytes */, val)) { + /* page_zip_alloc() said there is enough space */ + ut_error; + } trx = thr_get_trx(thr); if (!(flags & BTR_KEEP_SYS_FLAG)) { - row_upd_rec_sys_fields(rec, page_zip, + row_upd_rec_sys_fields(rec, page_zip/* 21 bytes */, index, offsets, trx, roll_ptr); } @@ -2399,6 +2402,7 @@ btr_cur_parse_del_mark_set_sec_rec( if (!btr_rec_set_deleted_flag(rec, page_zip, val)) { /* page_zip overflow should have been detected before writing MLOG_COMP_REC_SEC_DELETE_MARK */ + ut_error; } } @@ -2451,7 +2455,14 @@ btr_cur_del_mark_set_sec_rec( } if (!btr_rec_set_deleted_flag(rec, page_zip, val)) { - ut_error; /* TODO */ + /* Reorganize to try to get more modification log space. */ + btr_page_reorganize(buf_block_get_frame(block), + cursor->index, mtr); + + if (!btr_rec_set_deleted_flag(rec, page_zip, val)) { + /* TODO: could we do anything else than crash? */ + ut_error; + } } if (block->is_hashed) { @@ -2474,9 +2485,11 @@ btr_cur_del_unmark_for_ibuf( mtr_t* mtr) /* in: mtr */ { /* We do not need to reserve btr_search_latch, as the page has just - been read to the buffer pool and there cannot be a hash index to it. */ + /* The insert buffer is not used on compressed pages. */ + ut_ad(!buf_block_get_page_zip(buf_block_align(rec))); + btr_rec_set_deleted_flag(rec, NULL, FALSE); btr_cur_del_mark_set_sec_rec_log(rec, FALSE, mtr);