summaryrefslogtreecommitdiff
path: root/storage/innobase/trx/trx0roll.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-04-25 09:56:03 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-04-26 22:53:33 +0300
commitff0000cdd27af3cee56772f993b89b7ed98d222b (patch)
tree9c80c8a66d96d8fdca90a7062b82cedba9d8827a /storage/innobase/trx/trx0roll.cc
parentc121574dff27cb0de2a9ac77b5f5394c9be705f2 (diff)
downloadmariadb-git-ff0000cdd27af3cee56772f993b89b7ed98d222b.tar.gz
MDEV-15914: Remove trx_undo_t::empty
Use the value trx_undo_t::top_undo_no == IB_ID_MAX for indicating that an undo log is empty.
Diffstat (limited to 'storage/innobase/trx/trx0roll.cc')
-rw-r--r--storage/innobase/trx/trx0roll.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc
index 4e17586ee41..0200c7dded2 100644
--- a/storage/innobase/trx/trx0roll.cc
+++ b/storage/innobase/trx/trx0roll.cc
@@ -946,8 +946,8 @@ trx_roll_pop_top_rec(
true, mtr);
if (prev_rec == NULL) {
-
- undo->empty = TRUE;
+ undo->top_undo_no = IB_ID_MAX;
+ ut_ad(undo->empty());
} else {
page_t* prev_rec_page = page_align(prev_rec);
@@ -959,6 +959,7 @@ trx_roll_pop_top_rec(
undo->top_page_no = page_get_page_no(prev_rec_page);
undo->top_offset = prev_rec - prev_rec_page;
undo->top_undo_no = trx_undo_rec_get_undo_no(prev_rec);
+ ut_ad(!undo->empty());
}
return(undo_page + offset);
@@ -985,19 +986,19 @@ trx_roll_pop_top_rec_of_trx(trx_t* trx, roll_ptr_t* roll_ptr, mem_heap_t* heap)
trx_undo_t* temp = trx->rsegs.m_noredo.undo;
const undo_no_t limit = trx->roll_limit;
- ut_ad(!insert || !update || insert->empty || update->empty
+ ut_ad(!insert || !update || insert->empty() || update->empty()
|| insert->top_undo_no != update->top_undo_no);
- ut_ad(!insert || !temp || insert->empty || temp->empty
+ ut_ad(!insert || !temp || insert->empty() || temp->empty()
|| insert->top_undo_no != temp->top_undo_no);
- ut_ad(!update || !temp || update->empty || temp->empty
+ ut_ad(!update || !temp || update->empty() || temp->empty()
|| update->top_undo_no != temp->top_undo_no);
if (UNIV_LIKELY_NULL(insert)
- && !insert->empty && limit <= insert->top_undo_no) {
+ && !insert->empty() && limit <= insert->top_undo_no) {
undo = insert;
}
- if (update && !update->empty && update->top_undo_no >= limit) {
+ if (update && !update->empty() && update->top_undo_no >= limit) {
if (!undo) {
undo = update;
} else if (undo->top_undo_no < update->top_undo_no) {
@@ -1005,7 +1006,7 @@ trx_roll_pop_top_rec_of_trx(trx_t* trx, roll_ptr_t* roll_ptr, mem_heap_t* heap)
}
}
- if (temp && !temp->empty && temp->top_undo_no >= limit) {
+ if (temp && !temp->empty() && temp->top_undo_no >= limit) {
if (!undo) {
undo = temp;
} else if (undo->top_undo_no < temp->top_undo_no) {
@@ -1024,7 +1025,7 @@ trx_roll_pop_top_rec_of_trx(trx_t* trx, roll_ptr_t* roll_ptr, mem_heap_t* heap)
return(NULL);
}
- ut_ad(!undo->empty);
+ ut_ad(!undo->empty());
ut_ad(limit <= undo->top_undo_no);
*roll_ptr = trx_undo_build_roll_ptr(