]> git.sur5r.net Git - openldap/commitdiff
Debugging aid for prev commit
authorHoward Chu <hyc@openldap.org>
Wed, 19 Jan 2005 06:30:08 +0000 (06:30 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 19 Jan 2005 06:30:08 +0000 (06:30 +0000)
servers/slapd/back-bdb/idl.c

index 2f2c08972f50b2cf87723944e750e61944f057d5..0022e401f6b7075d6b03f1e4a5bc28a6f2ebca33 100644 (file)
@@ -441,7 +441,14 @@ bdb_idl_fetch_key(
 #if DB_VERSION_FULL < 0x04010000
 #      define BDB_ENOUGH 5
 #else
+       /* We sometimes test with tiny IDLs, and BDB always wants buffers
+        * that are at least one page in size.
+        */
+# if BDB_IDL_SIZE < 4096
+#   define BDB_ENOUGH 2048
+# else
 #      define BDB_ENOUGH 1
+# endif
 #endif
        ID buf[BDB_IDL_DB_SIZE*BDB_ENOUGH];
 
@@ -683,8 +690,8 @@ bdb_idl_insert_key(
                                /* Update hi/lo if needed, then delete all the items
                                 * between lo and hi
                                 */
+                               data.data = &nid;
                                if ( id > hi ) {
-                                       nhi = nid;
                                        rc = cursor->c_del( cursor, 0 );
                                        if ( rc != 0 ) {
                                                err = "c_del hi";
@@ -704,7 +711,6 @@ bdb_idl_insert_key(
                                        err = "c_get 2";
                                        goto fail;
                                }
-                               data.data = &nid;
                                if ( id < lo ) {
                                        rc = cursor->c_del( cursor, 0 );
                                        if ( rc != 0 ) {