]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-mdb/tools.c
ITS#7906 better fix
[openldap] / servers / slapd / back-mdb / tools.c
index a5408b5bb19fafa6f7f286addc322d5a46082b6b..0839d56784ed1571c669a3d58f0ccaaf2f795971 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2011-2013 The OpenLDAP Foundation.
+ * Copyright 2011-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -396,7 +396,7 @@ mdb_tool_entry_get_int( BackendDB *be, ID id, Entry **ep )
                        }
                }
        }
-       rc = mdb_entry_decode( &op, &data, &e );
+       rc = mdb_entry_decode( &op, txn, &data, &e );
        e->e_id = id;
        if ( !BER_BVISNULL( &dn )) {
                e->e_name = dn;
@@ -706,7 +706,9 @@ ID mdb_tool_entry_put(
                goto done;
        }
 
-       LDAP_SLIST_INSERT_HEAD( &op.o_extra, &mdb_tool_axinfo[0]->ai_oe, oe_next );
+       if ( mdb_tool_threads > 1 ) {
+               LDAP_SLIST_INSERT_HEAD( &op.o_extra, &mdb_tool_axinfo[0]->ai_oe, oe_next );
+       }
        rc = mdb_tool_index_add( &op, txn, e );
        if( rc != 0 ) {
                snprintf( text->bv_val, text->bv_len,
@@ -1419,7 +1421,7 @@ mdb_dn2id_upgrade( BackendDB *be ) {
                if (dkids > 1) {
                        rc = mdb_cursor_get(mc, &key, &data, MDB_NEXT_DUP);
 down:
-                       ptr = data.mv_data + data.mv_size - sizeof(ID);
+                       ptr = (unsigned char *)data.mv_data + data.mv_size - sizeof(ID);
                        memcpy(&id, ptr, sizeof(ID));
                        depth++;
                        memcpy(stack[depth].rdn, data.mv_data, data.mv_size);
@@ -1445,7 +1447,7 @@ pop:
                        goto leave;
                }
                data.mv_data = stack[depth].rdn;
-               ptr = data.mv_data + data.mv_size;
+               ptr = (unsigned char *)data.mv_data + data.mv_size;
                memcpy(ptr, &num[depth], sizeof(ID));
                data.mv_size += sizeof(ID);
                rc = mdb_cursor_del(mc, 0);