summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/examples
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2018-02-08 17:31:44 +1100
committerLuke Chen <luke.chen@mongodb.com>2018-02-08 17:31:44 +1100
commit7574817caec09fa1a2ab5ea60f00f766da63f9cd (patch)
tree6663806102c99c609c86b856409d6496179e4195 /src/third_party/wiredtiger/examples
parent34d2da2cfb93244818ecb55843f58d359151198d (diff)
downloadmongo-7574817caec09fa1a2ab5ea60f00f766da63f9cd.tar.gz
Import wiredtiger: a6e72378a60249228730667a2cba9a90c454b786 from branch mongodb-3.8
ref: 06a940e28a..a6e72378a6 for: 3.7.2 WT-3766 Lookaside sweep for obsolete updates WT-3840 Dump more information when data corruption is encountered WT-3847 Add a stub API for prepared transaction WT-3854 Remove write lock from commit path, leaving old entries in queue WT-3866 Bi-weekly WT codebase lint WT-3877 WT_CONN_EVICTION_NO_LOOKASIDE is cleared unconditionally WT-3878 Iteration can lose its position when updating a limbo page WT-3881 key timestamp consistency checking should not check its own updates WT-3887 log operations in format snapshot-isolation tracking WT-3888 cursor search-near can return the wrong value for "exact" WT-3889 format key-order return failure in LSM WT-3890 core dump walking timestamp queue WT-3891 Take the sweep walk rwlock whenever removing content from lookaside WT-3895 Commit timestamp queue getting out of order
Diffstat (limited to 'src/third_party/wiredtiger/examples')
-rw-r--r--src/third_party/wiredtiger/examples/c/ex_all.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/examples/c/ex_all.c b/src/third_party/wiredtiger/examples/c/ex_all.c
index 7091a0a76d6..8e40b9f0b6c 100644
--- a/src/third_party/wiredtiger/examples/c/ex_all.c
+++ b/src/third_party/wiredtiger/examples/c/ex_all.c
@@ -900,6 +900,21 @@ transaction_ops(WT_SESSION *session_arg)
error_check(session->commit_transaction(session, NULL));
/*! [transaction isolation] */
+ /*! [transaction prepare] */
+ /*
+ * Prepare a transaction which guarantees a subsequent commit will
+ * succeed. Only commit and rollback are allowed on a transaction after
+ * it has been prepared.
+ */
+ error_check(session->open_cursor(
+ session, "table:mytable", NULL, NULL, &cursor));
+ error_check(session->begin_transaction(session, NULL));
+ cursor->set_key(cursor, "key");
+ cursor->set_value(cursor, "value");
+ session->prepare_transaction(session, "prepare_timestamp=2a");
+ error_check(session->commit_transaction(session, NULL));
+ /*! [transaction prepare] */
+
/*! [session isolation configuration] */
/* Open a session configured for read-uncommitted isolation. */
error_check(conn->open_session(