Skip to content
Snippets Groups Projects
Commit 9ad0c5a2 authored by Howard Chu's avatar Howard Chu
Browse files

Fix from Jonghyuk Choi jongchoi@us.ibm.com; return 0 IDs when bdb_key_read

returns DB_NOTFOUND.
parent 265a03c7
No related branches found
No related tags found
No related merge requests found
......@@ -232,8 +232,8 @@ presence_candidates(
rc = bdb_key_read( be, db, NULL, &prefix, ids );
if( rc == DB_NOTFOUND ) {
BDB_IDL_ZERO( ids );
rc = 0;
} else if( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
"<= bdb_presense_candidates: key read failed (%d)\n",
......@@ -319,7 +319,10 @@ equality_candidates(
for ( i= 0; keys[i].bv_val != NULL; i++ ) {
rc = bdb_key_read( be, db, NULL, &keys[i], tmp );
if( rc != LDAP_SUCCESS ) {
if( rc == DB_NOTFOUND ) {
BDB_IDL_ZERO( ids );
rc = 0;
} else if( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
"<= bdb_equality_candidates key read failed (%d)\n",
rc, 0, 0 );
......@@ -424,7 +427,11 @@ approx_candidates(
for ( i= 0; keys[i].bv_val != NULL; i++ ) {
rc = bdb_key_read( be, db, NULL, &keys[i], tmp );
if( rc != LDAP_SUCCESS ) {
if( rc == DB_NOTFOUND ) {
BDB_IDL_ZERO( ids );
rc = 0;
break;
} else if( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates key read failed (%d)\n",
rc, 0, 0 );
break;
......@@ -523,7 +530,11 @@ substring_candidates(
for ( i= 0; keys[i].bv_val != NULL; i++ ) {
rc = bdb_key_read( be, db, NULL, &keys[i], tmp );
if( rc != LDAP_SUCCESS ) {
if( rc == DB_NOTFOUND ) {
BDB_IDL_ZERO( ids );
rc = 0;
break;
} else if( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates key read failed (%d)\n",
rc, 0, 0 );
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment