mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
DB-785 add a txn api to check if a txn is prepared
This commit is contained in:
parent
ef0269a5f7
commit
906c8b2794
2 changed files with 7 additions and 0 deletions
|
@ -585,6 +585,7 @@ static void print_db_txn_struct (void) {
|
|||
"uint64_t (*id64) (DB_TXN*)",
|
||||
"void (*set_client_id)(DB_TXN *, uint64_t client_id)",
|
||||
"uint64_t (*get_client_id)(DB_TXN *)",
|
||||
"bool (*is_prepared)(DB_TXN *)",
|
||||
NULL};
|
||||
sort_and_dump_fields("db_txn", false, extra);
|
||||
}
|
||||
|
|
|
@ -421,6 +421,11 @@ static int toku_txn_discard(DB_TXN *txn, uint32_t flags) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool toku_txn_is_prepared(DB_TXN *txn) {
|
||||
TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn;
|
||||
return toku_txn_get_state(ttxn) == TOKUTXN_PREPARING;
|
||||
}
|
||||
|
||||
static inline void txn_func_init(DB_TXN *txn) {
|
||||
#define STXN(name) txn->name = locked_txn_ ## name
|
||||
STXN(abort);
|
||||
|
@ -437,6 +442,7 @@ static inline void txn_func_init(DB_TXN *txn) {
|
|||
SUTXN(discard);
|
||||
#undef SUTXN
|
||||
txn->id64 = toku_txn_id64;
|
||||
txn->is_prepared = toku_txn_is_prepared;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue