mdbx: extend CHECK_LEAF_TYPE() by adding CC_OVERFLOW.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2022-07-04 21:22:39 +03:00
parent 498514dae1
commit ca3f188370
2 changed files with 4 additions and 3 deletions

View File

@ -16899,7 +16899,7 @@ static __inline int mdbx_couple_init(MDBX_cursor_couple *couple,
couple->outer.mc_pg[0] = 0;
couple->outer.mc_flags = 0;
STATIC_ASSERT(CC_BRANCH == P_BRANCH && CC_LEAF == P_LEAF &&
CC_LEAF2 == P_LEAF2);
CC_OVERFLOW == P_OVERFLOW && CC_LEAF2 == P_LEAF2);
couple->outer.mc_checking =
(mdbx_audit_enabled() || (txn->mt_env->me_flags & MDBX_VALIDATION))
? CC_PAGECHECK | CC_LEAF

View File

@ -1050,7 +1050,8 @@ struct MDBX_cursor {
/* Cursor checking flags. */
#define CC_BRANCH 0x01 /* same as P_BRANCH for CHECK_LEAF_TYPE() */
#define CC_LEAF 0x02 /* same as P_LEAF for CHECK_LEAF_TYPE() */
#define CC_UPDATING 0x04 /* update/rebalance pending */
#define CC_OVERFLOW 0x04 /* same as P_OVERFLOW for CHECK_LEAF_TYPE() */
#define CC_UPDATING 0x08 /* update/rebalance pending */
#define CC_SKIPORD 0x10 /* don't check keys ordering */
#define CC_LEAF2 0x20 /* same as P_LEAF2 for CHECK_LEAF_TYPE() */
#define CC_RETIRING 0x40 /* refs to child pages may be invalid */
@ -1063,7 +1064,7 @@ struct MDBX_cursor {
#define CHECK_LEAF_TYPE(mc, mp) \
(((PAGETYPE_EXTRA(mp) ^ (mc)->mc_checking) & \
(CC_BRANCH | CC_LEAF | CC_LEAF2)) == 0)
(CC_BRANCH | CC_LEAF | CC_OVERFLOW | CC_LEAF2)) == 0)
/* Context for sorted-dup records.
* We could have gone to a fully recursive design, with arbitrarily