diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2023-03-29 17:23:21 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2023-03-29 17:23:21 +0300 |
commit | 2b61ff8f2221745f0a96855a0feb0825c426f993 (patch) | |
tree | 380937271691f782d506ecd0fc349e53b8baccc0 /storage | |
parent | 7bd225e12905c0adc9677a8e53a324c773fd3536 (diff) | |
parent | 5e01255732f554bbf473347566439fd18c006756 (diff) | |
download | mariadb-git-2b61ff8f2221745f0a96855a0feb0825c426f993.tar.gz |
Merge 11.0 into 11.1
Diffstat (limited to 'storage')
-rw-r--r-- | storage/connect/tabrest.cpp | 2 | ||||
-rw-r--r-- | storage/innobase/btr/btr0btr.cc | 4 | ||||
-rw-r--r-- | storage/innobase/btr/btr0cur.cc | 104 | ||||
-rw-r--r-- | storage/innobase/buf/buf0dblwr.cc | 2 | ||||
-rw-r--r-- | storage/innobase/dict/dict0dict.cc | 4 | ||||
-rw-r--r-- | storage/innobase/dict/dict0load.cc | 3 | ||||
-rw-r--r-- | storage/innobase/dict/dict0mem.cc | 2 | ||||
-rw-r--r-- | storage/innobase/fts/fts0fts.cc | 23 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 3 | ||||
-rw-r--r-- | storage/innobase/handler/handler0alter.cc | 6 | ||||
-rw-r--r-- | storage/innobase/include/fts0fts.h | 8 | ||||
-rw-r--r-- | storage/innobase/include/row0ins.h | 1 | ||||
-rw-r--r-- | storage/innobase/page/page0zip.cc | 3 | ||||
-rw-r--r-- | storage/innobase/que/que0que.cc | 13 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.cc | 3 | ||||
-rw-r--r-- | storage/innobase/row/row0sel.cc | 6 | ||||
-rw-r--r-- | storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.js | 2 | ||||
-rw-r--r-- | storage/perfschema/table_replication_applier_status_by_coordinator.cc | 2 | ||||
-rw-r--r-- | storage/perfschema/table_replication_applier_status_by_worker.cc | 49 |
19 files changed, 143 insertions, 97 deletions
diff --git a/storage/connect/tabrest.cpp b/storage/connect/tabrest.cpp index b38168622e9..e75e2006905 100644 --- a/storage/connect/tabrest.cpp +++ b/storage/connect/tabrest.cpp @@ -336,7 +336,7 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) // Do make the table/view definition if (Tdp && Tdp->Define(g, Cat, Name, Schema, "REST")) - Tdp = NULL; // Error occured + Tdp = NULL; // Error occurred if (xt) htrc("Tdp defined\n", rc); diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index dddff5e22b8..491e987cac6 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -3098,7 +3098,7 @@ insert_empty: ut_a(!insert_page_zip || page_zip_validate(insert_page_zip, insert_page, - cursor->index)); + cursor->index())); } #endif /* UNIV_ZIP_DEBUG */ @@ -4097,7 +4097,7 @@ btr_discard_page( #ifdef UNIV_ZIP_DEBUG if (page_zip_des_t* merge_page_zip - = buf_block_get_page_zip(merge_block)); + = buf_block_get_page_zip(merge_block)) ut_a(page_zip_validate(merge_page_zip, merge_block->page.frame, index)); #endif /* UNIV_ZIP_DEBUG */ diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 74db3fa3d8f..7ecbe165a1e 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -1553,7 +1553,7 @@ dberr_t btr_cur_t::pessimistic_search_leaf(const dtuple_t *tuple, mtr->upgrade_buffer_fix(block_savepoint, RW_X_LATCH); #ifdef UNIV_ZIP_DEBUG const page_zip_des_t *page_zip= buf_block_get_page_zip(block); - ut_a(!page_zip || page_zip_validate(page_zip, page, index())); + ut_a(!page_zip || page_zip_validate(page_zip, block->page.frame, index())); #endif /* UNIV_ZIP_DEBUG */ if (page_has_next(block->page.frame) && !btr_block_get(*index(), btr_page_get_next(block->page.frame), @@ -2931,9 +2931,84 @@ void btr_cur_upd_rec_in_place(rec_t *rec, const dict_index_t *index, } } - if (UNIV_LIKELY_NULL(block->page.zip.data)) { - page_zip_write_rec(block, rec, index, offsets, 0, mtr); + if (UNIV_LIKELY(!block->page.zip.data)) { + return; } + + switch (update->n_fields) { + case 0: + /* We only changed the delete-mark flag. */ + return; + case 1: + if (!index->is_clust() + || update->fields[0].field_no != index->db_roll_ptr()) { + break; + } + goto update_sys; + case 2: + if (!index->is_clust() + || update->fields[0].field_no != index->db_trx_id() + || update->fields[1].field_no != index->db_roll_ptr()) { + break; + } + update_sys: + ulint len; + const byte* sys = rec_get_nth_field(rec, offsets, + index->db_trx_id(), &len); + ut_ad(len == DATA_TRX_ID_LEN); + page_zip_write_trx_id_and_roll_ptr( + block, rec, offsets, index->db_trx_id(), + trx_read_trx_id(sys), + trx_read_roll_ptr(sys + DATA_TRX_ID_LEN), mtr); + return; + } + + page_zip_write_rec(block, rec, index, offsets, 0, mtr); +} + +/** Check if a ROW_FORMAT=COMPRESSED page can be updated in place +@param cur cursor pointing to ROW_FORMAT=COMPRESSED page +@param offsets rec_get_offsets(btr_cur_get_rec(cur)) +@param update index fields being updated +@param mtr mini-transaction +@return the record in the ROW_FORMAT=COMPRESSED page +@retval nullptr if the page cannot be updated in place */ +ATTRIBUTE_COLD static +rec_t *btr_cur_update_in_place_zip_check(btr_cur_t *cur, rec_offs *offsets, + const upd_t& update, mtr_t *mtr) +{ + dict_index_t *index= cur->index(); + ut_ad(!index->table->is_temporary()); + + switch (update.n_fields) { + case 0: + /* We are only changing the delete-mark flag. */ + break; + case 1: + if (!index->is_clust() || + update.fields[0].field_no != index->db_roll_ptr()) + goto check_for_overflow; + /* We are only changing the delete-mark flag and DB_ROLL_PTR. */ + break; + case 2: + if (!index->is_clust() || + update.fields[0].field_no != index->db_trx_id() || + update.fields[1].field_no != index->db_roll_ptr()) + goto check_for_overflow; + /* We are only changing DB_TRX_ID, DB_ROLL_PTR, and the delete-mark. + They can be updated in place in the uncompressed part of the + ROW_FORMAT=COMPRESSED page. */ + break; + check_for_overflow: + default: + if (!btr_cur_update_alloc_zip(btr_cur_get_page_zip(cur), + btr_cur_get_page_cur(cur), + offsets, rec_offs_size(offsets), + false, mtr)) + return nullptr; + } + + return btr_cur_get_rec(cur); } /*************************************************************//** @@ -2992,17 +3067,10 @@ btr_cur_update_in_place( page_zip_des_t* page_zip = buf_block_get_page_zip(block); /* Check that enough space is available on the compressed page. */ - if (UNIV_LIKELY_NULL(page_zip)) { - ut_ad(!index->table->is_temporary()); - - if (!btr_cur_update_alloc_zip( - page_zip, btr_cur_get_page_cur(cursor), - offsets, rec_offs_size(offsets), - false, mtr)) { - return(DB_ZIP_OVERFLOW); - } - - rec = btr_cur_get_rec(cursor); + if (UNIV_LIKELY_NULL(page_zip) + && !(rec = btr_cur_update_in_place_zip_check( + cursor, offsets, *update, mtr))) { + return DB_ZIP_OVERFLOW; } /* Do lock checking and undo logging */ @@ -3701,7 +3769,13 @@ btr_cur_pessimistic_update( ut_ad(page_is_leaf(block->page.frame)); ut_ad(dict_index_is_clust(index)); - ut_ad(flags & BTR_KEEP_POS_FLAG); + if (UNIV_UNLIKELY(!(flags & BTR_KEEP_POS_FLAG))) { + ut_ad(page_zip != NULL); + dtuple_convert_back_big_rec(index, new_entry, + big_rec_vec); + big_rec_vec = NULL; + n_ext = dtuple_get_n_ext(new_entry); + } } /* Do lock checking and undo logging */ diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 2ea72eb4c5f..8d8b92ae560 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -53,6 +53,7 @@ void buf_dblwr_t::init() active_slot= &slots[0]; mysql_mutex_init(buf_dblwr_mutex_key, &mutex, nullptr); pthread_cond_init(&cond, nullptr); + pthread_cond_init(&write_cond, nullptr); } } @@ -466,6 +467,7 @@ void buf_dblwr_t::close() ut_ad(!batch_running); pthread_cond_destroy(&cond); + pthread_cond_destroy(&write_cond); for (int i= 0; i < 2; i++) { aligned_free(slots[i].write_buf); diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index d0845ac8947..5545727b015 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -1933,8 +1933,8 @@ void dict_sys_t::remove(dict_table_t* table, bool lru, bool keep) #ifdef BTR_CUR_HASH_ADAPT if (table->fts) { fts_optimize_remove_table(table); - fts_free(table); - table->fts = NULL; + table->fts->~fts_t(); + table->fts = nullptr; } table->autoinc_mutex.wr_lock(); diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 9d5568f965b..bf59fed9ee4 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -2517,7 +2517,8 @@ corrupted: /* the table->fts could be created in dict_load_column when a user defined FTS_DOC_ID is present, but no FTS */ - fts_free(table); + table->fts->~fts_t(); + table->fts = nullptr; } else if (fts_optimize_wq) { fts_optimize_add_table(table); } else if (table->can_be_evicted) { diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index 3d8b40830b0..b8b2d583c24 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -212,7 +212,7 @@ dict_mem_table_free( || DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID) || DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_ADD_DOC_ID)) { if (table->fts) { - fts_free(table); + table->fts->~fts_t(); } } diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index eb09bca5f5d..8623e653991 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -826,7 +826,8 @@ void fts_clear_all(dict_table_t *table) fts_optimize_remove_table(table); - fts_free(table); + table->fts->~fts_t(); + table->fts= nullptr; DICT_TF2_FLAG_UNSET(table, DICT_TF2_FTS); } @@ -5154,14 +5155,14 @@ fts_t::~fts_t() { ut_ad(add_wq == NULL); - if (cache != NULL) { + if (cache) { fts_cache_clear(cache); fts_cache_destroy(cache); - cache = NULL; } /* There is no need to call ib_vector_free() on this->indexes because it is stored in this->fts_heap. */ + mem_heap_free(fts_heap); } /*********************************************************************//** @@ -5185,22 +5186,6 @@ fts_create( } /*********************************************************************//** -Free the FTS resources. */ -void -fts_free( -/*=====*/ - dict_table_t* table) /*!< in/out: table with FTS indexes */ -{ - fts_t* fts = table->fts; - - fts->~fts_t(); - - mem_heap_free(fts->fts_heap); - - table->fts = NULL; -} - -/*********************************************************************//** Take a FTS savepoint. */ UNIV_INLINE void diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 219d7399005..211126765f8 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -12692,7 +12692,8 @@ int create_table_info_t::create_table(bool create_fk) m_table->name.m_name); if (m_table->fts) { - fts_free(m_table); + m_table->fts->~fts_t(); + m_table->fts = nullptr; } my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index cfa5ed922da..5ce41a9857c 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -1180,7 +1180,8 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx old_v_cols[i].~dict_v_col_t(); } if (instant_table->fts) { - fts_free(instant_table); + instant_table->fts->~fts_t(); + instant_table->fts = nullptr; } dict_mem_table_free(instant_table); } @@ -8909,7 +8910,8 @@ innobase_rollback_sec_index( && !DICT_TF2_FLAG_IS_SET(user_table, DICT_TF2_FTS_HAS_DOC_ID) && !innobase_fulltext_exist(table)) { - fts_free(user_table); + user_table->fts->~fts_t(); + user_table->fts = nullptr; } } diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h index 0a821647dab..720fe7f25b9 100644 --- a/storage/innobase/include/fts0fts.h +++ b/storage/innobase/include/fts0fts.h @@ -610,14 +610,6 @@ fts_create( dict_table_t* table); /*!< out: table with FTS indexes */ -/**********************************************************************//** -Free the FTS resources. */ -void -fts_free( -/*=====*/ - dict_table_t* table); /*!< in/out: table with - FTS indexes */ - /*********************************************************************//** Run OPTIMIZE on the given table. @return DB_SUCCESS if all OK */ diff --git a/storage/innobase/include/row0ins.h b/storage/innobase/include/row0ins.h index 517319e5b13..ac2479c4863 100644 --- a/storage/innobase/include/row0ins.h +++ b/storage/innobase/include/row0ins.h @@ -177,6 +177,7 @@ struct ins_node_t trx_id(0), entry_sys_heap(mem_heap_create(128)) { } + ~ins_node_t() { mem_heap_free(entry_sys_heap); } que_common_t common; /*!< node type: QUE_NODE_INSERT */ ulint ins_type;/* INS_VALUES, INS_SEARCHED, or INS_DIRECT */ dtuple_t* row; /*!< row to insert */ diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index aff01764be6..c7ad8399304 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -3970,9 +3970,6 @@ page_zip_write_trx_id_and_roll_ptr( ut_ad(field + DATA_TRX_ID_LEN == rec_get_nth_field(rec, offsets, trx_id_col + 1, &len)); ut_ad(len == DATA_ROLL_PTR_LEN); -#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG - ut_a(!memcmp(storage, field, sys_len)); -#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ compile_time_assert(DATA_TRX_ID_LEN == 6); mach_write_to_6(field, trx_id); compile_time_assert(DATA_ROLL_PTR_LEN == 7); diff --git a/storage/innobase/que/que0que.cc b/storage/innobase/que/que0que.cc index 5f5f527e06b..d910ee2a881 100644 --- a/storage/innobase/que/que0que.cc +++ b/storage/innobase/que/que0que.cc @@ -236,9 +236,9 @@ que_graph_free_stat_list( que_node_t* node) /*!< in: first query graph node in the list */ { while (node) { + que_node_t* next = que_node_get_next(node); que_graph_free_recursive(node); - - node = que_node_get_next(node); + node = next; } } @@ -297,19 +297,10 @@ que_graph_free_recursive( break; case QUE_NODE_INSERT: - ins = static_cast<ins_node_t*>(node); que_graph_free_recursive(ins->select); - ins->select = NULL; - ins->~ins_node_t(); - - if (ins->entry_sys_heap != NULL) { - mem_heap_free(ins->entry_sys_heap); - ins->entry_sys_heap = NULL; - } - break; case QUE_NODE_PURGE: purge = static_cast<purge_node_t*>(node); diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 5a16b5d8ec4..a82bbc7cde6 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -4037,7 +4037,8 @@ static void row_merge_drop_fulltext_indexes(trx_t *trx, dict_table_t *table) fts_optimize_remove_table(table); fts_drop_tables(trx, *table); - fts_free(table); + table->fts->~fts_t(); + table->fts= nullptr; DICT_TF2_FLAG_UNSET(table, DICT_TF2_FTS); } diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index fa7e129752a..d4cb5068ca2 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -4889,7 +4889,11 @@ page_corrupted: if (trx->isolation_level == TRX_ISO_READ_UNCOMMITTED || !trx->read_view.is_open()) { } else if (trx_id_t bulk_trx_id = index->table->bulk_trx_id) { - if (!trx->read_view.changes_visible(bulk_trx_id)) { + /* InnoDB should allow the transaction to read all + the rows when InnoDB intends to do any locking + on the record */ + if (prebuilt->select_lock_type == LOCK_NONE + && !trx->read_view.changes_visible(bulk_trx_id)) { trx->op_info = ""; err = DB_END_OF_INDEX; goto normal_return; diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.js b/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.js index 75ce2617772..b6624f31b0d 100644 --- a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.js +++ b/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.js @@ -2338,7 +2338,7 @@ jQuery.fn.extend({ classNames = value.split( rspace ); while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list + // check each className given, space separated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.cc b/storage/perfschema/table_replication_applier_status_by_coordinator.cc index 91821eeb979..c795cdb6624 100644 --- a/storage/perfschema/table_replication_applier_status_by_coordinator.cc +++ b/storage/perfschema/table_replication_applier_status_by_coordinator.cc @@ -65,7 +65,7 @@ table_replication_applier_status_by_coordinator::m_share= "SERVICE_STATE ENUM('ON','OFF') not null comment 'ON (thread exists and is active or idle) or OFF (thread no longer exists).'," "LAST_ERROR_NUMBER INTEGER not null comment 'Last error number that caused the SQL/coordinator thread to stop.'," "LAST_ERROR_MESSAGE VARCHAR(1024) not null comment 'Last error message that caused the SQL/coordinator thread to stop.'," - "LAST_ERROR_TIMESTAMP TIMESTAMP(0) not null comment 'Timestamp that shows when the most recent SQL/coordinator error occured.'," + "LAST_ERROR_TIMESTAMP TIMESTAMP(0) not null comment 'Timestamp that shows when the most recent SQL/coordinator error occurred.'," "LAST_SEEN_TRANSACTION CHAR(57) not null comment 'The transaction the worker has last seen.'," "LAST_TRANS_RETRY_COUNT INTEGER not null comment 'Total number of retries attempted by last transaction.')") }, false, /* m_perpetual */ diff --git a/storage/perfschema/table_replication_applier_status_by_worker.cc b/storage/perfschema/table_replication_applier_status_by_worker.cc index 1ccf75e5d25..e982b5203ec 100644 --- a/storage/perfschema/table_replication_applier_status_by_worker.cc +++ b/storage/perfschema/table_replication_applier_status_by_worker.cc @@ -100,72 +100,67 @@ ha_rows table_replication_applier_status_by_worker::get_row_count() int table_replication_applier_status_by_worker::rnd_next(void) { rpl_parallel_thread_pool *pool= &global_rpl_thread_pool; - if (pool->inited && pool->count) + struct pool_bkp_for_pfs *bkp_pool= &pool->pfs_bkp; + mysql_mutex_lock(&pool->LOCK_rpl_thread_pool); + if (bkp_pool->inited && bkp_pool->count && bkp_pool->is_valid) { - mysql_mutex_lock(&pool->LOCK_rpl_thread_pool); - uint worker_count= pool->count; for (m_pos.set_at(&m_next_pos); - m_pos.has_more_workers(worker_count); + m_pos.has_more_workers(bkp_pool->count); m_pos.next_worker()) { - rpl_parallel_thread *rpt= pool->threads[m_pos.m_index]; + rpl_parallel_thread *rpt= bkp_pool->rpl_thread_arr[m_pos.m_index]; make_row(rpt); m_next_pos.set_after(&m_pos); mysql_mutex_unlock(&pool->LOCK_rpl_thread_pool); return 0; } - mysql_mutex_unlock(&pool->LOCK_rpl_thread_pool); } else { - mysql_mutex_lock(&pool->LOCK_rpl_thread_pool); - struct pool_bkp_for_pfs *bkp_pool= &pool->pfs_bkp; - if (bkp_pool->inited && bkp_pool->count) + if (pool->inited && pool->count) { + uint worker_count= pool->count; for (m_pos.set_at(&m_next_pos); - m_pos.has_more_workers(bkp_pool->count); - m_pos.next_worker()) + m_pos.has_more_workers(worker_count); + m_pos.next_worker()) { - rpl_parallel_thread *rpt= bkp_pool->rpl_thread_arr[m_pos.m_index]; + rpl_parallel_thread *rpt= pool->threads[m_pos.m_index]; make_row(rpt); m_next_pos.set_after(&m_pos); mysql_mutex_unlock(&pool->LOCK_rpl_thread_pool); return 0; } } - mysql_mutex_unlock(&pool->LOCK_rpl_thread_pool); } + mysql_mutex_unlock(&pool->LOCK_rpl_thread_pool); return HA_ERR_END_OF_FILE; } int table_replication_applier_status_by_worker::rnd_pos(const void *pos) { int res= HA_ERR_RECORD_DELETED; + rpl_parallel_thread_pool *pool= &global_rpl_thread_pool; + struct pool_bkp_for_pfs *bkp_pool= &pool->pfs_bkp; set_position(pos); - - if (global_rpl_thread_pool.inited && global_rpl_thread_pool.count) + mysql_mutex_lock(&pool->LOCK_rpl_thread_pool); + if (bkp_pool->inited && bkp_pool->count && bkp_pool->is_valid + && m_pos.m_index < bkp_pool->count) { - rpl_parallel_thread_pool *pool= &global_rpl_thread_pool; - mysql_mutex_lock(&pool->LOCK_rpl_thread_pool); - if(m_pos.m_index < pool->count) - { - rpl_parallel_thread *rpt= pool->threads[m_pos.m_index]; - make_row(rpt); - mysql_mutex_unlock(&pool->LOCK_rpl_thread_pool); - res= 0; - } + rpl_parallel_thread *rpt= bkp_pool->rpl_thread_arr[m_pos.m_index]; + make_row(rpt); + res= 0; } else { - struct pool_bkp_for_pfs *bkp_pool= &global_rpl_thread_pool.pfs_bkp; - if (bkp_pool->inited && bkp_pool->count && m_pos.m_index < bkp_pool->count) + if (pool->inited && pool->count && m_pos.m_index < pool->count) { - rpl_parallel_thread *rpt= bkp_pool->rpl_thread_arr[m_pos.m_index]; + rpl_parallel_thread *rpt= pool->threads[m_pos.m_index]; make_row(rpt); res= 0; } } + mysql_mutex_unlock(&pool->LOCK_rpl_thread_pool); return res; } |