]> git.sur5r.net Git - openldap/commitdiff
ITS#8678 temporary hack
authorHoward Chu <hyc@openldap.org>
Thu, 22 Jun 2017 17:08:40 +0000 (18:08 +0100)
committerHoward Chu <hyc@openldap.org>
Thu, 22 Jun 2017 17:09:48 +0000 (18:09 +0100)
servers/slapd/back-mdb/modify.c

index d5c5e151a1f06cda0795ae220cd2c3daa9e72d2f..6de49c29efc863158687f194b79a67812c945cde 100644 (file)
@@ -49,11 +49,20 @@ mdb_modify_idxflags(
                        ap = attr_find( oldattrs, desc );
                        if ( ap ) ap->a_flags |= SLAP_ATTR_IXDEL;
 
-                       /* Find all other attrs that index to same slot */
-                       for ( ap = newattrs; ap; ap = ap->a_next ) {
-                               ai = mdb_index_mask( op->o_bd, ap->a_desc, &ix2 );
-                               if ( ai && ix2.bv_val == ix_at.bv_val )
-                                       ap->a_flags |= SLAP_ATTR_IXADD;
+                       /* ITS#8678 FIXME
+                        * If using 32bit hashes, or substring index, must account for
+                        * possible index collisions. If no substring index, and using
+                        * 64bit hashes, assume we don't need to check for collisions.
+                        *
+                        * In 2.5 use refcounts and avoid all of this mess.
+                        */
+                       if (!slap_hash64(-1) || (ai->ai_indexmask & SLAP_INDEX_SUBSTR)) {
+                               /* Find all other attrs that index to same slot */
+                               for ( ap = newattrs; ap; ap = ap->a_next ) {
+                                       ai = mdb_index_mask( op->o_bd, ap->a_desc, &ix2 );
+                                       if ( ai && ix2.bv_val == ix_at.bv_val )
+                                               ap->a_flags |= SLAP_ATTR_IXADD;
+                               }
                        }
 
                } else {