Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HAMANO Tsukasa
OpenLDAP
Commits
ce2a0d40
Commit
ce2a0d40
authored
Dec 29, 2013
by
Hallvard Furuseth
Browse files
ITS#7771 mdb_cursor_del0(): Fix xcursor tracking.
parent
5adc46d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/mdb.c
View file @
ce2a0d40
...
...
@@ -7361,7 +7361,7 @@ mdb_cursor_del0(MDB_cursor *mc, MDB_node *leaf)
if
(
rc
!=
MDB_SUCCESS
)
mc
->
mc_txn
->
mt_flags
|=
MDB_TXN_ERROR
;
else
{
MDB_cursor
*
m2
;
MDB_cursor
*
m2
,
*
m3
;
MDB_dbi
dbi
=
mc
->
mc_dbi
;
mp
=
mc
->
mc_pg
[
mc
->
mc_top
];
...
...
@@ -7373,18 +7373,19 @@ mdb_cursor_del0(MDB_cursor *mc, MDB_node *leaf)
/* Adjust other cursors pointing to mp */
for
(
m2
=
mc
->
mc_txn
->
mt_cursors
[
dbi
];
m2
;
m2
=
m2
->
mc_next
)
{
if
(
m2
==
mc
||
m2
->
mc_snum
<
mc
->
mc_snum
)
m3
=
(
mc
->
mc_flags
&
C_SUB
)
?
&
m2
->
mc_xcursor
->
mx_cursor
:
m2
;
if
(
!
(
m2
->
mc_flags
&
m3
->
mc_flags
&
C_INITIALIZED
))
continue
;
if
(
!
(
m2
->
mc_flags
&
C_INITIALIZED
)
)
if
(
m3
==
mc
||
m3
->
mc_snum
<
mc
->
mc_snum
)
continue
;
if
(
m
2
->
mc_pg
[
mc
->
mc_top
]
==
mp
)
{
if
(
m
2
->
mc_ki
[
mc
->
mc_top
]
>=
ki
)
{
m
2
->
mc_flags
|=
C_DEL
;
if
(
m
2
->
mc_ki
[
mc
->
mc_top
]
>
ki
)
m
2
->
mc_ki
[
mc
->
mc_top
]
--
;
if
(
m
3
->
mc_pg
[
mc
->
mc_top
]
==
mp
)
{
if
(
m
3
->
mc_ki
[
mc
->
mc_top
]
>=
ki
)
{
m
3
->
mc_flags
|=
C_DEL
;
if
(
m
3
->
mc_ki
[
mc
->
mc_top
]
>
ki
)
m
3
->
mc_ki
[
mc
->
mc_top
]
--
;
}
if
(
m
2
->
mc_ki
[
mc
->
mc_top
]
>=
nkeys
)
mdb_cursor_sibling
(
m
2
,
1
);
if
(
m
3
->
mc_ki
[
mc
->
mc_top
]
>=
nkeys
)
mdb_cursor_sibling
(
m
3
,
1
);
}
}
mc
->
mc_flags
|=
C_DEL
;
...
...
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