]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/index.c
add paged results support to back-ldap
[openldap] / servers / slapd / back-bdb / index.c
index 7916d98442da3ef3b973869a9414b63833f8584d..e1f09f6fdc9becf71b4a457e5fba1e38dea59e6c 100644 (file)
@@ -1,8 +1,17 @@
 /* index.c - routines for dealing with attribute indexes */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2000-2004 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
 
 #include "portable.h"
@@ -112,9 +121,14 @@ int bdb_index_param(
                break;
 
        case LDAP_FILTER_APPROX:
-               if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) {
-                       goto done;
+               if ( desc->ad_type->sat_approx ) {
+                       if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) {
+                               goto done;
+                       }
+                       break;
                }
+
+               /* Use EQUALITY rule and index for approximate match */
                /* fall thru */
 
        case LDAP_FILTER_EQUALITY:
@@ -155,7 +169,6 @@ static int indexer(
        const char *text;
        DB *db;
        struct berval *keys;
-       void *mark;
 
        assert( mask );
 
@@ -174,10 +187,6 @@ static int indexer(
                return LDAP_OTHER;
        }
 
-#if 0  /* No longer needed, our frees are in order so nothing accumulates */
-       mark = sl_mark(op->o_tmpmemctx);
-#endif
-
        if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
                rc = bdb_key_change( op->o_bd, db, txn, &presence_key, id, opid );
                if( rc ) {
@@ -251,9 +260,6 @@ static int indexer(
        }
 
 done:
-#if 0
-       sl_release( mark, op->o_tmpmemctx );
-#endif
        return rc;
 }