Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
068416d3
Commit
068416d3
authored
Jan 02, 2015
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DB-785 add a txn api to check if a txn is prepared
parent
8e193934
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
buildheader/make_tdb.cc
buildheader/make_tdb.cc
+1
-0
src/ydb_txn.cc
src/ydb_txn.cc
+6
-0
No files found.
buildheader/make_tdb.cc
View file @
068416d3
...
@@ -585,6 +585,7 @@ static void print_db_txn_struct (void) {
...
@@ -585,6 +585,7 @@ static void print_db_txn_struct (void) {
"uint64_t (*id64) (DB_TXN*)"
,
"uint64_t (*id64) (DB_TXN*)"
,
"void (*set_client_id)(DB_TXN *, uint64_t client_id)"
,
"void (*set_client_id)(DB_TXN *, uint64_t client_id)"
,
"uint64_t (*get_client_id)(DB_TXN *)"
,
"uint64_t (*get_client_id)(DB_TXN *)"
,
"bool (*is_prepared)(DB_TXN *)"
,
NULL
};
NULL
};
sort_and_dump_fields
(
"db_txn"
,
false
,
extra
);
sort_and_dump_fields
(
"db_txn"
,
false
,
extra
);
}
}
...
...
src/ydb_txn.cc
View file @
068416d3
...
@@ -421,6 +421,11 @@ static int toku_txn_discard(DB_TXN *txn, uint32_t flags) {
...
@@ -421,6 +421,11 @@ static int toku_txn_discard(DB_TXN *txn, uint32_t flags) {
return
0
;
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
)
{
static
inline
void
txn_func_init
(
DB_TXN
*
txn
)
{
#define STXN(name) txn->name = locked_txn_ ## name
#define STXN(name) txn->name = locked_txn_ ## name
STXN
(
abort
);
STXN
(
abort
);
...
@@ -437,6 +442,7 @@ static inline void txn_func_init(DB_TXN *txn) {
...
@@ -437,6 +442,7 @@ static inline void txn_func_init(DB_TXN *txn) {
SUTXN
(
discard
);
SUTXN
(
discard
);
#undef SUTXN
#undef SUTXN
txn
->
id64
=
toku_txn_id64
;
txn
->
id64
=
toku_txn_id64
;
txn
->
is_prepared
=
toku_txn_is_prepared
;
}
}
//
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment