InnoDB Plugin  1.0
Functions | Variables
row0log.h File Reference
#include "univ.i"
#include "mtr0types.h"
#include "row0types.h"
#include "rem0types.h"
#include "data0types.h"
#include "dict0types.h"
#include "trx0types.h"
#include "que0types.h"
#include "row0log.ic"
Include dependency graph for row0log.h:

Go to the source code of this file.

Functions

UNIV_INTERN bool row_log_allocate (dict_index_t *index, dict_table_t *table, bool same_pk, const dtuple_t *add_cols, const ulint *col_map)
UNIV_INTERN void row_log_free (row_log_t *&log))
UNIV_INLINE void row_log_abort_sec (dict_index_t *index))
UNIV_INLINE bool row_log_online_op_try (dict_index_t *index, const dtuple_t *tuple, trx_id_t trx_id))
UNIV_INTERN void row_log_online_op (dict_index_t *index, const dtuple_t *tuple, trx_id_t trx_id) UNIV_COLD)
UNIV_INTERN dberr_t row_log_table_get_error (const dict_index_t *index))
UNIV_INTERN void row_log_table_delete (const rec_t *rec, dict_index_t *index, const ulint *offsets, const byte *sys) UNIV_COLD))
UNIV_INTERN void row_log_table_update (const rec_t *rec, dict_index_t *index, const ulint *offsets, const dtuple_t *old_pk) UNIV_COLD))
UNIV_INTERN const dtuple_trow_log_table_get_pk (const rec_t *rec, dict_index_t *index, const ulint *offsets, byte *sys, mem_heap_t **heap) UNIV_COLD
UNIV_INTERN void row_log_table_insert (const rec_t *rec, dict_index_t *index, const ulint *offsets) UNIV_COLD)
UNIV_INTERN void row_log_table_blob_free (dict_index_t *index, ulint page_no) UNIV_COLD)
UNIV_INTERN void row_log_table_blob_alloc (dict_index_t *index, ulint page_no) UNIV_COLD)
UNIV_INTERN dberr_t row_log_table_apply (que_thr_t *thr, dict_table_t *old_table, struct TABLE *table))
UNIV_INTERN trx_id_t row_log_get_max_trx (dict_index_t *index))
UNIV_INTERN dberr_t row_log_apply (trx_t *trx, dict_index_t *index, struct TABLE *table))

Variables

UNIV_INTERN bool warn_unused_result

Detailed Description

Modification log for online index creation and online table rebuild

Created 2011-05-26 Marko Makela

Function Documentation

UNIV_INLINE void row_log_abort_sec ( dict_index_t index)

Free the row log for an index on which online creation was aborted.

Parameters
indexin/out: index (x-latched)
UNIV_INTERN bool row_log_allocate ( dict_index_t index,
dict_table_t table,
bool  same_pk,
const dtuple_t add_cols,
const ulint *  col_map 
)

Allocate the row log for an index and flag the index for online creation.

Return values
trueif success, false if not
Parameters
indexin/out: index
tablein/out: new table being rebuilt, or NULL when creating a secondary index
same_pkin: whether the definition of the PRIMARY KEY has remained the same
add_colsin: default values of added columns, or NULL
col_mapin: mapping of old column numbers to new ones, or NULL if !table
UNIV_INTERN dberr_t row_log_apply ( trx_t trx,
dict_index_t index,
struct TABLE *  table 
)

Merge the row log to the index upon completing index creation.

Returns
DB_SUCCESS, or error code on failure
Parameters
trxin: transaction (for checking if the operation was interrupted)
indexin/out: secondary index
tablein/out: MySQL table (for reporting duplicates)
UNIV_INTERN void row_log_free ( row_log_t *&  log)

Free the row log for an index that was being created online.

Parameters
login,own: row log
UNIV_INTERN trx_id_t row_log_get_max_trx ( dict_index_t index)

Get the latest transaction ID that has invoked row_log_online_op() during online creation.

Returns
latest transaction ID, or 0 if nothing was logged
Parameters
indexin: index, must be locked
UNIV_INTERN void row_log_online_op ( dict_index_t index,
const dtuple_t tuple,
trx_id_t  trx_id 
)

