]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/index.c
ITS#5052 from HEAD
[openldap] / servers / slapd / back-bdb / index.c
index de4cf3d8363c3bb17e5d08da083252a18233ce3b..8e42369fd9a61294b42e3d9676a641968c24dbb6 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2006 The OpenLDAP Foundation.
+ * Copyright 2000-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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 );