summaryrefslogtreecommitdiff
path: root/innobase/trx/trx0sys.c
diff options
context:
space:
mode:
authorunknown <jan@hundin.mysql.fi>2004-11-30 11:45:02 +0200
committerunknown <jan@hundin.mysql.fi>2004-11-30 11:45:02 +0200
commitdf0e057a52db9f085c42ec593f3000da4afdbbd7 (patch)
treecb2f2ad9f5ccc63eec024ffada123df6cf2e74ba /innobase/trx/trx0sys.c
parentf4110834a374dc647f2cba4d7bceaa88dc9d66e9 (diff)
downloadmariadb-git-df0e057a52db9f085c42ec593f3000da4afdbbd7.tar.gz
Added support for X/Open XA prepare, recover, commit and rollback.
innobase/include/trx0roll.h: Changed prototype of the function trx_rollback_or_clean_all_without_sess because this function is executed in a background thread. innobase/include/trx0trx.h: Added support for X/Open XA prepare, recover and search by X/Open XA XID. innobase/include/trx0undo.h: Added support for X/Open XA prepare and recover. We need to store X/Open XA XID to the undo log header for recovery. innobase/log/log0recv.c: Create a thread to run trx_rollback_or_clean_all_without_sess function to rollback the uncommitted transactions which have no user session. innobase/row/row0ins.c: Remove unnecessary variables. innobase/trx/trx0roll.c: Changed so that trx_rollback_or_clean_all_without_sess is executed in a background thread. We should also leave all prepared transactions active to wait for commit or abort from MySQL. innobase/trx/trx0sys.c: Only those rows which belong to the active transaction in crash recovery are undone. innobase/trx/trx0trx.c: Added support for X/Open XA prepare and recover. We need to store X/Open XA XID to trx structure and left prepared transactions to wait for a commit or abort from MySQL. This requires also that we add TRX_PREPARED state to the transaction and TRX_UNDO_PREPARED state for undo logs. innobase/trx/trx0undo.c: Added support for X/Open XA prepare and recover. We need to store X/Open XA XID to undo log header for recovery of distributed transactions. sql/ha_innodb.h: Added prototypes for X/Open XA prepare, recover, commit and rollback. sql/handler.h: Added definition for X/Open XA XID structure.
Diffstat (limited to 'innobase/trx/trx0sys.c')
-rw-r--r--innobase/trx/trx0sys.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c
index 54bd5be01a1..35e18064329 100644
--- a/innobase/trx/trx0sys.c
+++ b/innobase/trx/trx0sys.c
@@ -887,8 +887,12 @@ trx_sys_init_at_db_start(void)
trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
for (;;) {
- rows_to_undo +=
+
+ if ( trx->conc_state != TRX_PREPARED) {
+ rows_to_undo +=
ut_conv_dulint_to_longlong(trx->undo_no);
+ }
+
trx = UT_LIST_GET_NEXT(trx_list, trx);
if (!trx) {