| MySQL 5.6.14 Source Code Document
    | 
#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"

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) __attribute__((nonnull(1) | 
| UNIV_INTERN void | row_log_free (row_log_t *&log) __attribute__((nonnull)) | 
| UNIV_INLINE void | row_log_abort_sec (dict_index_t *index) __attribute__((nonnull)) | 
| UNIV_INLINE bool | row_log_online_op_try (dict_index_t *index, const dtuple_t *tuple, trx_id_t trx_id) __attribute__((nonnull | 
| UNIV_INTERN void | row_log_online_op (dict_index_t *index, const dtuple_t *tuple, trx_id_t trx_id) UNIV_COLD __attribute__((nonnull)) | 
| UNIV_INTERN dberr_t | row_log_table_get_error (const dict_index_t *index) __attribute__((nonnull | 
| UNIV_INTERN void | row_log_table_delete (const rec_t *rec, dict_index_t *index, const ulint *offsets, bool purge, trx_id_t trx_id) UNIV_COLD __attribute__((nonnull)) | 
| 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 __attribute__((nonnull(1 | 
| UNIV_INTERN void UNIV_INTERN const dtuple_t * | row_log_table_get_pk (const rec_t *rec, dict_index_t *index, const ulint *offsets, mem_heap_t **heap) UNIV_COLD __attribute__((nonnull(1 | 
| UNIV_INTERN void | row_log_table_insert (const rec_t *rec, dict_index_t *index, const ulint *offsets) UNIV_COLD __attribute__((nonnull)) | 
| UNIV_INTERN void | row_log_table_blob_free (dict_index_t *index, ulint page_no) UNIV_COLD __attribute__((nonnull)) | 
| UNIV_INTERN void | row_log_table_blob_alloc (dict_index_t *index, ulint page_no) UNIV_COLD __attribute__((nonnull)) | 
| UNIV_INTERN dberr_t | row_log_table_apply (que_thr_t *thr, dict_table_t *old_table, struct TABLE *table) __attribute__((nonnull | 
| UNIV_INTERN trx_id_t | row_log_get_max_trx (dict_index_t *index) __attribute__((nonnull | 
| UNIV_INTERN dberr_t | row_log_apply (trx_t *trx, dict_index_t *index, struct TABLE *table) __attribute__((nonnull | 
| Variables | |
| UNIV_INTERN bool | warn_unused_result | 
Modification log for online index creation and online table rebuild
Created 2011-05-26 Marko Makela
Definition in file row0log.h.
| UNIV_INLINE void row_log_abort_sec | ( | dict_index_t * | index | ) | 
Free the row log for an index on which online creation was aborted.
| index | in/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.
| true | if success, false if not | 
| index | in/out: index | 
| table | in/out: new table being rebuilt, or NULL when creating a secondary index | 
| same_pk | in: whether the definition of the PRIMARY KEY has remained the same | 
| add_cols | in: default values of added columns, or NULL | 
| col_map | in: 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.
| trx | in: transaction (for checking if the operation was interrupted) | 
| index | in/out: secondary index | 
| table | in/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.
| log | in,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.
| index | in: 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.
| index | in/out: index, S or X latched | 
| tuple | in: index tuple | 
| trx_id | in: transaction ID for insert, or 0 for delete | 
Definition at line 203 of file row0log.cc.

| 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.
| true | if the operation was logged or can be ignored | 
| false | if online index creation is not taking place | 
| index | in/out: index, S or X latched | 
| tuple | in: index tuple | 
| trx_id | in: 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.
| thr | in: query graph | 
| old_table | in: old table | 
| table | in/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.
| index | in/out: clustered index, X-latched | 
| page_no | in: 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.
| index | in/out: clustered index, X-latched | 
| page_no | in: starting page number of the BLOB | 
| UNIV_INTERN void row_log_table_delete | ( | const rec_t * | rec, | 
| dict_index_t * | index, | ||
| const ulint * | offsets, | ||
| bool | purge, | ||
| trx_id_t | trx_id | ||
| ) | 
Logs a delete operation to a table that is being rebuilt. This will be merged in row_log_table_apply_delete().
| rec | in: clustered index leaf page record, page X-latched | 
| index | in/out: clustered index, S-latched or X-latched | 
| offsets | in: rec_get_offsets(rec,index) | 
| purge | in: true=purging BLOBs | 
| trx_id | in: DB_TRX_ID of the record before it was deleted | 
| UNIV_INTERN dberr_t row_log_table_get_error | ( | const dict_index_t * | index | ) | 
Gets the error status of the online index rebuild log.
| index | in: clustered index of a table that is being rebuilt online | 
| UNIV_INTERN void UNIV_INTERN const dtuple_t* row_log_table_get_pk | ( | const rec_t * | rec, | 
| dict_index_t * | index, | ||
| const ulint * | offsets, | ||
| mem_heap_t ** | heap | ||
| ) | 
Constructs the old PRIMARY KEY and DB_TRX_ID,DB_ROLL_PTR of a table that is being rebuilt.
| rec | in: clustered index leaf page record, page X-latched | 
| index | in/out: clustered index, S-latched or X-latched | 
| offsets | in: rec_get_offsets(rec,index), or NULL | 
| heap | in/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().
| rec | in: clustered index leaf page record, page X-latched | 
| index | in/out: clustered index, S-latched or X-latched | 
| offsets | in: 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().
| rec | in: clustered index leaf page record, page X-latched | 
| index | in/out: clustered index, S-latched or X-latched | 
| offsets | in: rec_get_offsets(rec,index) | 
| old_pk | in: row_log_table_get_pk() before the update |