diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-08-17 09:17:39 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-08-17 09:17:39 -0400 |
commit | 7f1955305e76ae9d3d61d51727cfac6abc638eee (patch) | |
tree | 1a15585005a78ec9c4c35b8bb90af3a366e234a4 | |
parent | 94982c9e6e9b040a14de148c7db35892e3ef6789 (diff) | |
download | mongo-7f1955305e76ae9d3d61d51727cfac6abc638eee.tar.gz |
Panic if "impossible" cases occur during the merge.
-rw-r--r-- | src/btree/bt_slvg.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/btree/bt_slvg.c b/src/btree/bt_slvg.c index 730ac16c67b..985a5298702 100644 --- a/src/btree/bt_slvg.c +++ b/src/btree/bt_slvg.c @@ -834,6 +834,11 @@ __slvg_col_range_overlap( * Finally, there's one additional complicating factor -- final ranges * are assigned based on the page's LSN. */ + /* Case #2/8, #10, #11 */ + if (a_trk->col_start > b_trk->col_start) + WT_PANIC_RET( + session, EINVAL, "unexpected merge array sort order"); + if (a_trk->col_start == b_trk->col_start) { /* Case #1, #4 and #9 */ /* * The secondary sort of the leaf page array was the page's LSN, @@ -1401,6 +1406,11 @@ __slvg_row_range_overlap( session, btree->collator, A_TRK_START, B_TRK_START, &start_cmp)); WT_RET(__wt_compare( session, btree->collator, A_TRK_STOP, B_TRK_STOP, &stop_cmp)); + + if (start_cmp > 0) /* Case #2/8, #10, #11 */ + WT_PANIC_RET( + session, EINVAL, "unexpected merge array sort order"); + if (start_cmp == 0) { /* Case #1, #4, #9 */ /* * The secondary sort of the leaf page array was the page's LSN, |