Skip to content

Commit

Permalink
Extend trx_trx library
Browse files Browse the repository at this point in the history
  • Loading branch information
romz-pl committed Sep 5, 2019
1 parent bfbf6b2 commit c1170ea
Show file tree
Hide file tree
Showing 47 changed files with 1,072 additions and 885 deletions.
1 change: 0 additions & 1 deletion storage/innobase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ SET(INNOBASE_SOURCES
ut/ut0dbg.cc
ut/ut0list.cc
ut/ut0ut.cc
ut/ut0vec.cc
ut/ut0wqueue.cc)

IF(WITH_INNODB)
Expand Down
16 changes: 2 additions & 14 deletions storage/innobase/include/trx0roll.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,8 @@ struct roll_node_t {
que_thr_t *undo_thr; /*!< undo query graph */
};

/** A savepoint set with SQL's "SAVEPOINT savepoint_id" command */
struct trx_named_savept_t {
char *name; /*!< savepoint name */
trx_savept_t savept; /*!< the undo number corresponding to
the savepoint */
int64_t mysql_binlog_cache_pos;
/*!< the MySQL binlog cache position
corresponding to this savepoint, not
defined if the MySQL binlogging is not
enabled */
UT_LIST_NODE_T(trx_named_savept_t)
trx_savepoints; /*!< the list of savepoints of a
transaction */
};
#include <innodb/trx_trx/trx_named_savept_t.h>


#include "trx0roll.ic"

Expand Down
26 changes: 8 additions & 18 deletions storage/innobase/include/trx0trx.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,17 @@ class FlushObserver;
#include <innodb/trx_trx/trx_set_flush_observer.h>
#include <innodb/trx_trx/trx_set_detailed_error.h>
#include <innodb/trx_trx/trx_set_detailed_error_from_file.h>


/** Creates a transaction object for MySQL.
@return own: transaction object */
trx_t *trx_allocate_for_mysql(void);
/** Creates a transaction object for background operations by the master thread.
@return own: transaction object */
trx_t *trx_allocate_for_background(void);
#include <innodb/trx_trx/trx_allocate_for_background.h>
#include <innodb/trx_trx/trx_allocate_for_mysql.h>
#include <innodb/trx_trx/trx_free_resurrected.h>
#include <innodb/trx_trx/trx_free_for_background.h>

/** Resurrect table locks for resurrected transactions. */
void trx_resurrect_locks();

/** Free and initialize a transaction object instantiated during recovery.
@param[in,out] trx transaction object to free and initialize */
void trx_free_resurrected(trx_t *trx);

/** Free a transaction that was allocated by background or user threads.
@param[in,out] trx transaction object to free */
void trx_free_for_background(trx_t *trx);



/** At shutdown, frees a transaction object that is in the PREPARED state. */
void trx_free_prepared(trx_t *trx); /*!< in, own: trx object */
Expand Down Expand Up @@ -347,11 +339,9 @@ bool trx_weight_ge(const trx_t *a, /*!< in: the transaction to be compared */
@param[in,out] trx transaction that involves write to temp-table. */
void trx_assign_rseg_temp(trx_t *trx);

/** Create the trx_t pool */
void trx_pool_init();
#include <innodb/trx_trx/trx_pool_init.h>
#include <innodb/trx_trx/trx_pool_close.h>

/** Destroy the trx_t pool */
void trx_pool_close();

/**
Set the transaction as a read-write transaction if it is not already
Expand Down
Loading

0 comments on commit c1170ea

Please sign in to comment.