mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#2368 - fix deleting key from range IDL
This commit is contained in:
parent
f2223ede5b
commit
a2a5ef48be
@ -850,21 +850,18 @@ bdb_idl_delete_key(
|
||||
/* It's a range, see if we need to rewrite
|
||||
* the boundaries
|
||||
*/
|
||||
hi = 0;
|
||||
data.data = &lo;
|
||||
rc = cursor->c_get( cursor, key, &data, DB_NEXT_DUP );
|
||||
if ( rc != 0 ) {
|
||||
err = "c_get lo";
|
||||
goto fail;
|
||||
}
|
||||
if ( id > lo ) {
|
||||
data.data = &hi;
|
||||
rc = cursor->c_get( cursor, key, &data, DB_NEXT_DUP );
|
||||
if ( rc != 0 ) {
|
||||
err = "c_get hi";
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
if ( id == lo || id == hi ) {
|
||||
if ( id == lo ) {
|
||||
id++;
|
||||
@ -881,6 +878,12 @@ bdb_idl_delete_key(
|
||||
goto fail;
|
||||
}
|
||||
} else {
|
||||
if ( id == lo ) {
|
||||
/* reposition on lo slot */
|
||||
data.data = &lo;
|
||||
cursor->c_get( cursor, key, &data, DB_PREV );
|
||||
lo = id;
|
||||
}
|
||||
rc = cursor->c_del( cursor, 0 );
|
||||
if ( rc != 0 ) {
|
||||
err = "c_del";
|
||||
|
Loading…
Reference in New Issue
Block a user