summaryrefslogtreecommitdiff
path: root/storage/innobase/include/row0upd.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-11-24 12:03:24 +0200
committerAleksey Midenkov <midenok@gmail.com>2017-11-27 15:07:33 +0300
commit0b89a42ffc7f136632107b795db18dfa380aea69 (patch)
tree079110981e3819ba8d0620335ac51714499ab5aa /storage/innobase/include/row0upd.h
parent03fbfeef660b4799f73ed610182aa5dcbb3c2ec5 (diff)
downloadmariadb-git-0b89a42ffc7f136632107b795db18dfa380aea69.tar.gz
Remove the flag vers_update_trt
THD::vers_update_trt, trx_t::vers_update_trt, trx_savept_t::vers_update_trt: Remove. Instead, determine from trx_t::mod_tables whether versioned columns were affected by the transaction. handlerton::prepare_commit_versioned: Replaces vers_get_trt_data. Return the transaction start ID and also the commit ID, in case the transaction modified any system-versioned columns (0 if not). TR_table::store_data(): Remove (merge with update() below). TR_table::update(): Add the parameters start_id, end_id. ha_commit_trans(): Remove a condition on SQLCOM_ALTER_TABLE. If we need something special for ALTER TABLE...ALGORITHM=INPLACE, that can be done inside InnoDB by modifying trx_t::mod_tables. innodb_prepare_commit_versioned(): Renamed from innodb_get_trt_data(). Check trx_t::mod_tables to see if any changes to versioned columns are present. trx_mod_table_time_t: A pair of logical timestamps, replacing the undo_no_t in trx_mod_tables_t. Keep track of not only the first modification to a persistent table in each transaction, but also the first modification of a versioned column in a table. dtype_t, dict_col_t: Add the accessor is_any_versioned(), to check if the type refers to a system-versioned user or system column. upd_t::affects_versioned(): Check if an update affects a versioned column. trx_undo_report_row_operation(): If a versioned column is affected by the update, invoke trx_mod_table_time_t::set_versioned(). trx_rollback_to_savepoint_low(): If all changes to versioned columns were rolled back, invoke trx_mod_table_time_t::rollback_versioned(), so that trx_mod_table_time_t::is_versioned() will no longer hold.
Diffstat (limited to 'storage/innobase/include/row0upd.h')
-rw-r--r--storage/innobase/include/row0upd.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h
index 1d10156b634..d375dcd9e70 100644
--- a/storage/innobase/include/row0upd.h
+++ b/storage/innobase/include/row0upd.h
@@ -484,6 +484,18 @@ struct upd_t{
return(false);
}
+ /** Determine if the update affects a system versioned column.
+ @param[in] index the clustered index that is being updated */
+ bool affects_versioned() const
+ {
+ for (ulint i = 0; i < n_fields; i++) {
+ if (fields[i].new_val.type.is_any_versioned()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
#ifdef UNIV_DEBUG
bool validate() const
{