]> git.sur5r.net Git - openldap/commitdiff
ITS#5052 fix Quick mode erroneously indexing ID#0
authorHoward Chu <hyc@openldap.org>
Fri, 20 Jul 2007 14:42:31 +0000 (14:42 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 20 Jul 2007 14:42:31 +0000 (14:42 +0000)
servers/slapd/back-bdb/index.c

index 94d181de7e3dfe7a86d20d4f37228731d042a97b..3bf4fd136eebad75ca8fbfb7208517e88772a0c5 100644 (file)
@@ -435,6 +435,10 @@ int bdb_index_recrun(
        AttrList *al;
        int i, rc = 0;
 
+       /* Never index ID 0 */
+       if ( id == 0 )
+               return 0;
+
        for (i=base; i<bdb->bi_nattrs; i+=slap_tool_thread_max) {
                ir = ir0 + i;
                if ( !ir->ai ) continue;
@@ -472,6 +476,10 @@ bdb_index_entry(
        struct berval value = {0};
 #endif
 
+       /* Never index ID 0 */
+       if ( e->e_id == 0 )
+               return 0;
+
        Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
                opid == SLAP_INDEX_DELETE_OP ? "del" : "add",
                (long) e->e_id, e->e_dn );