Partial revert, fix MDB_page definition

vmware
Howard Chu 13 years ago
parent 9ac8638d9d
commit 0c487538cf
  1. 29
      libraries/libmdb/mdb.c

@ -469,10 +469,12 @@ typedef struct MDB_txninfo {
* headers on any page after the first. * headers on any page after the first.
*/ */
typedef struct MDB_page { typedef struct MDB_page {
union { #define mp_pgno mp_p.p_pgno
pgno_t mp_pgno; /**< page number */ #define mp_next mp_p.p_next
void * mp_next; /**< for in-memory list of freed structs */ union padded {
}; pgno_t p_pgno; /**< page number */
void * p_next; /**< for in-memory list of freed structs */
} mp_p;
#define P_BRANCH 0x01 /**< branch page */ #define P_BRANCH 0x01 /**< branch page */
#define P_LEAF 0x02 /**< leaf page */ #define P_LEAF 0x02 /**< leaf page */
#define P_OVERFLOW 0x04 /**< overflow page */ #define P_OVERFLOW 0x04 /**< overflow page */
@ -480,13 +482,16 @@ typedef struct MDB_page {
#define P_DIRTY 0x10 /**< dirty page */ #define P_DIRTY 0x10 /**< dirty page */
#define P_LEAF2 0x20 /**< for #MDB_DUPFIXED records */ #define P_LEAF2 0x20 /**< for #MDB_DUPFIXED records */
uint32_t mp_flags; uint32_t mp_flags;
union { #define mp_lower mp_pb.pb.pb_lower
#define mp_upper mp_pb.pb.pb_upper
#define mp_pages mp_pb.pb_pages
union page_bounds {
struct { struct {
indx_t mp_lower; /**< lower bound of free space */ indx_t pb_lower; /**< lower bound of free space */
indx_t mp_upper; /**< upper bound of free space */ indx_t pb_upper; /**< upper bound of free space */
}; } pb;
uint32_t mp_pages; /**< number of overflow pages */ uint32_t pb_pages; /**< number of overflow pages */
}; } mp_pb;
indx_t mp_ptrs[1]; /**< dynamic size */ indx_t mp_ptrs[1]; /**< dynamic size */
} MDB_page; } MDB_page;
@ -2897,7 +2902,6 @@ mdb_cursor_set(MDB_cursor *mc, MDB_val *key, MDB_val *data,
set1: set1:
if (exactp) if (exactp)
*exactp = 1; *exactp = 1;
rc = 0;
leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]); leaf = NODEPTR(mc->mc_pg[mc->mc_top], mc->mc_ki[mc->mc_top]);
goto set3; goto set3;
} }
@ -3336,6 +3340,9 @@ top:
rdata = &xdata; rdata = &xdata;
xdata.mv_size = sizeof(MDB_db); xdata.mv_size = sizeof(MDB_db);
xdata.mv_data = &dummy; xdata.mv_data = &dummy;
/* new sub-DB, must fully init xcursor */
if (flags == MDB_CURRENT)
flags = 0;
goto new_sub; goto new_sub;
} }
goto put_sub; goto put_sub;

Loading…
Cancel
Save