Commit 86e57eaa authored by Marko Mäkelä's avatar Marko Mäkelä Committed by Aleksey Midenkov

Remove upd_node_t::versioned

parent 0b89a42f
...@@ -8639,7 +8639,6 @@ calc_row_difference( ...@@ -8639,7 +8639,6 @@ calc_row_difference(
doc_id_t doc_id = FTS_NULL_DOC_ID; doc_id_t doc_id = FTS_NULL_DOC_ID;
ulint num_v = 0; ulint num_v = 0;
uint n_fields = mysql_fields(table); uint n_fields = mysql_fields(table);
bool table_versioned = prebuilt->table->versioned();
ut_ad(!srv_read_only_mode); ut_ad(!srv_read_only_mode);
...@@ -8649,9 +8648,6 @@ calc_row_difference( ...@@ -8649,9 +8648,6 @@ calc_row_difference(
/* We use upd_buff to convert changed fields */ /* We use upd_buff to convert changed fields */
buf = (byte*) upd_buff; buf = (byte*) upd_buff;
prebuilt->upd_node->versioned = false;
prebuilt->upd_node->vers_delete = false;
for (i = 0; i < n_fields; i++) { for (i = 0; i < n_fields; i++) {
field = table->field[i]; field = table->field[i];
bool is_virtual = innobase_is_v_fld(field); bool is_virtual = innobase_is_v_fld(field);
...@@ -8890,11 +8886,6 @@ calc_row_difference( ...@@ -8890,11 +8886,6 @@ calc_row_difference(
} }
n_changed++; n_changed++;
if (table_versioned
&& !field->vers_update_unversioned()) {
prebuilt->upd_node->versioned = true;
}
/* If an FTS indexed column was changed by this /* If an FTS indexed column was changed by this
UPDATE then we need to inform the FTS sub-system. UPDATE then we need to inform the FTS sub-system.
...@@ -8999,10 +8990,6 @@ calc_row_difference( ...@@ -8999,10 +8990,6 @@ calc_row_difference(
innodb_table, ufield, &trx->fts_next_doc_id); innodb_table, ufield, &trx->fts_next_doc_id);
++n_changed; ++n_changed;
if (table_versioned && !field->vers_update_unversioned()) {
prebuilt->upd_node->versioned = true;
}
} else { } else {
/* We have a Doc ID column, but none of FTS indexed /* We have a Doc ID column, but none of FTS indexed
columns are touched, nor the Doc ID column, so set columns are touched, nor the Doc ID column, so set
...@@ -9159,8 +9146,6 @@ ha_innobase::update_row( ...@@ -9159,8 +9146,6 @@ ha_innobase::update_row(
upd_t* uvect = row_get_prebuilt_update_vector(m_prebuilt); upd_t* uvect = row_get_prebuilt_update_vector(m_prebuilt);
ib_uint64_t autoinc; ib_uint64_t autoinc;
bool vers_set_fields = false;
bool vers_ins_row = false;
/* Build an update vector from the modified fields in the rows /* Build an update vector from the modified fields in the rows
(uses m_upd_buf of the handle) */ (uses m_upd_buf of the handle) */
...@@ -9183,29 +9168,30 @@ ha_innobase::update_row( ...@@ -9183,29 +9168,30 @@ ha_innobase::update_row(
/* This is not a delete */ /* This is not a delete */
m_prebuilt->upd_node->is_delete = FALSE; m_prebuilt->upd_node->is_delete = FALSE;
m_prebuilt->upd_node->vers_delete = false;
innobase_srv_conc_enter_innodb(m_prebuilt); {
bool vers_ins_row = false;
const bool vers_set_fields = table->versioned_write()
&& m_prebuilt->upd_node->update->affects_versioned();
if (!table->versioned_write()) { if (vers_set_fields) {
m_prebuilt->upd_node->versioned = false; vers_ins_row = table->s->vtmd
|| thd_sql_command(m_user_thd)
!= SQLCOM_ALTER_TABLE;
m_prebuilt->upd_node->vers_delete = !vers_ins_row;
} }
if (m_prebuilt->upd_node->versioned) { innobase_srv_conc_enter_innodb(m_prebuilt);
vers_set_fields = true;
if (thd_sql_command(m_user_thd) == SQLCOM_ALTER_TABLE
&& !table->s->vtmd) {
m_prebuilt->upd_node->vers_delete = true;
} else {
m_prebuilt->upd_node->vers_delete = false;
vers_ins_row = true;
}
}
error = row_update_for_mysql(m_prebuilt, vers_set_fields); error = row_update_for_mysql(m_prebuilt, vers_set_fields);
if (error == DB_SUCCESS && vers_ins_row) { if (error == DB_SUCCESS && vers_ins_row
if (trx->id != static_cast<trx_id_t>(table->vers_start_field()->val_int())) { && trx->id != static_cast<trx_id_t>(
error = row_insert_for_mysql((byte*) old_row, m_prebuilt, ROW_INS_HISTORICAL); table->vers_start_field()->val_int())) {
error = row_insert_for_mysql((byte*) old_row,
m_prebuilt,
ROW_INS_HISTORICAL);
} }
} }
......
...@@ -585,8 +585,6 @@ struct upd_node_t{ ...@@ -585,8 +585,6 @@ struct upd_node_t{
compilation; speeds up execution: compilation; speeds up execution:
UPD_NODE_NO_ORD_CHANGE and UPD_NODE_NO_ORD_CHANGE and
UPD_NODE_NO_SIZE_CHANGE, ORed */ UPD_NODE_NO_SIZE_CHANGE, ORed */
/** working with system versioned table */
bool versioned;
/** set sys_trx_end = CUR_TRX_ID */ /** set sys_trx_end = CUR_TRX_ID */
bool vers_delete; bool vers_delete;
/*----------------------*/ /*----------------------*/
......
...@@ -2006,8 +2006,7 @@ row_update_for_mysql( ...@@ -2006,8 +2006,7 @@ row_update_for_mysql(
thr->fk_cascade_depth = 0; thr->fk_cascade_depth = 0;
run_again: run_again:
if (vers_set_fields) if (vers_set_fields) {
{
/* System Versioning: modify update vector to set /* System Versioning: modify update vector to set
sys_trx_start (or sys_trx_end in case of DELETE) sys_trx_start (or sys_trx_end in case of DELETE)
to current trx_id. */ to current trx_id. */
...@@ -2143,7 +2142,8 @@ row_update_for_mysql( ...@@ -2143,7 +2142,8 @@ row_update_for_mysql(
cascade_upd_nodes->pop_front(); cascade_upd_nodes->pop_front();
thr->fk_cascade_depth++; thr->fk_cascade_depth++;
vers_set_fields = node->table->versioned() vers_set_fields = node->table->versioned()
&& (node->is_delete || node->versioned); && (node->is_delete
|| node->update->affects_versioned());
goto run_again; goto run_again;
} }
......
...@@ -493,8 +493,6 @@ upd_node_create( ...@@ -493,8 +493,6 @@ upd_node_create(
node->common.type = QUE_NODE_UPDATE; node->common.type = QUE_NODE_UPDATE;
node->state = UPD_NODE_UPDATE_CLUSTERED; node->state = UPD_NODE_UPDATE_CLUSTERED;
node->heap = mem_heap_create(128); node->heap = mem_heap_create(128);
node->cmpl_info = 0;
node->versioned = false;
node->magic_n = UPD_NODE_MAGIC_N; node->magic_n = UPD_NODE_MAGIC_N;
return(node); return(node);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment