diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2019-07-23 13:37:18 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2019-07-25 21:11:06 +0300 |
commit | 1a73444d577ee54ac3ecf752e8436091e932d212 (patch) | |
tree | 9a0a7008606c9af4af925e8de2dc0466770b59a0 /storage | |
parent | f3eb82f048d342c11fc3869eca2e6faed9a4835d (diff) | |
download | mariadb-git-1a73444d577ee54ac3ecf752e8436091e932d212.tar.gz |
Cleanups: DELETE HISTORY [MDEV-19814]
* Made make_versioned_*() proxies inline;
* Renamed truncate_history to delete_history
Part of:
MDEV-19814 Server crash in row_upd_del_mark_clust_rec or Assertion
`update->n_fields < ulint(table->n_cols + table->n_v_cols)' failed in
upd_node_t::make_versioned_helper
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/include/row0upd.h | 26 | ||||
-rw-r--r-- | storage/innobase/row/row0upd.cc | 19 |
2 files changed, 20 insertions, 25 deletions
diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h index e00ffda082d..7d716f960c5 100644 --- a/storage/innobase/include/row0upd.h +++ b/storage/innobase/include/row0upd.h @@ -589,14 +589,6 @@ struct upd_node_t{ /* column assignment list */ ulint magic_n; - /** Also set row_start = CURRENT_TIMESTAMP/trx->id - @param[in] trx transaction */ - void make_versioned_update(const trx_t* trx); - /** Only set row_end = CURRENT_TIMESTAMP/trx->id. - Do not touch other fields at all. - @param[in] trx transaction */ - void make_versioned_delete(const trx_t* trx); - private: /** Appends row_start or row_end field to update vector and sets a CURRENT_TIMESTAMP/trx->id value to it. @@ -605,6 +597,24 @@ private: @param[in] trx transaction @param[in] vers_sys_idx table->row_start or table->row_end */ void make_versioned_helper(const trx_t* trx, ulint idx); + +public: + /** Also set row_start = CURRENT_TIMESTAMP/trx->id + @param[in] trx transaction */ + void make_versioned_update(const trx_t* trx) + { + make_versioned_helper(trx, table->vers_start); + } + + /** Only set row_end = CURRENT_TIMESTAMP/trx->id. + Do not touch other fields at all. + @param[in] trx transaction */ + void make_versioned_delete(const trx_t* trx) + { + update->n_fields = 0; + is_delete = VERSIONED_DELETE; + make_versioned_helper(trx, table->vers_end); + } }; #define UPD_NODE_MAGIC_N 1579975 diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index c9ad752e96d..c22d422ed86 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -3485,7 +3485,8 @@ void upd_node_t::make_versioned_helper(const trx_t* trx, ulint idx) dict_index_t* clust_index = dict_table_get_first_index(table); - /* row_create_update_node_for_mysql() pre-allocated this much */ + /* row_create_update_node_for_mysql() pre-allocated this much. + At least one PK column always remains unchanged. */ ut_ad(update->n_fields < ulint(table->n_cols + table->n_v_cols)); update->n_fields++; @@ -3505,19 +3506,3 @@ void upd_node_t::make_versioned_helper(const trx_t* trx, ulint idx) dfield_set_data(&ufield->new_val, update->vers_sys_value, col->len); } -/** Also set row_start = CURRENT_TIMESTAMP/trx->id -@param[in] trx transaction */ -void upd_node_t::make_versioned_update(const trx_t* trx) -{ - make_versioned_helper(trx, table->vers_start); -} - -/** Only set row_end = CURRENT_TIMESTAMP/trx->id. -Do not touch other fields at all. -@param[in] trx transaction */ -void upd_node_t::make_versioned_delete(const trx_t* trx) -{ - update->n_fields = 0; - is_delete = VERSIONED_DELETE; - make_versioned_helper(trx, table->vers_end); -} |