/******************************************************//**
Allocate the row log for an index and flag the index for online creation.
@retval trueif success, falseifnot */ bool
row_log_allocate( /*=============*/ const trx_t* trx, /*!< in: the ALTER TABLE transaction */
dict_index_t* index, /*!< in/out: index */
dict_table_t* table, /*!< in/out: new table being rebuilt,
or NULL when creating a secondary index */ bool same_pk,/*!< in: whether the definition of the
PRIMARY KEY has remained the same */ const dtuple_t* defaults, /*!< in: default values of
added, changed columns, or NULL */ const ulint* col_map,/*!< in: mapping of old column
numbers to new ones, or NULL if !table */ constchar* path, /*!< in: where to create temporary file */ const TABLE* old_table, /*!< in:table definition before alter */ bool allow_not_null) /*!< in: allow null to non-null
conversion */
MY_ATTRIBUTE((nonnull(1), warn_unused_result));
/******************************************************//**
Free the row log for an index that was being created online. */ void
row_log_free( /*=========*/
row_log_t* log) /*!< in,own: row log */
MY_ATTRIBUTE((nonnull));
/******************************************************//**
Free the row log for an index on which online creation was aborted. */ inlinevoid row_log_abort_sec(dict_index_t *index)
{
ut_ad(index->lock.have_u_or_x());
ut_ad(!index->is_clust());
dict_index_set_online_status(index, ONLINE_INDEX_ABORTED);
row_log_free(index->online_log);
index->online_log= nullptr;
}
/******************************************************//**
Gets the error status of the online index rebuild log.
@return DB_SUCCESS or error code */
dberr_t
row_log_table_get_error( /*====================*/ const dict_index_t* index) /*!< in: clustered index of a table
that is being rebuilt online */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
Logs a delete operation to a table that is being rebuilt. This will be merged in row_log_table_apply_delete(). */ void
row_log_table_delete( /*=================*/ const rec_t* rec, /*!< in: clustered index leaf page record,
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ const rec_offs* offsets,/*!< in: rec_get_offsets(rec,index) */ const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should
be logged, or NULL to use those in rec */
ATTRIBUTE_COLD __attribute__((nonnull(1,2,3)));
/******************************************************//**
Logs an update operation to a table that is being rebuilt. This will be merged in row_log_table_apply_update(). */ void
row_log_table_update( /*=================*/ const rec_t* rec, /*!< in: clustered index leaf page record,
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ const rec_offs* offsets,/*!< in: rec_get_offsets(rec,index) */ const dtuple_t* old_pk);/*!< in: row_log_table_get_pk()
before the update */
/******************************************************//**
Constructs the old PRIMARY KEY and DB_TRX_ID,DB_ROLL_PTR
of a table that is being rebuilt.
@return tuple of PRIMARY KEY,DB_TRX_ID,DB_ROLL_PTR in the rebuilt table, or NULL if the PRIMARY KEY definition does not change */ const dtuple_t*
row_log_table_get_pk( /*=================*/ const rec_t* rec, /*!< in: clustered index leaf page record,
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ const rec_offs* offsets,/*!< in: rec_get_offsets(rec,index),
or NULL */
byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for
row_log_table_delete(), or NULL */
mem_heap_t** heap) /*!< in/out: memory heap where allocated */
ATTRIBUTE_COLD __attribute__((nonnull(1,2,5), warn_unused_result));
/******************************************************//**
Logs an insert to a table that is being rebuilt. This will be merged in row_log_table_apply_insert(). */ void
row_log_table_insert( /*=================*/ const rec_t* rec, /*!< in: clustered index leaf page record,
page X-latched */
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */ const rec_offs* offsets);/*!< in: rec_get_offsets(rec,index) */
/** Apply the row_log_table log to a table upon completing rebuild. @param[in]thrquerygraph @param[in]old_tableoldtable @param[in,out]tableMySQLtable(forreportingduplicates) @param[in,out]stageperformanceschemaaccountingobject,usedby ALTERTABLE.stage->begin_phase_log_table()willbecalledinitiallyandthen stage->inc()willbecalledforeachblockoflogthatisapplied. @param[in]new_tableAlteredtable
@return DB_SUCCESS, or error code on failure */
dberr_t
row_log_table_apply(
que_thr_t* thr,
dict_table_t* old_table, struct TABLE* table,
ut_stage_alter_t* stage,
dict_table_t* new_table)
MY_ATTRIBUTE((warn_unused_result));
/******************************************************//**
Get the latest transaction ID that has invoked row_log_online_op()
during online creation.
@return latest transaction ID, or0if nothing was logged */
trx_id_t
row_log_get_max_trx( /*================*/
dict_index_t* index) /*!< in: index, must be locked */
MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Apply the row log to the index upon completing index creation. @param[in,out]trxtransaction(forcheckingiftheoperationwas interrupted) @param[in,out]indexsecondaryindex @param[in,out]tableMySQLtable(forreportingduplicates) @param[in,out]stageperformanceschemaaccountingobject,usedby ALTERTABLE.stage->begin_phase_log_index()willbecalledinitiallyandthen stage->inc()willbecalledforeachblockoflogthatisapplied.
@return DB_SUCCESS, or error code on failure */
dberr_t
row_log_apply(
trx_t* trx,
dict_index_t* index, struct TABLE* table,
ut_stage_alter_t* stage)
MY_ATTRIBUTE((warn_unused_result));
/** Get the n_core_fields of online log for the index @paramindexindexwhosen_core_fieldsoflogtobeaccessed
@return number of n_core_fields */ unsigned row_log_get_n_core_fields(const dict_index_t *index);
/** Get the error code of online log for the index @paramindexonlineindex
@return error code present in online log */
dberr_t row_log_get_error(const dict_index_t *index);
/** Mark all indexed virtual columns for computation during onlineDDL.Virtualcolumnsthatarepartofanyindexmustbe computedandloggedintherowlogsotheirvaluesareavailable forindexbuildingandconcurrentDMLreplayduringALTERTABLE operations. @paramtableInnoDBtableobject
@param maria_table MariaDB table handle */
ATTRIBUTE_COLD void row_log_mark_virtual_cols(const dict_table_t *table,
TABLE *maria_table) noexcept; #ifdef HAVE_PSI_STAGE_INTERFACE /** Estimate how much work is to be done by the log apply phase ofanALTERTABLEforthisindex. @param[in]indexindexwhoselogtoassess @returnworktobedonebylog-applyinabstractunits
*/
ulint
row_log_estimate_work( const dict_index_t* index); #endif/* HAVE_PSI_STAGE_INTERFACE */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.