Logs an operation to a secondary index that is (or was) being created.

Parameters
indexin/out: index, S or X latched
tuplein: index tuple
trx_idin: transaction ID for insert, or 0 for delete
UNIV_INLINE bool row_log_online_op_try ( dict_index_t index,
const dtuple_t tuple,
trx_id_t  trx_id 
)

Try to log an operation to a secondary index that is (or was) being created.

Return values
trueif the operation was logged or can be ignored
falseif online index creation is not taking place
Parameters
indexin/out: index, S or X latched
tuplein: index tuple
trx_idin: transaction ID for insert, or 0 for delete
UNIV_INTERN dberr_t row_log_table_apply ( que_thr_t thr,
dict_table_t old_table,
struct TABLE *  table 
)

Apply the row_log_table log to a table upon completing rebuild.

Returns
DB_SUCCESS, or error code on failure
Parameters
thrin: query graph
old_tablein: old table
tablein/out: MySQL table (for reporting duplicates)
UNIV_INTERN void row_log_table_blob_alloc ( dict_index_t index,
ulint  page_no 
)

Notes that a BLOB is being allocated during online ALTER TABLE.

Parameters
indexin/out: clustered index, X-latched
page_noin: starting page number of the BLOB
UNIV_INTERN void row_log_table_blob_free ( dict_index_t index,
ulint  page_no 
)

Notes that a BLOB is being freed during online ALTER TABLE.

Parameters
indexin/out: clustered index, X-latched
page_noin: starting page number of the BLOB
UNIV_INTERN void row_log_table_delete ( const rec_t *  rec,
dict_index_t index,
const ulint *  offsets,
const byte *  sys 
)

Logs a delete operation to a table that is being rebuilt. This will be merged in row_log_table_apply_delete().

Parameters
recin: clustered index leaf page record, page X-latched
indexin/out: clustered index, S-latched or X-latched
offsetsin: rec_get_offsets(rec,index)
sysin: DB_TRX_ID,DB_ROLL_PTR that should be logged, or NULL to use those in rec
UNIV_INTERN dberr_t row_log_table_get_error ( const dict_index_t index)

Gets the error status of the online index rebuild log.

Returns
DB_SUCCESS or error code
Parameters
indexin: clustered index of a table that is being rebuilt online
UNIV_INTERN const dtuple_t* row_log_table_get_pk ( const rec_t *  rec,
dict_index_t index,
const ulint *  offsets,
byte *  sys,
mem_heap_t **  heap 
)

Constructs the old PRIMARY KEY and DB_TRX_ID,DB_ROLL_PTR of a table that is being rebuilt.

Returns
tuple of PRIMARY KEY,DB_TRX_ID,DB_ROLL_PTR in the rebuilt table, or NULL if the PRIMARY KEY definition does not change
Parameters
recin: clustered index leaf page record, page X-latched
indexin/out: clustered index, S-latched or X-latched
offsetsin: rec_get_offsets(rec,index), or NULL
sysout: DB_TRX_ID,DB_ROLL_PTR for row_log_table_delete(), or NULL
heapin/out: memory heap where allocated
UNIV_INTERN void row_log_table_insert ( const rec_t *  rec,
dict_index_t index,
const ulint *  offsets 
)

Logs an insert to a table that is being rebuilt. This will be merged in row_log_table_apply_insert().

Parameters
recin: clustered index leaf page record, page X-latched
indexin/out: clustered index, S-latched or X-latched
offsetsin: rec_get_offsets(rec,index)
UNIV_INTERN void row_log_table_update ( const rec_t *  rec,
dict_index_t index,
const ulint *  offsets,
const dtuple_t old_pk 
)

Logs an update operation to a table that is being rebuilt. This will be merged in row_log_table_apply_update().

Parameters
recin: clustered index leaf page record, page X-latched
indexin/out: clustered index, S-latched or X-latched
offsetsin: rec_get_offsets(rec,index)
old_pkin: row_log_table_get_pk() before the update