From c5f5f7a6364c0908779a61e6fbbc0fe800c1cec2 Mon Sep 17 00:00:00 2001 From: marko Date: Mon, 14 Dec 2009 09:42:13 +0000 Subject: [PATCH] branches/innodb+: ibuf_insert_low(): Do not call page_update_max_trx_id() when buffering op == IBUF_OP_DELETE. This addresses Issue #319, an assertion failure because trx_id is zero in page_update_max_trx_id() when attempting to buffer a purge operation. (This was a harmless debug assertion failure, because page_update_max_trx_id() would never update to zero.) For the purge transaction, trx->id is always zero. The purge transaction is the only caller of IBUF_OP_DELETE, and PAGE_MAX_TRX_ID is really about existing records. Therefore, there is no need to update the PAGE_MAX_TRX_ID when purging records. --- ibuf/ibuf0ibuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ibuf/ibuf0ibuf.c b/ibuf/ibuf0ibuf.c index 9295cc4f5ef..b44484fe48a 100644 --- a/ibuf/ibuf0ibuf.c +++ b/ibuf/ibuf0ibuf.c @@ -3467,7 +3467,7 @@ bitmap_fail: err = btr_cur_optimistic_insert(BTR_NO_LOCKING_FLAG, cursor, ibuf_entry, &ins_rec, &dummy_big_rec, 0, thr, &mtr); - if (err == DB_SUCCESS) { + if (err == DB_SUCCESS && op != IBUF_OP_DELETE) { /* Update the page max trx id field */ page_update_max_trx_id(btr_cur_get_block(cursor), NULL, thr_get_trx(thr)->id, &mtr); @@ -3487,7 +3487,7 @@ bitmap_fail: cursor, ibuf_entry, &ins_rec, &dummy_big_rec, 0, thr, &mtr); - if (err == DB_SUCCESS) { + if (err == DB_SUCCESS && op != IBUF_OP_DELETE) { /* Update the page max trx id field */ page_update_max_trx_id(btr_cur_get_block(cursor), NULL, thr_get_trx(thr)->id, &mtr);