diff options
Diffstat (limited to 'storage/innobase/row')
-rw-r--r-- | storage/innobase/row/row0import.cc | 1 | ||||
-rw-r--r-- | storage/innobase/row/row0ins.cc | 48 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.cc | 5 | ||||
-rw-r--r-- | storage/innobase/row/row0mysql.cc | 26 | ||||
-rw-r--r-- | storage/innobase/row/row0purge.cc | 5 | ||||
-rw-r--r-- | storage/innobase/row/row0quiesce.cc | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0uins.cc | 5 | ||||
-rw-r--r-- | storage/innobase/row/row0vers.cc | 28 |
8 files changed, 60 insertions, 60 deletions
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 5d7ea475d43..eaf987d115d 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -3853,6 +3853,7 @@ page_corrupted: block->page.zip.data = src; frame_changed = true; } else if (!page_compressed + && type != FIL_PAGE_TYPE_XDES && !block->page.zip.data) { block->page.frame = src; frame_changed = true; diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 24fb6eb39ce..eca839fa7be 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -48,6 +48,7 @@ Created 4/20/1996 Heikki Tuuri #ifdef WITH_WSREP #include <wsrep.h> #include <mysql/service_wsrep.h> +#include "ha_prototypes.h" #endif /* WITH_WSREP */ /************************************************************************* @@ -2580,42 +2581,6 @@ but GCC 4.8.5 does not support pop_options. */ # pragma GCC optimize ("O0") #endif -#ifdef WITH_WSREP -/** Start bulk insert operation for Galera by appending -table-level exclusive key for bulk insert. -@param trx transaction -@param index index -@retval false on success -@retval true on failure */ -ATTRIBUTE_COLD static bool row_ins_wsrep_start_bulk(trx_t *trx, const dict_index_t &index) -{ - char db_buf[NAME_LEN + 1]; - char tbl_buf[NAME_LEN + 1]; - ulint db_buf_len, tbl_buf_len; - - if (!index.table->parse_name(db_buf, tbl_buf, &db_buf_len, &tbl_buf_len)) - { - WSREP_ERROR("Parse_name for bulk insert failed: %s", - wsrep_thd_query(trx->mysql_thd)); - trx->error_state = DB_ROLLBACK; - return true; - } - - /* Append table-level exclusive key for bulk insert. */ - const int rcode = wsrep_thd_append_table_key(trx->mysql_thd, db_buf, - tbl_buf, WSREP_SERVICE_KEY_EXCLUSIVE); - if (rcode) - { - WSREP_ERROR("Appending table key for bulk insert failed: %s, %d", - wsrep_thd_query(trx->mysql_thd), rcode); - trx->error_state = DB_ROLLBACK; - return true; - } - - return false; -} -#endif - /***************************************************************//** Tries to insert an entry into a clustered index, ignoring foreign key constraints. If a record with the same unique key is found, the other @@ -2780,10 +2745,13 @@ avoid_bulk: #ifdef WITH_WSREP if (trx->is_wsrep()) { - if (!wsrep_thd_is_local_transaction(trx->mysql_thd)) - goto skip_bulk_insert; - if (row_ins_wsrep_start_bulk(trx, *index)) - goto err_exit; + if (!wsrep_thd_is_local_transaction(trx->mysql_thd)) + goto skip_bulk_insert; + if (wsrep_append_table_key(trx->mysql_thd, *index->table)) + { + trx->error_state = DB_ROLLBACK; + goto err_exit; + } } #endif /* WITH_WSREP */ diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index a82bbc7cde6..b35783f1a92 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -758,11 +758,6 @@ error: row_field, field, col->len, old_table->space->zip_size(), conv_heap); - } else { - /* Field length mismatch should not - happen when rebuilding redundant row - format table. */ - ut_ad(index->table->not_redundant()); } } } diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 81879431096..27f48c1a4de 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -66,17 +66,23 @@ Created 9/17/2000 Heikki Tuuri #include <thread> -/*******************************************************************//** -Delays an INSERT, DELETE or UPDATE operation if the purge is lagging. */ -static -void -row_mysql_delay_if_needed(void) -/*===========================*/ +/** Delay an INSERT, DELETE or UPDATE operation if the purge is lagging. */ +static void row_mysql_delay_if_needed() { - if (srv_dml_needed_delay) { - std::this_thread::sleep_for( - std::chrono::microseconds(srv_dml_needed_delay)); - } + const auto delay= srv_dml_needed_delay; + if (UNIV_UNLIKELY(delay != 0)) + { + /* Adjust for purge_coordinator_state::refresh() */ + log_sys.latch.rd_lock(SRW_LOCK_CALL); + const lsn_t last= log_sys.last_checkpoint_lsn, + max_age= log_sys.max_checkpoint_age; + log_sys.latch.rd_unlock(); + const lsn_t lsn= log_sys.get_lsn(); + if ((lsn - last) / 4 >= max_age / 5) + buf_flush_ahead(last + max_age / 5, false); + srv_wake_purge_thread_if_not_active(); + std::this_thread::sleep_for(std::chrono::microseconds(delay)); + } } /*******************************************************************//** diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index 0a2647e8d6d..f716625ea59 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -162,8 +162,9 @@ close_and_exit: ut_ad("corrupted SYS_INDEXES record" == 0); } - if (const uint32_t space_id = dict_drop_index_tree( - &node->pcur, nullptr, &mtr)) { + const uint32_t space_id = dict_drop_index_tree( + &node->pcur, nullptr, &mtr); + if (space_id) { if (table) { if (table->get_ref_count() == 0) { dict_sys.remove(table); diff --git a/storage/innobase/row/row0quiesce.cc b/storage/innobase/row/row0quiesce.cc index 059aee6f140..5b0676a3e0d 100644 --- a/storage/innobase/row/row0quiesce.cc +++ b/storage/innobase/row/row0quiesce.cc @@ -540,7 +540,7 @@ row_quiesce_table_start( if (!trx_is_interrupted(trx)) { /* Ensure that all asynchronous IO is completed. */ - os_aio_wait_until_no_pending_writes(); + os_aio_wait_until_no_pending_writes(true); table->space->flush<false>(); if (row_quiesce_write_cfg(table, trx->mysql_thd) diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc index 6b4393d4113..f0f1ba74f26 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -146,8 +146,9 @@ restart: pfs_os_file_t d = OS_FILE_CLOSED; - if (const uint32_t space_id = dict_drop_index_tree( - &node->pcur, node->trx, &mtr)) { + const uint32_t space_id = dict_drop_index_tree( + &node->pcur, node->trx, &mtr); + if (space_id) { if (table) { lock_release_on_rollback(node->trx, table); diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc index a4b52fd2a2f..9b11b7fbc3f 100644 --- a/storage/innobase/row/row0vers.cc +++ b/storage/innobase/row/row0vers.cc @@ -859,6 +859,30 @@ static bool dtuple_coll_eq(const dtuple_t &tuple1, const dtuple_t &tuple2) return true; } +/** Find out whether data tuple has missing data type +for indexed virtual column. +@param tuple data tuple +@param index virtual index +@return true if tuple has missing column type */ +static bool dtuple_vcol_data_missing(const dtuple_t &tuple, + dict_index_t *index) +{ + for (ulint i= 0; i < index->n_uniq; i++) + { + dict_col_t *col= index->fields[i].col; + if (!col->is_virtual()) + continue; + dict_v_col_t *vcol= reinterpret_cast<dict_v_col_t*>(col); + for (ulint j= 0; j < index->table->n_v_cols; j++) + { + if (vcol == &index->table->v_cols[j] + && tuple.v_fields[j].type.mtype == DATA_MISSING) + return true; + } + } + return false; +} + /** Finds out if a version of the record, where the version >= the current purge_sys.view, should have ientry as its secondary index entry. We check if there is any not delete marked version of the record where the trx @@ -1068,6 +1092,9 @@ unsafe_to_purge: if (dict_index_has_virtual(index)) { if (vrow) { + if (dtuple_vcol_data_missing(*vrow, index)) { + goto nochange_index; + } /* Keep the virtual row info for the next version, unless it is changed */ mem_heap_empty(v_heap); @@ -1078,6 +1105,7 @@ unsafe_to_purge: if (!cur_vrow) { /* Nothing for this index has changed, continue */ +nochange_index: version = prev_version; continue; } |