Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HAMANO Tsukasa
OpenLDAP
Commits
2c70d043
Commit
2c70d043
authored
Sep 18, 2011
by
Howard Chu
Browse files
Fix mdb_drop() if not deleting the DB record
parent
77b1017b
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/libmdb/mdb.c
View file @
2c70d043
...
...
@@ -5342,10 +5342,19 @@ int mdb_drop(MDB_txn *txn, MDB_dbi dbi, int del)
mdb_cursor_close
(
mc
);
return
rc
;
if
(
del
)
{
/* Can't delete the main DB */
if
(
del
&&
dbi
>
MAIN_DBI
)
{
rc
=
mdb_del
(
txn
,
MAIN_DBI
,
&
mc
->
mc_dbx
->
md_name
,
NULL
);
if
(
!
rc
)
mdb_close
(
txn
->
mt_env
,
dbi
);
}
else
{
txn
->
mt_dbflags
[
dbi
]
|=
DB_DIRTY
;
txn
->
mt_dbs
[
dbi
].
md_depth
=
0
;
txn
->
mt_dbs
[
dbi
].
md_branch_pages
=
0
;
txn
->
mt_dbs
[
dbi
].
md_leaf_pages
=
0
;
txn
->
mt_dbs
[
dbi
].
md_overflow_pages
=
0
;
txn
->
mt_dbs
[
dbi
].
md_entries
=
0
;
txn
->
mt_dbs
[
dbi
].
md_root
=
P_INVALID
;
}
mdb_cursor_close
(
mc
);
return
rc
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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