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:
64 case SLAPD_FILTER_DN_ONE:
66 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN ONE\n", 0, 0, 0 );
68 Debug( LDAP_DEBUG_FILTER, "\tDN ONE\n", 0, 0, 0 );
70 rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_ONE_PREFIX, ids,
72 if( rc == DB_NOTFOUND ) {
78 case SLAPD_FILTER_DN_SUBTREE:
80 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tDN SUBTREE\n", 0, 0, 0 );
82 Debug( LDAP_DEBUG_FILTER, "\tDN SUBTREE\n", 0, 0, 0 );
84 rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_SUBTREE_PREFIX, ids,
88 case LDAP_FILTER_PRESENT:
90 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tPRESENT\n", 0, 0, 0 );
92 Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 );
94 rc = presence_candidates( op, f->f_desc, ids );
97 case LDAP_FILTER_EQUALITY:
99 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tEQUALITY\n", 0, 0, 0 );
101 Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 );
103 rc = equality_candidates( op, f->f_ava, ids, tmp );
106 case LDAP_FILTER_APPROX:
108 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAPPROX\n", 0, 0, 0 );
110 Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 );
112 rc = approx_candidates( op, f->f_ava, ids, tmp );
115 case LDAP_FILTER_SUBSTRINGS:
117 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tSUBSTRINGS\n", 0, 0, 0 );
119 Debug( LDAP_DEBUG_FILTER, "\tSUBSTRINGS\n", 0, 0, 0 );
121 rc = substring_candidates( op, f->f_sub, ids, tmp );
125 /* no GE index, use pres */
127 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tGE\n", 0, 0, 0 );
129 Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
131 rc = presence_candidates( op, f->f_ava->aa_desc, ids );
135 /* no LE index, use pres */
137 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tLE\n", 0, 0, 0 );
139 Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
141 rc = presence_candidates( op, f->f_ava->aa_desc, ids );
144 case LDAP_FILTER_NOT:
145 /* no indexing to support NOT filters */
147 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tNOT\n",0, 0, 0 );
149 Debug( LDAP_DEBUG_FILTER, "\tNOT\n", 0, 0, 0 );
151 { struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
152 BDB_IDL_ALL( bdb, ids );
156 case LDAP_FILTER_AND:
158 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tAND\n", 0, 0, 0 );
160 Debug( LDAP_DEBUG_FILTER, "\tAND\n", 0, 0, 0 );
162 rc = list_candidates( op,
163 f->f_and, LDAP_FILTER_AND, ids, tmp, stack );
168 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tOR\n", 0, 0, 0 );
170 Debug( LDAP_DEBUG_FILTER, "\tOR\n", 0, 0, 0 );
172 rc = list_candidates( op,
173 f->f_or, LDAP_FILTER_OR, ids, tmp, stack );
178 LDAP_LOG ( INDEX, ARGS, "=> bdb_filter_candidates: \tUNKNOWN\n", 0, 0, 0 );
180 Debug( LDAP_DEBUG_FILTER, "\tUNKNOWN %lu\n",
181 (unsigned long) f->f_choice, 0, 0 );
183 /* Must not return NULL, otherwise extended filters break */
184 { struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
185 BDB_IDL_ALL( bdb, ids );
190 LDAP_LOG ( INDEX, RESULTS,
191 "<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n",
192 (long)ids[0], (long)BDB_IDL_FIRST( ids ), (long) BDB_IDL_LAST( ids ));
194 Debug( LDAP_DEBUG_FILTER,
195 "<= bdb_filter_candidates: id=%ld first=%ld last=%ld\n",
197 (long) BDB_IDL_FIRST( ids ),
198 (long) BDB_IDL_LAST( ids ) );
213 struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
218 LDAP_LOG ( INDEX, ARGS, "=> bdb_list_candidates: 0x%x\n", ftype, 0 , 0 );
220 Debug( LDAP_DEBUG_FILTER, "=> bdb_list_candidates 0x%x\n", ftype, 0, 0 );
223 /* Copy so we can propagate pre-computed IDLs */
224 BDB_IDL_CPY( save, ids );
226 for ( f = flist; f != NULL; f = f->f_next ) {
227 rc = bdb_filter_candidates( op, f, save, tmp,
228 save+BDB_IDL_UM_SIZE );
231 if ( ftype == LDAP_FILTER_AND ) {
239 if ( ftype == LDAP_FILTER_AND ) {
241 BDB_IDL_CPY( ids, save );
243 bdb_idl_intersection( ids, save );
245 if( BDB_IDL_IS_ZERO( ids ) )
249 BDB_IDL_CPY( ids, save );
251 bdb_idl_union( ids, save );
256 if( rc == LDAP_SUCCESS ) {
258 LDAP_LOG ( INDEX, RESULTS,
259 "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n",
260 (long) ids[0], (long) BDB_IDL_FIRST( ids ),
261 (long) BDB_IDL_LAST( ids ) );
263 Debug( LDAP_DEBUG_FILTER,
264 "<= bdb_list_candidates: id=%ld first=%ld last=%ld\n",
266 (long) BDB_IDL_FIRST(ids),
267 (long) BDB_IDL_LAST(ids) );
272 LDAP_LOG ( INDEX, ARGS, "<= bdb_list_candidates: rc=%d\n", rc, 0, 0 );
274 Debug( LDAP_DEBUG_FILTER,
275 "<= bdb_list_candidates: undefined rc=%d\n",
286 AttributeDescription *desc,
289 struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
293 struct berval prefix = {0, NULL};
296 LDAP_LOG ( INDEX, ENTRY, "=> bdb_presence_candidates (%s)\n",
297 desc->ad_cname.bv_val, 0, 0 );
299 Debug( LDAP_DEBUG_TRACE, "=> bdb_presence_candidates (%s)\n",
300 desc->ad_cname.bv_val, 0, 0 );
303 if( desc == slap_schema.si_ad_objectClass ) {
304 BDB_IDL_ALL( bdb, ids );
308 rc = bdb_index_param( op->o_bd, desc, LDAP_FILTER_PRESENT,
309 &db, &mask, &prefix );
311 if( rc != LDAP_SUCCESS ) {
313 LDAP_LOG ( INDEX, RESULTS,
314 "<= bdb_presence_candidates: (%s) index_param "
316 desc->ad_cname.bv_val, rc, 0 );
318 Debug( LDAP_DEBUG_TRACE,
319 "<= bdb_presence_candidates: (%s) index_param "
321 desc->ad_cname.bv_val, rc, 0 );
329 LDAP_LOG(INDEX, RESULTS,
330 "<= bdb_presence_candidates: (%s) not indexed\n",
331 desc->ad_cname.bv_val, 0, 0 );
333 Debug( LDAP_DEBUG_TRACE,
334 "<= bdb_presence_candidates: (%s) not indexed\n",
335 desc->ad_cname.bv_val, 0, 0 );
340 if( prefix.bv_val == NULL ) {
342 LDAP_LOG(INDEX, RESULTS,
343 "<= bdb_presence_candidates: (%s) no prefix\n",
344 desc->ad_cname.bv_val, 0, 0 );
346 Debug( LDAP_DEBUG_TRACE,
347 "<= bdb_presence_candidates: (%s) no prefix\n",
348 desc->ad_cname.bv_val, 0, 0 );
353 rc = bdb_key_read( op->o_bd, db, NULL, &prefix, ids );
355 if( rc == DB_NOTFOUND ) {
358 } else if( rc != LDAP_SUCCESS ) {
360 LDAP_LOG ( INDEX, RESULTS,
361 "<= bdb_presence_candidates: (%s) "
362 "key read failed (%d)\n",
363 desc->ad_cname.bv_val, rc, 0 );
365 Debug( LDAP_DEBUG_TRACE,
366 "<= bdb_presense_candidates: (%s) "
367 "key read failed (%d)\n",
368 desc->ad_cname.bv_val, rc, 0 );
374 LDAP_LOG ( INDEX, RESULTS,
375 "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n",
376 (long)ids[0], (long)BDB_IDL_FIRST( ids ), (long)BDB_IDL_LAST( ids ) );
378 Debug(LDAP_DEBUG_TRACE,
379 "<= bdb_presence_candidates: id=%ld first=%ld last=%ld\n",
381 (long) BDB_IDL_FIRST(ids),
382 (long) BDB_IDL_LAST(ids) );
392 AttributeAssertion *ava,
400 struct berval prefix = {0, NULL};
401 struct berval *keys = NULL;
405 LDAP_LOG ( INDEX, ENTRY, "=> bdb_equality_candidates (%s)\n",
406 ava->aa_desc->ad_cname.bv_val, 0, 0 );
408 Debug( LDAP_DEBUG_TRACE, "=> bdb_equality_candidates (%s)\n",
409 ava->aa_desc->ad_cname.bv_val, 0, 0 );
412 rc = bdb_index_param( op->o_bd, ava->aa_desc, LDAP_FILTER_EQUALITY,
413 &db, &mask, &prefix );
415 if( rc != LDAP_SUCCESS ) {
417 LDAP_LOG ( INDEX, RESULTS,
418 "<= bdb_equality_candidates: (%s) "
419 "index_param failed (%d)\n",
420 ava->aa_desc->ad_cname.bv_val, rc, 0);
422 Debug( LDAP_DEBUG_ANY,
423 "<= bdb_equality_candidates: (%s) "
424 "index_param failed (%d)\n",
425 ava->aa_desc->ad_cname.bv_val, rc, 0 );
432 LDAP_LOG(INDEX, RESULTS,
433 "<= bdb_equality_candidates: (%s) not indexed\n",
434 ava->aa_desc->ad_cname.bv_val, 0, 0 );
436 Debug( LDAP_DEBUG_ANY,
437 "<= bdb_equality_candidates: (%s) not indexed\n",
438 ava->aa_desc->ad_cname.bv_val, 0, 0 );
443 mr = ava->aa_desc->ad_type->sat_equality;
448 if( !mr->smr_filter ) {
452 rc = (mr->smr_filter)(
453 LDAP_FILTER_EQUALITY,
455 ava->aa_desc->ad_type->sat_syntax,
459 &keys, op->o_tmpmemctx );
461 if( rc != LDAP_SUCCESS ) {
463 LDAP_LOG ( INDEX, RESULTS,
464 "<= bdb_equality_candidates: (%s, %s) "
465 "MR filter failed (%d)\n",
466 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
468 Debug( LDAP_DEBUG_TRACE,
469 "<= bdb_equality_candidates: (%s, %s) "
470 "MR filter failed (%d)\n",
471 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
478 LDAP_LOG ( INDEX, RESULTS,
479 "<= bdb_equality_candidates: (%s) no keys\n",
480 ava->aa_desc->ad_cname.bv_val, 0, 0 );
482 Debug( LDAP_DEBUG_TRACE,
483 "<= bdb_equality_candidates: (%s) no keys\n",
484 ava->aa_desc->ad_cname.bv_val, 0, 0 );
489 for ( i= 0; keys[i].bv_val != NULL; i++ ) {
490 rc = bdb_key_read( op->o_bd, db, NULL, &keys[i], tmp );
492 if( rc == DB_NOTFOUND ) {
496 } else if( rc != LDAP_SUCCESS ) {
498 LDAP_LOG ( INDEX, RESULTS,
499 "<= bdb_equality_candidates: (%s) "
500 "key read failed (%d)\n",
501 ava->aa_desc->ad_cname.bv_val, rc, 0 );
503 Debug( LDAP_DEBUG_TRACE,
504 "<= bdb_equality_candidates: (%s) "
505 "key read failed (%d)\n",
506 ava->aa_desc->ad_cname.bv_val, rc, 0 );
511 if( BDB_IDL_IS_ZERO( tmp ) ) {
513 LDAP_LOG ( INDEX, RESULTS,
514 "<= bdb_equality_candidates: (%s) NULL\n",
515 ava->aa_desc->ad_cname.bv_val, 0, 0);
517 Debug( LDAP_DEBUG_TRACE,
518 "<= bdb_equality_candidates: (%s) NULL\n",
519 ava->aa_desc->ad_cname.bv_val, 0, 0 );
526 BDB_IDL_CPY( ids, tmp );
528 bdb_idl_intersection( ids, tmp );
531 if( BDB_IDL_IS_ZERO( ids ) )
535 ber_bvarray_free_x( keys, op->o_tmpmemctx );
538 LDAP_LOG ( INDEX, RESULTS,
539 "<= bdb_equality_candidates: id=%ld first=%ld last=%ld\n",
540 (long) ids[0], (long) BDB_IDL_FIRST( ids ),
541 (long) BDB_IDL_LAST( ids ) );
543 Debug( LDAP_DEBUG_TRACE,
544 "<= bdb_equality_candidates: id=%ld, first=%ld, last=%ld\n",
546 (long) BDB_IDL_FIRST(ids),
547 (long) BDB_IDL_LAST(ids) );
556 AttributeAssertion *ava,
564 struct berval prefix = {0, NULL};
565 struct berval *keys = NULL;
569 LDAP_LOG ( INDEX, ENTRY, "=> bdb_approx_candidates (%s)\n",
570 ava->aa_desc->ad_cname.bv_val, 0, 0 );
572 Debug( LDAP_DEBUG_TRACE, "=> bdb_approx_candidates (%s)\n",
573 ava->aa_desc->ad_cname.bv_val, 0, 0 );
576 rc = bdb_index_param( op->o_bd, ava->aa_desc, LDAP_FILTER_APPROX,
577 &db, &mask, &prefix );
579 if( rc != LDAP_SUCCESS ) {
581 LDAP_LOG ( INDEX, RESULTS,
582 "<= bdb_approx_candidates: (%s) "
583 "index_param failed (%d)\n",
584 ava->aa_desc->ad_cname.bv_val, rc, 0 );
586 Debug( LDAP_DEBUG_ANY,
587 "<= bdb_approx_candidates: (%s) "
588 "index_param failed (%d)\n",
589 ava->aa_desc->ad_cname.bv_val, rc, 0 );
596 LDAP_LOG(INDEX, RESULTS,
597 "<= bdb_approx_candidates: (%s) not indexed\n",
598 ava->aa_desc->ad_cname.bv_val, 0, 0 );
600 Debug( LDAP_DEBUG_ANY,
601 "<= bdb_approx_candidates: (%s) not indexed\n",
602 ava->aa_desc->ad_cname.bv_val, 0, 0 );
607 mr = ava->aa_desc->ad_type->sat_approx;
609 /* no approx matching rule, try equality matching rule */
610 mr = ava->aa_desc->ad_type->sat_equality;
617 if( !mr->smr_filter ) {
621 rc = (mr->smr_filter)(
624 ava->aa_desc->ad_type->sat_syntax,
628 &keys, op->o_tmpmemctx );
630 if( rc != LDAP_SUCCESS ) {
632 LDAP_LOG ( INDEX, RESULTS,
633 "<= bdb_approx_candidates: (%s, %s) "
634 "MR filter failed (%d)\n",
635 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
637 Debug( LDAP_DEBUG_TRACE,
638 "<= bdb_approx_candidates: (%s, %s) "
639 "MR filter failed (%d)\n",
640 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, rc );
647 LDAP_LOG ( INDEX, RESULTS,
648 "<= bdb_approx_candidates: (%s) no keys (%s)\n",
649 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, 0 );
651 Debug( LDAP_DEBUG_TRACE,
652 "<= bdb_approx_candidates: (%s) no keys (%s)\n",
653 prefix.bv_val, ava->aa_desc->ad_cname.bv_val, 0 );
658 for ( i= 0; keys[i].bv_val != NULL; i++ ) {
659 rc = bdb_key_read( op->o_bd, db, NULL, &keys[i], tmp );
661 if( rc == DB_NOTFOUND ) {
665 } else if( rc != LDAP_SUCCESS ) {
667 LDAP_LOG ( INDEX, RESULTS,
668 "<= bdb_approx_candidates: (%s) "
669 "key read failed (%d)\n",
670 ava->aa_desc->ad_cname.bv_val, rc, 0);
672 Debug( LDAP_DEBUG_TRACE,
673 "<= bdb_approx_candidates: (%s) "
674 "key read failed (%d)\n",
675 ava->aa_desc->ad_cname.bv_val, rc, 0 );
680 if( BDB_IDL_IS_ZERO( tmp ) ) {
682 LDAP_LOG ( INDEX, RESULTS,
683 "<= bdb_approx_candidates: (%s) NULL\n",
684 ava->aa_desc->ad_cname.bv_val, 0, 0 );
686 Debug( LDAP_DEBUG_TRACE,
687 "<= bdb_approx_candidates: (%s) NULL\n",
688 ava->aa_desc->ad_cname.bv_val, 0, 0 );
695 BDB_IDL_CPY( ids, tmp );
697 bdb_idl_intersection( ids, tmp );
700 if( BDB_IDL_IS_ZERO( ids ) )
704 ber_bvarray_free_x( keys, op->o_tmpmemctx );
707 LDAP_LOG ( INDEX, RESULTS,
708 "<= bdb_approx_candidates: id=%ld first=%ld last=%ld\n",
709 (long) ids[0], (long) BDB_IDL_FIRST( ids ),
710 (long) BDB_IDL_LAST( ids ) );
712 Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates %ld, first=%ld, last=%ld\n",
714 (long) BDB_IDL_FIRST(ids),
715 (long) BDB_IDL_LAST(ids) );
721 substring_candidates(
723 SubstringsAssertion *sub,
731 struct berval prefix = {0, NULL};
732 struct berval *keys = NULL;
736 LDAP_LOG ( INDEX, ENTRY, "=> bdb_substring_candidates (%s)\n",
737 sub->sa_desc->ad_cname.bv_val, 0, 0 );
739 Debug( LDAP_DEBUG_TRACE, "=> bdb_substring_candidates (%s)\n",
740 sub->sa_desc->ad_cname.bv_val, 0, 0 );
743 rc = bdb_index_param( op->o_bd, sub->sa_desc, LDAP_FILTER_SUBSTRINGS,
744 &db, &mask, &prefix );
746 if( rc != LDAP_SUCCESS ) {
748 LDAP_LOG ( INDEX, RESULTS,
749 "<= bdb_substring_candidates: (%s) "
750 "index_param failed (%d)\n",
751 sub->sa_desc->ad_cname.bv_val, rc, 0);
753 Debug( LDAP_DEBUG_ANY,
754 "<= bdb_substring_candidates: (%s) "
755 "index_param failed (%d)\n",
756 sub->sa_desc->ad_cname.bv_val, rc, 0 );
763 LDAP_LOG ( INDEX, RESULTS,
764 "<= bdb_substring_candidates: (%s) not indexed\n",
765 sub->sa_desc->ad_cname.bv_val, 0, 0 );
767 Debug( LDAP_DEBUG_ANY,
768 "<= bdb_substring_candidates: (%s) not indexed\n",
769 sub->sa_desc->ad_cname.bv_val, 0, 0 );
774 mr = sub->sa_desc->ad_type->sat_substr;
780 if( !mr->smr_filter ) {
784 rc = (mr->smr_filter)(
785 LDAP_FILTER_SUBSTRINGS,
787 sub->sa_desc->ad_type->sat_syntax,
791 &keys, op->o_tmpmemctx );
793 if( rc != LDAP_SUCCESS ) {
795 LDAP_LOG ( INDEX, RESULTS,
796 "<= bdb_substring_candidates: (%s) "
797 "MR filter failed (%d)\n",
798 sub->sa_desc->ad_cname.bv_val, rc, 0 );
800 Debug( LDAP_DEBUG_TRACE,
801 "<= bdb_substring_candidates: (%s) "
802 "MR filter failed (%d)\n",
803 sub->sa_desc->ad_cname.bv_val, rc, 0 );
810 LDAP_LOG ( INDEX, RESULTS,
811 "<= bdb_substring_candidates: (0x%04lx) no keys (%s)\n",
812 mask, sub->sa_desc->ad_cname.bv_val, 0 );
814 Debug( LDAP_DEBUG_TRACE,
815 "<= bdb_substring_candidates: (0x%04lx) no keys (%s)\n",
816 mask, sub->sa_desc->ad_cname.bv_val, 0 );
821 for ( i= 0; keys[i].bv_val != NULL; i++ ) {
822 rc = bdb_key_read( op->o_bd, db, NULL, &keys[i], tmp );
824 if( rc == DB_NOTFOUND ) {
828 } else if( rc != LDAP_SUCCESS ) {
830 LDAP_LOG ( INDEX, RESULTS,
831 "<= bdb_substring_candidates: (%s) "
832 "key read failed (%d)\n",
833 sub->sa_desc->ad_cname.bv_val, rc, 0 );
835 Debug( LDAP_DEBUG_TRACE,
836 "<= bdb_substring_candidates: (%s) "
837 "key read failed (%d)\n",
838 sub->sa_desc->ad_cname.bv_val, rc, 0 );
843 if( BDB_IDL_IS_ZERO( tmp ) ) {
845 LDAP_LOG ( INDEX, RESULTS,
846 "<= bdb_substring_candidates: (%s) NULL\n",
847 sub->sa_desc->ad_cname.bv_val, 0, 0 );
849 Debug( LDAP_DEBUG_TRACE,
850 "<= bdb_substring_candidates: (%s) NULL\n",
851 sub->sa_desc->ad_cname.bv_val, 0, 0 );
858 BDB_IDL_CPY( ids, tmp );
860 bdb_idl_intersection( ids, tmp );
863 if( BDB_IDL_IS_ZERO( ids ) )
867 ber_bvarray_free_x( keys, op->o_tmpmemctx );
870 LDAP_LOG ( INDEX, RESULTS,
871 "<= bdb_substring_candidates: id=%ld first=%ld last=%ld\n",
872 (long) ids[0], (long) BDB_IDL_FIRST( ids ),
873 (long) BDB_IDL_LAST( ids ) );
875 Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates: %ld, first=%ld, last=%ld\n",
877 (long) BDB_IDL_FIRST(ids),
878 (long) BDB_IDL_LAST(ids) );