)
{
ID_BLOCK *idl;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ DBCache *db;
+ int rc;
+ char *dbname;
+ slap_index mask;
+ struct berval *prefix;
+#endif
Debug( LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 );
#ifdef SLAPD_SCHEMA_NOT_COMPAT
idl = idl_allids( be );
+
+ rc = index_param( be, desc, LDAP_FILTER_PRESENT,
+ &dbname, &mask, &prefix );
+
+ if( rc != LDAP_SUCCESS ) {
+ return idl;
+ }
+
+ if( dbname == NULL ) {
+ /* not indexed */
+ return idl;
+ }
+
+ db = ldbm_cache_open( be, dbname, LDBM_SUFFIX, LDBM_READER );
+
+ if ( db == NULL ) {
+ Debug( LDAP_DEBUG_ANY,
+ "<= presense_candidates db open failed (%s%s)\n",
+ dbname, LDBM_SUFFIX, 0 );
+ return idl;
+ }
+
+ if( prefix != NULL ) {
+ idl_free( idl );
+ idl = NULL;
+
+ rc = key_read( be, db, prefix, &idl );
+
+ if( rc != LDAP_SUCCESS ) {
+ Debug( LDAP_DEBUG_TRACE, "<= presense_candidates key read failed (%d)\n",
+ rc, 0, 0 );
+
+ } else if( idl == NULL ) {
+ Debug( LDAP_DEBUG_TRACE, "<= presense_candidates NULL\n",
+ 0, 0, 0 );
+ }
+ }
+
+ ldbm_cache_close( be, db );
+
#else
idl = index_read( be, desc, SLAP_INDEX_PRESENT, NULL );
#endif
return idl;
}
- if( rc != LDAP_SUCCESS ) {
- Debug( LDAP_DEBUG_TRACE, "<= equality_candidates open failed (%d)\n",
- rc, 0, 0 );
- return idl;
- }
-
for ( i= 0; keys[i] != NULL; i++ ) {
ID_BLOCK *save;
ID_BLOCK *tmp;
return idl;
}
- if( rc != LDAP_SUCCESS ) {
- Debug( LDAP_DEBUG_TRACE, "<= approx_candidates open failed (%d)\n",
- rc, 0, 0 );
- return idl;
- }
-
for ( i= 0; keys[i] != NULL; i++ ) {
ID_BLOCK *save;
ID_BLOCK *tmp;