db51/bdb-transactions.diff

40 lines
1.3 KiB
Diff

--- db4-4.2.52/dbinc/db.in.orig 2004-09-09 18:29:17.987387000 -0700
+++ db4-4.2.52/dbinc/db.in 2004-09-09 18:30:00.547903000 -0700
@@ -839,6 +839,7 @@
#define TXN_NOWAIT 0x040 /* Do not wait on locks. */
#define TXN_RESTORED 0x080 /* Transaction has been restored. */
#define TXN_SYNC 0x100 /* Sync on prepare and commit. */
+#define TXN_NOLOG 0x200 /* Do not log this transaction. */
u_int32_t flags;
};
--- db4-4.2.52/txn/txn.c.orig 2004-09-09 18:30:36.348345000 -0700
+++ db4-4.2.52/txn/txn.c 2004-09-09 18:32:14.559561000 -0700
@@ -127,7 +127,7 @@
if ((ret = __db_fchk(dbenv,
"txn_begin", flags,
DB_DIRTY_READ | DB_TXN_NOWAIT |
- DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0)
+ DB_TXN_NOSYNC | DB_TXN_SYNC | DB_TXN_NOT_DURABLE )) != 0)
return (ret);
if ((ret = __db_fcchk(dbenv,
"txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
@@ -193,6 +193,8 @@
F_SET(txn, TXN_SYNC);
if (LF_ISSET(DB_TXN_NOWAIT))
F_SET(txn, TXN_NOWAIT);
+ if (LF_ISSET(DB_TXN_NOT_DURABLE))
+ F_SET(txn, TXN_NOLOG);
if ((ret = __txn_begin_int(txn, 0)) != 0)
goto err;
@@ -328,7 +330,7 @@
* We should set this value when we write the first log record, not
* here.
*/
- if (DBENV_LOGGING(dbenv))
+ if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
__log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
else
ZERO_LSN(begin_lsn);