Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lukas However
OpenLDAP
Commits
b8c1877b
Commit
b8c1877b
authored
Dec 09, 2016
by
Hallvard Furuseth
Browse files
Cleanup: Add flag DB_DUPDATA, drop DB_DIRTY hack
parent
b57bb99f
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/mdb.c
View file @
b8c1877b
...
...
@@ -1078,11 +1078,12 @@ struct MDB_txn {
* @ingroup internal
* @{
*/
#define DB_DIRTY 0x01
/**< DB was
modified or is DUPSORT data
*/
#define DB_DIRTY 0x01
/**< DB was
written in this txn
*/
#define DB_STALE 0x02
/**< Named-DB record is older than txnID */
#define DB_NEW 0x04
/**< Named-DB handle opened in this txn */
#define DB_VALID 0x08
/**< DB handle is valid, see also #MDB_VALID */
#define DB_USRVALID 0x10
/**< As #DB_VALID, but not set for #FREE_DBI */
#define DB_DUPDATA 0x20
/**< DB is #MDB_DUPSORT data */
/** @} */
/** In write txns, array of cursors for each DB */
MDB_cursor
**
mt_cursors
;
...
...
@@ -6270,7 +6271,8 @@ mdb_cursor_touch(MDB_cursor *mc)
{
int
rc
=
MDB_SUCCESS
;
if
(
mc
->
mc_dbi
>=
CORE_DBS
&&
!
(
*
mc
->
mc_dbflag
&
DB_DIRTY
))
{
if
(
mc
->
mc_dbi
>=
CORE_DBS
&&
!
(
*
mc
->
mc_dbflag
&
(
DB_DIRTY
|
DB_DUPDATA
)))
{
/* Touch DB record of named DB */
MDB_cursor
mc2
;
MDB_xcursor
mcx
;
if
(
TXN_DBI_CHANGED
(
mc
->
mc_txn
,
mc
->
mc_dbi
))
...
...
@@ -7331,7 +7333,7 @@ mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node)
}
DPRINTF
((
"Sub-db -%u root page %"
Z
"u"
,
mx
->
mx_cursor
.
mc_dbi
,
mx
->
mx_db
.
md_root
));
mx
->
mx_dbflag
=
DB_VALID
|
DB_USRVALID
|
DB_D
IRTY
;
/* DB_DIRTY guides mdb_cursor_touch */
mx
->
mx_dbflag
=
DB_VALID
|
DB_USRVALID
|
DB_D
UPDATA
;
#if UINT_MAX < SIZE_MAX
if
(
mx
->
mx_dbx
.
md_cmp
==
mdb_cmp_int
&&
mx
->
mx_db
.
md_pad
==
sizeof
(
size_t
))
mx
->
mx_dbx
.
md_cmp
=
mdb_cmp_clong
;
...
...
@@ -7357,7 +7359,7 @@ mdb_xcursor_init2(MDB_cursor *mc, MDB_xcursor *src_mx, int new_dupdata)
mx
->
mx_cursor
.
mc_top
=
0
;
mx
->
mx_cursor
.
mc_flags
|=
C_INITIALIZED
;
mx
->
mx_cursor
.
mc_ki
[
0
]
=
0
;
mx
->
mx_dbflag
=
DB_VALID
|
DB_USRVALID
|
DB_D
IRTY
;
/* DB_DIRTY guides mdb_cursor_touch */
mx
->
mx_dbflag
=
DB_VALID
|
DB_USRVALID
|
DB_D
UPDATA
;
#if UINT_MAX < SIZE_MAX
mx
->
mx_dbx
.
md_cmp
=
src_mx
->
mx_dbx
.
md_cmp
;
#endif
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment