diff options
author | unknown <jan@hundin.mysql.fi> | 2004-11-30 11:45:02 +0200 |
---|---|---|
committer | unknown <jan@hundin.mysql.fi> | 2004-11-30 11:45:02 +0200 |
commit | 818fc0253c318583423571a5927c1d4439c4b9bc (patch) | |
tree | cb2f2ad9f5ccc63eec024ffada123df6cf2e74ba /sql/ha_innodb.h | |
parent | 60bb0fddbeb68dfba1df0ed8874bd517cde92bb8 (diff) | |
download | mariadb-git-818fc0253c318583423571a5927c1d4439c4b9bc.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 'sql/ha_innodb.h')
-rw-r--r-- | sql/ha_innodb.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 5ec5c207456..a62c754707c 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -243,3 +243,46 @@ void innobase_release_temporary_latches(void* innobase_tid); void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset); int innobase_start_trx_and_assign_read_view(THD* thd); + +/*********************************************************************** +This function is used to prepare X/Open XA distributed transaction */ + +int innobase_xa_prepare( +/*====================*/ + /* out: 0 or error number */ + THD* thd, /* in: handle to the MySQL thread of the user + whose XA transaction should be prepared */ + bool all); /* in: TRUE - commit transaction + FALSE - the current SQL statement ended */ + +/*********************************************************************** +This function is used to recover X/Open XA distributed transactions */ + +int innobase_xa_recover( +/*====================*/ + /* out: number of prepared transactions + stored in xid_list */ + XID* xid_list, /* in/out: prepared transactions */ + uint len); /* in: number of slots in xid_list */ + +/*********************************************************************** +This function is used to commit one X/Open XA distributed transaction +which is in the prepared state */ + +int innobase_commit_by_xid( +/*=======================*/ + /* out: 0 or error number */ + XID* xid); /* in : X/Open XA Transaction Identification */ + +/*********************************************************************** +This function is used to rollback one X/Open XA distributed transaction +which is in the prepared state */ + +int innobase_rollback_by_xid( + /* out: 0 or error number */ + XID *xid); /* in : X/Open XA Transaction Idenfification */ + + +int innobase_xa_end(THD *thd); + + |