diff options
Diffstat (limited to 'src/util/db2/btree')
| -rw-r--r-- | src/util/db2/btree/bt_open.c | 8 | ||||
| -rw-r--r-- | src/util/db2/btree/bt_put.c | 3 | ||||
| -rw-r--r-- | src/util/db2/btree/bt_split.c | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/util/db2/btree/bt_open.c b/src/util/db2/btree/bt_open.c index 50fbe3f00a..3e4c67a4bc 100644 --- a/src/util/db2/btree/bt_open.c +++ b/src/util/db2/btree/bt_open.c @@ -125,7 +125,7 @@ __bt_open(fname, flags, mode, openinfo, dflags) */ if (b.psize && (b.psize < MINPSIZE || b.psize > MAX_PAGE_OFFSET + 1 || - b.psize & sizeof(indx_t) - 1)) + b.psize & (sizeof(indx_t) - 1))) goto einval; /* Minimum number of keys per page; absolute minimum is 2. */ @@ -245,7 +245,7 @@ __bt_open(fname, flags, mode, openinfo, dflags) if (m.magic != BTREEMAGIC || m.version != BTREEVERSION) goto eftype; if (m.psize < MINPSIZE || m.psize > MAX_PAGE_OFFSET + 1 || - m.psize & sizeof(indx_t) - 1) + m.psize & (sizeof(indx_t) - 1)) goto eftype; if (m.flags & ~SAVEMETA) goto eftype; @@ -278,8 +278,8 @@ __bt_open(fname, flags, mode, openinfo, dflags) t->bt_psize = b.psize; /* Set the cache size; must be a multiple of the page size. */ - if (b.cachesize && b.cachesize & b.psize - 1) - b.cachesize += (~b.cachesize & b.psize - 1) + 1; + if (b.cachesize && b.cachesize & (b.psize - 1)) + b.cachesize += (~b.cachesize & (b.psize - 1)) + 1; if (b.cachesize < b.psize * MINCACHE) b.cachesize = b.psize * MINCACHE; diff --git a/src/util/db2/btree/bt_put.c b/src/util/db2/btree/bt_put.c index 2feebce0c8..139a7fc369 100644 --- a/src/util/db2/btree/bt_put.c +++ b/src/util/db2/btree/bt_put.c @@ -223,7 +223,7 @@ delete: if (__bt_dleaf(t, key, h, index) == RET_ERROR) { t->bt_cursor.pg.pgno == h->pgno && t->bt_cursor.pg.index >= index) ++t->bt_cursor.pg.index; - if (t->bt_order == NOT) + if (t->bt_order == NOT) { if (h->nextpg == P_INVALID) { if (index == NEXTINDEX(h) - 1) { t->bt_order = FORWARD; @@ -237,6 +237,7 @@ delete: if (__bt_dleaf(t, key, h, index) == RET_ERROR) { t->bt_last.pgno = h->pgno; } } + } mpool_put(t->bt_mp, h, MPOOL_DIRTY); diff --git a/src/util/db2/btree/bt_split.c b/src/util/db2/btree/bt_split.c index 0fc95baf3e..c6319b55f9 100644 --- a/src/util/db2/btree/bt_split.c +++ b/src/util/db2/btree/bt_split.c @@ -673,7 +673,7 @@ bt_psplit(t, h, l, r, pskip, ilen) * where we decide to try and copy too much onto the left page. * Make sure that doesn't happen. */ - if (skip <= off && used + nbytes >= full || nxt == top - 1) { + if ((skip <= off && used + nbytes >= full) || nxt == top - 1) { --off; break; } |
