branches/innodb+: btr_cur_search_to_nth_level(): Check for

BTR_INSERT, BTR_DELETE, and BTR_DELETE_MARK in a single switch,
and assert that at most one is specified at a time.
This commit is contained in:
marko 2008-12-12 10:08:00 +00:00
parent 127664ebc6
commit 7d55225783

View file

@ -360,12 +360,24 @@ btr_cur_search_to_nth_level(
/* These flags are mutually exclusive, they are lumped together
with the latch mode for historical reasons. It's possible for
none of the flags to be set. */
if (latch_mode & BTR_INSERT) {
switch (UNIV_EXPECT(latch_mode
& (BTR_INSERT | BTR_DELETE | BTR_DELETE_MARK),
0)) {
case 0:
break;
case BTR_INSERT:
btr_op = BTR_INSERT_OP;
} else if (latch_mode & BTR_DELETE) {
break;
case BTR_DELETE:
btr_op = BTR_DELETE_OP;
} else if (latch_mode & BTR_DELETE_MARK) {
break;
case BTR_DELETE_MARK:
btr_op = BTR_DELMARK_OP;
break;
default:
/* only one of BTR_INSERT, BTR_DELETE, BTR_DELETE_MARK
should be specified at a time */
ut_error;
}
/* Operations on the insert buffer tree cannot be buffered. */