1 /* filterindex.c - generate the list of candidate entries from a filter */
4 * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/string.h>
16 static int presence_candidates(
18 AttributeDescription *desc,
21 static int equality_candidates(
23 AttributeAssertion *ava,
26 static int approx_candidates(
28 AttributeAssertion *ava,
31 static int substring_candidates(
33 SubstringsAssertion *sub,
37 static int list_candidates(
46 bdb_filter_candidates(
55 LDAP_LOG ( INDEX, ENTRY, "=> bdb_filter_candidates\n", 0, 0, 0 );
57 Debug( LDAP_DEBUG_FILTER, "=> bdb_filter_candidates\n", 0, 0, 0 );
60 switch ( f->f_choice ) {
61 case SLAPD_FILTER_COMPUTED:
62 switch( f->f_result ) {
63 case SLAPD_COMPARE_UNDEFINED:
64 /* This technically is not the same as FALSE, but it
65 * certainly will produce no matches.
68 case LDAP_COMPARE_FALSE:
71 case LDAP_COMPARE_TRUE: {
72 struct bdb_info *bdb = (struct bdb_info *)op->o_bd->be_private;
73 BDB_IDL_ALL( bdb, ids );
76 /* this is a pre-computed scope, leave it alone */
80 #if 0 /* Not used any more, search calls bdb_dn2idl directly */
81 case SLAPD_FILTER_DN_ONE:
83 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN ONE\n", 0, 0, 0 );
85 Debug( LDAP_DEBUG_FILTER, "\tDN ONE\n", 0, 0, 0 );
87 rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_ONE_PREFIX, ids,
88 stack, op->o_tmpmemctx );
89 if( rc == DB_NOTFOUND ) {
95 case SLAPD_FILTER_DN_SUBTREE:
97 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN SUBTREE\n", 0, 0, 0 );
99 Debug( LDAP_DEBUG_FILTER, "\tDN SUBTREE\n", 0, 0, 0 );
101 rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_SUBTREE_PREFIX, ids,
102 stack, op->o_tmpmemctx );
105 case LDAP_FILTER_PRESENT:
107 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tPRESENT\n", 0, 0, 0 );
109 Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 );
111 rc = presence_candidates( op, f->f_desc, ids );
114 case LDAP_FILTER_EQUALITY:
116 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tEQUALITY\n", 0, 0, 0 );
118 Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 );
120 rc = equality_candidates( op, f->f_ava, ids, tmp );
123 case LDAP_FILTER_APPROX:
125 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAPPROX\n", 0, 0, 0 );
127 Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 );
129 rc = approx_candidates( op, f->f_ava, ids, tmp );
132 case LDAP_FILTER_SUBSTRINGS:
134 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tSUBSTRINGS\n", 0, 0, 0 );
136 Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 );
138 rc = substring_candidates( op, f->f_sub, ids, tmp );
142 /* no GE index, use pres */
144 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tGE\n", 0, 0, 0 );
146 Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
148 rc = presence_candidates( op, f->f_ava->aa_desc, ids );
152 /* no LE index, use pres */
154 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tLE\n", 0, 0, 0 );
156 Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
158 rc = presence_candidates( op, f->f_ava->aa_desc, ids );
161 case LDAP_FILTER_NOT:
162 /* no indexing to support NOT filters */
164 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tNOT\n",0, 0, 0 );
166 Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
168 { struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
169 BDB_IDL_ALL( bdb, ids );
173 case LDAP_FILTER_AND:
175 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAND\n", 0, 0, 0 );
177 Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 );
179 rc = list_candidates( op,
180 f->f_and, LDAP_FILTER_AND, ids, tmp, stack );
185 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tOR\n", 0, 0, 0 );
187 Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 );
189 rc = list_candidates( op,
190 f->f_or, LDAP_FILTER_OR, ids, tmp, stack );
195 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tUNKNOWN\n", 0, 0, 0 );
197 Debug( LDAP_DEBUG_FILTER, "\tUNKNOWN %lu\n",
198 (unsigned long) f->f_choice, 0, 0 );
200 /* Must not return NULL, otherwise extended filters break */
201 { struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
202 BDB_IDL_ALL( bdb, ids );
207 LDAP_LOG ( INDEX, RESULTS,
208 "<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n",
209 (long)ids[0], (long)BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ));
211 Debug( LDAP_DEBUG_FILTER,
212 "<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n",
214 (long) BDB_IDL_FIRST( ids ),
215 (long) BDB_IDL_LAST( ids ) );
230 struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
235 LDAP_LOG ( INDEX, ARGS, "=> bdb_list_candidates: 0x%x\n", ftype, 0 , 0 );
237 Debug( LDAP_DEBUG_FILTER, "=> bdb_list_candidates 0x%x\n", ftype, 0, 0 );
240 for ( f = flist; f != NULL; f = f->f_next ) {
241 rc = bdb_filter_candidates( op, f, save, tmp,
242 save+BDB_IDL_UM_SIZE );
245 if ( ftype == LDAP_FILTER_AND ) {
253 if ( ftype == LDAP_FILTER_AND ) {
255 BDB_IDL_CPY( ids, save );
257 bdb_idl_intersection( ids, save );
259 if( BDB_IDL_IS_ZERO( ids ) )
263 BDB_IDL_CPY( ids, save );
265 bdb_idl_union( ids, save );
270 if( rc == LDAP_SUCCESS ) {
272 LDAP_LOG ( INDEX, RESULTS,
273 "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n",
274 (long) ids[0], (long) BDB_IDL_FIRST( ids ),
275 (long) BDB_IDL_LAST( ids ) );
277 Debug( LDAP_DEBUG_FILTER,
278 "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n",
280 (long) BDB_IDL_FIRST(ids),
281 (long) BDB_IDL_LAST(ids) );
286 LDAP_LOG ( INDEX, ARGS, "<= bdb_list_candidates: rc=%d\n", rc, 0, 0 );
288 Debug( LDAP_DEBUG_FILTER,
289 "<= bdb_list_candidates: undefined rc=%d\n",
300 AttributeDescription *desc,
303 struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
307 struct berval prefix = {0, NULL};
310 LDAP_LOG ( INDEX, ENTRY, "=> bdb_presence_candidates (%s)\n",
311 desc->ad_cname.bv_val, 0, 0 );
313 Debug( LDAP_DEBUG_TRACE, "=> bdb_presence_candidates (%s)\n",
314 desc->ad_cname.bv_val, 0, 0 );
317 if( desc == slap_schema.si_ad_objectClass ) {
318 BDB_IDL_ALL( bdb, ids );
322 rc = bdb_index_param( op->o_bd, desc, LDAP_FILTER_PRESENT,
323 &db, &mask, &prefix );
325 if( rc != LDAP_SUCCESS ) {
327 LDAP_LOG ( INDEX, RESULTS,
328 "<= bdb_presence_candidates: (%s) index_param "
330 desc->ad_cname.bv_val, rc, 0 );
332 Debug( LDAP_DEBUG_TRACE,
333 "<= bdb_presence_candidates: (%s) index_param "
335 desc->ad_cname.bv_val, rc, 0 );
343 LDAP_LOG(INDEX, RESULTS,
344 "<= bdb_presence_candidates: (%s) not indexed\n",
345 desc->ad_cname.bv_val, 0, 0 );
347 Debug( LDAP_DEBUG_TRACE,
348 "<= bdb_presence_candidates: (%s) not indexed\n",
349 desc->ad_cname.bv_val, 0, 0 );
354 if( prefix.bv_val == NULL ) {
356 LDAP_LOG(INDEX, RESULTS,
357 "<= bdb_presence_candidates: (%s) no prefix\n",
358 desc->ad_cname.bv_val, 0, 0 );
360 Debug( LDAP_DEBUG_TRACE,
361 "<= bdb_presence_candidates: (%s) no prefix\n",
362 desc->ad_cname.bv_val, 0, 0 );
367 rc = bdb_key_read( op->o_bd, db, NULL, &prefix, ids );
369 if( rc == DB_NOTFOUND ) {
372 } else if( rc != LDAP_SUCCESS ) {
374 LDAP_LOG ( INDEX, RESULTS,
375 "<= bdb_presence_candidates: (%s) "
376 "key read failed (%d)\n",
377 desc->ad_cname.bv_val, rc, 0 );
379 Debug( LDAP_DEBUG_TRACE,
380 "<= bdb_presense_candidates: (%s) "
381 "key read failed (%d)\n",
382 desc->ad_cname.bv_val, rc, 0 );
388 LDAP_LOG ( INDEX, RESULTS,
389 "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n",
390 (long)ids[0], (long)BDB_IDL_FIRST( ids ), (long)BDB_IDL_LAST( ids ) );
392 Debug(LDAP_DEBUG_TRACE,
393 "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n",
395 (long) BDB_IDL_FIRST(ids),
396 (long) BDB_IDL_LAST(ids) );
406 AttributeAssertion *ava,
414 struct berval prefix = {0, NULL};
415 struct berval *keys = NULL;
419 LDAP_LOG ( INDEX, ENTRY, "=> bdb_equality_candidates (%s)\n",
420 ava->aa_desc->ad_cname.bv_val, 0, 0 );
422 Debug( LDAP_DEBUG_TRACE, "=> bdb_equality_candidates (%s)\n",
423 ava->aa_desc->ad_cname.bv_val, 0, 0 );
426 rc = bdb_index_param( op->o_bd, ava->aa_desc, LDAP_FILTER_EQUALITY,
427 &db, &mask, &prefix );
429 if( rc != LDAP_SUCCESS ) {
431 LDAP_LOG ( INDEX, RESULTS,
432 "<= bdb_equality_candidates: (%s) "
433 "index_param failed (%d)\n",
434 ava->aa_desc->ad_cname.bv_val, rc, 0);
436 Debug( LDAP_DEBUG_ANY,
437 "<= bdb_equality_candidates: (%s) "
438 "index_param failed (%d)\n",
439 ava->aa_desc->ad_cname.bv_val, rc, 0 );
446 LDAP_LOG(INDEX, RESULTS,
447 "<= bdb_equality_candidates: (%s) not indexed\n",
448 ava->aa_desc->ad_cname.bv_val, 0, 0 );
450 Debug( LDAP_DEBUG_ANY,
451 "<= bdb_equality_candidates: (%s) not indexed\n",
452 ava->aa_desc->ad_cname.bv_val, 0, 0 );
457 mr = ava->aa_desc->ad_type->sat_equality;
462 if( !mr->smr_filter ) {
466 rc = (mr->smr_filter)(
467 LDAP_FILTER_EQUALITY,
469 ava->aa_desc->ad_type->sat_syntax,
473 &keys, op->o_tmpmemctx );
475 if( rc != LDAP_SUCCESS ) {
477 LDAP_LOG ( INDEX, RESULTS,
478 "<= bdb_equality_candidates: (%s, %s) "
479 "MR filter failed (%d)\n",
480 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
482 Debug( LDAP_DEBUG_TRACE,
483 "<= bdb_equality_candidates: (%s, %s) "
484 "MR filter failed (%d)\n",
485 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
492 LDAP_LOG ( INDEX, RESULTS,
493 "<= bdb_equality_candidates: (%s) no keys\n",
494 ava->aa_desc->ad_cname.bv_val, 0, 0 );
496 Debug( LDAP_DEBUG_TRACE,
497 "<= bdb_equality_candidates: (%s) no keys\n",
498 ava->aa_desc->ad_cname.bv_val, 0, 0 );
503 for ( i= 0; keys[i].bv_val != NULL; i++ ) {
504 rc = bdb_key_read( op->o_bd, db, NULL, &keys[i], tmp );
506 if( rc == DB_NOTFOUND ) {
510 } else if( rc != LDAP_SUCCESS ) {
512 LDAP_LOG ( INDEX, RESULTS,
513 "<= bdb_equality_candidates: (%s) "
514 "key read failed (%d)\n",
515 ava->aa_desc->ad_cname.bv_val, rc, 0 );
517 Debug( LDAP_DEBUG_TRACE,
518 "<= bdb_equality_candidates: (%s) "
519 "key read failed (%d)\n",
520 ava->aa_desc->ad_cname.bv_val, rc, 0 );
525 if( BDB_IDL_IS_ZERO( tmp ) ) {
527 LDAP_LOG ( INDEX, RESULTS,
528 "<= bdb_equality_candidates: (%s) NULL\n",
529 ava->aa_desc->ad_cname.bv_val, 0, 0);
531 Debug( LDAP_DEBUG_TRACE,
532 "<= bdb_equality_candidates: (%s) NULL\n",
533 ava->aa_desc->ad_cname.bv_val, 0, 0 );
540 BDB_IDL_CPY( ids, tmp );
542 bdb_idl_intersection( ids, tmp );
545 if( BDB_IDL_IS_ZERO( ids ) )
549 ber_bvarray_free_x( keys, op->o_tmpmemctx );
552 LDAP_LOG ( INDEX, RESULTS,
553 "<= bdb_equality_candidates: id=%ld first=%ld last=%ld\n",
554 (long) ids[0], (long) BDB_IDL_FIRST( ids ),
555 (long) BDB_IDL_LAST( ids ) );
557 Debug( LDAP_DEBUG_TRACE,
558 "<= bdb_equality_candidates: id=%ld, first=%ld, last=%ld\n",
560 (long) BDB_IDL_FIRST(ids),
561 (long) BDB_IDL_LAST(ids) );
570 AttributeAssertion *ava,
578 struct berval prefix = {0, NULL};
579 struct berval *keys = NULL;
583 LDAP_LOG ( INDEX, ENTRY, "=> bdb_approx_candidates (%s)\n",
584 ava->aa_desc->ad_cname.bv_val, 0, 0 );
586 Debug( LDAP_DEBUG_TRACE, "=> bdb_approx_candidates (%s)\n",
587 ava->aa_desc->ad_cname.bv_val, 0, 0 );
590 rc = bdb_index_param( op->o_bd, ava->aa_desc, LDAP_FILTER_APPROX,
591 &db, &mask, &prefix );
593 if( rc != LDAP_SUCCESS ) {
595 LDAP_LOG ( INDEX, RESULTS,
596 "<= bdb_approx_candidates: (%s) "
597 "index_param failed (%d)\n",
598 ava->aa_desc->ad_cname.bv_val, rc, 0 );
600 Debug( LDAP_DEBUG_ANY,
601 "<= bdb_approx_candidates: (%s) "
602 "index_param failed (%d)\n",
603 ava->aa_desc->ad_cname.bv_val, rc, 0 );
610 LDAP_LOG(INDEX, RESULTS,
611 "<= bdb_approx_candidates: (%s) not indexed\n",
612 ava->aa_desc->ad_cname.bv_val, 0, 0 );
614 Debug( LDAP_DEBUG_ANY,
615 "<= bdb_approx_candidates: (%s) not indexed\n",
616 ava->aa_desc->ad_cname.bv_val, 0, 0 );
621 mr = ava->aa_desc->ad_type->sat_approx;
623 /* no approx matching rule, try equality matching rule */
624 mr = ava->aa_desc->ad_type->sat_equality;
631 if( !mr->smr_filter ) {
635 rc = (mr->smr_filter)(
638 ava->aa_desc->ad_type->sat_syntax,
642 &keys, op->o_tmpmemctx );
644 if( rc != LDAP_SUCCESS ) {
646 LDAP_LOG ( INDEX, RESULTS,
647 "<= bdb_approx_candidates: (%s, %s) "
648 "MR filter failed (%d)\n",
649 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
651 Debug( LDAP_DEBUG_TRACE,
652 "<= bdb_approx_candidates: (%s, %s) "
653 "MR filter failed (%d)\n",
654 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
661 LDAP_LOG ( INDEX, RESULTS,
662 "<= bdb_approx_candidates: (%s) no keys (%s)\n",
663 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, 0 );
665 Debug( LDAP_DEBUG_TRACE,
666 "<= bdb_approx_candidates: (%s) no keys (%s)\n",
667 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, 0 );
672 for ( i= 0; keys[i].bv_val != NULL; i++ ) {
673 rc = bdb_key_read( op->o_bd, db, NULL, &keys[i], tmp );
675 if( rc == DB_NOTFOUND ) {
679 } else if( rc != LDAP_SUCCESS ) {
681 LDAP_LOG ( INDEX, RESULTS,
682 "<= bdb_approx_candidates: (%s) "
683 "key read failed (%d)\n",
684 ava->aa_desc->ad_cname.bv_val, rc, 0);
686 Debug( LDAP_DEBUG_TRACE,
687 "<= bdb_approx_candidates: (%s) "
688 "key read failed (%d)\n",
689 ava->aa_desc->ad_cname.bv_val, rc, 0 );
694 if( BDB_IDL_IS_ZERO( tmp ) ) {
696 LDAP_LOG ( INDEX, RESULTS,
697 "<= bdb_approx_candidates: (%s) NULL\n",
698 ava->aa_desc->ad_cname.bv_val, 0, 0 );
700 Debug( LDAP_DEBUG_TRACE,
701 "<= bdb_approx_candidates: (%s) NULL\n",
702 ava->aa_desc->ad_cname.bv_val, 0, 0 );
709 BDB_IDL_CPY( ids, tmp );
711 bdb_idl_intersection( ids, tmp );
714 if( BDB_IDL_IS_ZERO( ids ) )
718 ber_bvarray_free_x( keys, op->o_tmpmemctx );
721 LDAP_LOG ( INDEX, RESULTS,
722 "<= bdb_approx_candidates: id=%ld first=%ld last=%ld\n",
723 (long) ids[0], (long) BDB_IDL_FIRST( ids ),
724 (long) BDB_IDL_LAST( ids ) );
726 Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates %ld, first=%ld, last=%ld\n",
728 (long) BDB_IDL_FIRST(ids),
729 (long) BDB_IDL_LAST(ids) );
735 substring_candidates(
737 SubstringsAssertion *sub,
745 struct berval prefix = {0, NULL};
746 struct berval *keys = NULL;
750 LDAP_LOG ( INDEX, ENTRY, "=> bdb_substring_candidates (%s)\n",
751 sub->sa_desc->ad_cname.bv_val, 0, 0 );
753 Debug( LDAP_DEBUG_TRACE, "=> bdb_substring_candidates (%s)\n",
754 sub->sa_desc->ad_cname.bv_val, 0, 0 );
757 rc = bdb_index_param( op->o_bd, sub->sa_desc, LDAP_FILTER_SUBSTRINGS,
758 &db, &mask, &prefix );
760 if( rc != LDAP_SUCCESS ) {
762 LDAP_LOG ( INDEX, RESULTS,
763 "<= bdb_substring_candidates: (%s) "
764 "index_param failed (%d)\n",
765 sub->sa_desc->ad_cname.bv_val, rc, 0);
767 Debug( LDAP_DEBUG_ANY,
768 "<= bdb_substring_candidates: (%s) "
769 "index_param failed (%d)\n",
770 sub->sa_desc->ad_cname.bv_val, rc, 0 );
777 LDAP_LOG ( INDEX, RESULTS,
778 "<= bdb_substring_candidates: (%s) not indexed\n",
779 sub->sa_desc->ad_cname.bv_val, 0, 0 );
781 Debug( LDAP_DEBUG_ANY,
782 "<= bdb_substring_candidates: (%s) not indexed\n",
783 sub->sa_desc->ad_cname.bv_val, 0, 0 );
788 mr = sub->sa_desc->ad_type->sat_substr;
794 if( !mr->smr_filter ) {
798 rc = (mr->smr_filter)(
799 LDAP_FILTER_SUBSTRINGS,
801 sub->sa_desc->ad_type->sat_syntax,
805 &keys, op->o_tmpmemctx );
807 if( rc != LDAP_SUCCESS ) {
809 LDAP_LOG ( INDEX, RESULTS,
810 "<= bdb_substring_candidates: (%s) "
811 "MR filter failed (%d)\n",
812 sub->sa_desc->ad_cname.bv_val, rc, 0 );
814 Debug( LDAP_DEBUG_TRACE,
815 "<= bdb_substring_candidates: (%s) "
816 "MR filter failed (%d)\n",
817 sub->sa_desc->ad_cname.bv_val, rc, 0 );
824 LDAP_LOG ( INDEX, RESULTS,
825 "<= bdb_substring_candidates: (0x%04lx) no keys (%s)\n",
826 mask, sub->sa_desc->ad_cname.bv_val, 0 );
828 Debug( LDAP_DEBUG_TRACE,
829 "<= bdb_substring_candidates: (0x%04lx) no keys (%s)\n",
830 mask, sub->sa_desc->ad_cname.bv_val, 0 );
835 for ( i= 0; keys[i].bv_val != NULL; i++ ) {
836 rc = bdb_key_read( op->o_bd, db, NULL, &keys[i], tmp );
838 if( rc == DB_NOTFOUND ) {
842 } else if( rc != LDAP_SUCCESS ) {
844 LDAP_LOG ( INDEX, RESULTS,
845 "<= bdb_substring_candidates: (%s) "
846 "key read failed (%d)\n",
847 sub->sa_desc->ad_cname.bv_val, rc, 0 );
849 Debug( LDAP_DEBUG_TRACE,
850 "<= bdb_substring_candidates: (%s) "
851 "key read failed (%d)\n",
852 sub->sa_desc->ad_cname.bv_val, rc, 0 );
857 if( BDB_IDL_IS_ZERO( tmp ) ) {
859 LDAP_LOG ( INDEX, RESULTS,
860 "<= bdb_substring_candidates: (%s) NULL\n",
861 sub->sa_desc->ad_cname.bv_val, 0, 0 );
863 Debug( LDAP_DEBUG_TRACE,
864 "<= bdb_substring_candidates: (%s) NULL\n",
865 sub->sa_desc->ad_cname.bv_val, 0, 0 );
872 BDB_IDL_CPY( ids, tmp );
874 bdb_idl_intersection( ids, tmp );
877 if( BDB_IDL_IS_ZERO( ids ) )
881 ber_bvarray_free_x( keys, op->o_tmpmemctx );
884 LDAP_LOG ( INDEX, RESULTS,
885 "<= bdb_substring_candidates: id=%ld first=%ld last=%ld\n",
886 (long) ids[0], (long) BDB_IDL_FIRST( ids ),
887 (long) BDB_IDL_LAST( ids ) );
889 Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates: %ld, first=%ld, last=%ld\n",
891 (long) BDB_IDL_FIRST(ids),
892 (long) BDB_IDL_LAST(ids) );