mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 16:49:39 -05:00
Don't use DB_AUTO_COMMIT when opening a database
This commit is contained in:
parent
c79c13d480
commit
a0c58e5f40
5 changed files with 11 additions and 9 deletions
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
LDAP_BEGIN_DECL
|
||||
|
||||
/* #define BDB_HIER 1 */
|
||||
#define BDB_HIER 1
|
||||
|
||||
#define DN_BASE_PREFIX SLAP_INDEX_EQUALITY_PREFIX
|
||||
#define DN_ONE_PREFIX '%'
|
||||
|
|
@ -160,7 +160,7 @@ struct bdb_op_info {
|
|||
int boi_acl_cache;
|
||||
};
|
||||
|
||||
#define DB_OPEN(db, file, name, type, flags, mode) \
|
||||
#define DB_OPEN(db, txn, file, name, type, flags, mode) \
|
||||
(db)->open(db, file, name, type, flags, mode)
|
||||
|
||||
#if DB_VERSION_MAJOR < 4
|
||||
|
|
@ -191,8 +191,8 @@ struct bdb_op_info {
|
|||
/* BDB 4.1.17 adds txn arg to db->open */
|
||||
#if DB_VERSION_MINOR > 1 || DB_VERSION_PATCH >= 17
|
||||
#undef DB_OPEN
|
||||
#define DB_OPEN(db, file, name, type, flags, mode) \
|
||||
(db)->open(db, NULL, file, name, type, (flags)|DB_AUTO_COMMIT, mode)
|
||||
#define DB_OPEN(db, txn, file, name, type, flags, mode) \
|
||||
(db)->open(db, txn, file, name, type, flags, mode)
|
||||
#endif
|
||||
|
||||
#define BDB_REUSE_LOCKERS
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ bdb_db_hash(
|
|||
int
|
||||
bdb_db_cache(
|
||||
Backend *be,
|
||||
DB_TXN *tid,
|
||||
const char *name,
|
||||
DB **dbout )
|
||||
{
|
||||
|
|
@ -110,7 +111,7 @@ bdb_db_cache(
|
|||
#ifdef HAVE_EBCDIC
|
||||
__atoe( file );
|
||||
#endif
|
||||
rc = DB_OPEN( db->bdi_db,
|
||||
rc = DB_OPEN( db->bdi_db, tid,
|
||||
file, name,
|
||||
DB_HASH, bdb->bi_db_opflags | DB_CREATE | DB_THREAD,
|
||||
bdb->bi_dbenv_mode );
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ int bdb_index_param(
|
|||
return LDAP_INAPPROPRIATE_MATCHING;
|
||||
}
|
||||
|
||||
rc = bdb_db_cache( be, dbname, &db );
|
||||
rc = bdb_db_cache( be, NULL, dbname, &db );
|
||||
|
||||
if( rc != LDAP_SUCCESS ) {
|
||||
return rc;
|
||||
|
|
@ -165,7 +165,7 @@ static int indexer(
|
|||
|
||||
assert( mask );
|
||||
|
||||
rc = bdb_db_cache( be, dbname, &db );
|
||||
rc = bdb_db_cache( be, txn, dbname, &db );
|
||||
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
#ifdef NEW_LOGGING
|
||||
|
|
|
|||
|
|
@ -380,14 +380,14 @@ bdb_db_open( BackendDB *be )
|
|||
#ifdef HAVE_EBCDIC
|
||||
strcpy( path, bdbi_databases[i].file );
|
||||
__atoe( path );
|
||||
rc = DB_OPEN( db->bdi_db,
|
||||
rc = DB_OPEN( db->bdi_db, NULL,
|
||||
path,
|
||||
/* bdbi_databases[i].name, */ NULL,
|
||||
bdbi_databases[i].type,
|
||||
bdbi_databases[i].flags | flags,
|
||||
bdb->bi_dbenv_mode );
|
||||
#else
|
||||
rc = DB_OPEN( db->bdi_db,
|
||||
rc = DB_OPEN( db->bdi_db, NULL,
|
||||
bdbi_databases[i].file,
|
||||
/* bdbi_databases[i].name, */ NULL,
|
||||
bdbi_databases[i].type,
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ BI_acl_attribute bdb_attribute;
|
|||
int
|
||||
bdb_db_cache(
|
||||
Backend *be,
|
||||
DB_TXN *tid,
|
||||
const char *name,
|
||||
DB **db );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue