My Project
Public Types | Public Member Functions
TC_LOG Class Reference

#include <log.h>

Inheritance diagram for TC_LOG:
MYSQL_BIN_LOG TC_LOG_DUMMY

List of all members.

Public Types

enum  enum_result { RESULT_SUCCESS, RESULT_ABORTED, RESULT_INCONSISTENT }

Public Member Functions

int using_heuristic_recover ()
virtual int open (const char *opt_name)=0
virtual void close ()=0
virtual enum_result commit (THD *thd, bool all)=0
virtual int rollback (THD *thd, bool all)=0
virtual int prepare (THD *thd, bool all)=0

Detailed Description

Transaction Coordinator Log.

A base abstract class for three different implementations of the transaction coordinator.

The server uses the transaction coordinator to order transactions correctly and there are three different implementations: one using an in-memory structure, one dummy that does not do anything, and one using the binary log for transaction coordination.


Member Function Documentation

virtual enum_result TC_LOG::commit ( THD *  thd,
bool  all 
) [pure virtual]

Log a commit record of the transaction to the transaction coordinator log.

When the function returns, the transaction commit is properly logged to the transaction coordinator log and can be committed in the storage engines.

Parameters:
thdSession to log transaction for.
allTrue if this is a "real" commit, false if it is a "statement" commit.
Returns:
Error code on failure, zero on success.

Implemented in MYSQL_BIN_LOG, and TC_LOG_DUMMY.

virtual int TC_LOG::prepare ( THD *  thd,
bool  all 
) [pure virtual]

Log a prepare record of the transaction to the storage engines.

Parameters:
thdSession to log transaction record for.
alltrue if an explicit commit or an implicit commit for a statement, false if an internal commit of the statement.
Returns:
Error code on failure, zero on success.

Implemented in MYSQL_BIN_LOG, and TC_LOG_DUMMY.

virtual int TC_LOG::rollback ( THD *  thd,
bool  all 
) [pure virtual]

Log a rollback record of the transaction to the transaction coordinator log.

When the function returns, the transaction have been aborted in the transaction coordinator log.

Parameters:
thdSession to log transaction record for.
alltrue if an explicit commit or an implicit commit for a statement, false if an internal commit of the statement.
Returns:
Error code on failure, zero on success.

Implemented in MYSQL_BIN_LOG, and TC_LOG_DUMMY.

Perform heuristic recovery, if --tc-heuristic-recover was used.

Note:
no matter whether heuristic recovery was successful or not mysqld must exit. So, return value is the same in both cases.
Return values:
0no heuristic recovery was requested
1heuristic recovery was performed

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines