mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-12 10:54:48 +08:00
ITS#9712 back-mdb: better fix
This commit is contained in:
parent
74a5a3a474
commit
2995da7e8d
@ -55,8 +55,6 @@ mdb_id2v_compare(
|
||||
return -1;
|
||||
if (ui > ci)
|
||||
return 1;
|
||||
if (usrkey->mv_size < curkey->mv_size)
|
||||
return 0;
|
||||
uv = usrkey->mv_data;
|
||||
cv = curkey->mv_data;
|
||||
return uv[sizeof(ID)/2] - cv[sizeof(ID)/2];
|
||||
@ -467,10 +465,13 @@ int mdb_id2entry_delete(
|
||||
MDB_dbi dbi = mdb->mi_id2entry;
|
||||
MDB_val key;
|
||||
MDB_cursor *mvc;
|
||||
char kbuf[sizeof(ID) + sizeof(unsigned short)];
|
||||
int rc;
|
||||
|
||||
key.mv_data = &e->e_id;
|
||||
key.mv_size = sizeof(ID);
|
||||
memcpy( kbuf, &e->e_id, sizeof(ID) );
|
||||
memset( kbuf+sizeof(ID), 0, sizeof(unsigned short) );
|
||||
key.mv_data = kbuf;
|
||||
key.mv_size = sizeof(kbuf);
|
||||
|
||||
/* delete from database */
|
||||
rc = mdb_del( tid, dbi, &key, NULL );
|
||||
|
Loading…
Reference in New Issue
Block a user