mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
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:
parent
127664ebc6
commit
7d55225783
1 changed files with 15 additions and 3 deletions
|
@ -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. */
|
||||
|
|
Loading…
Reference in a new issue