From 3d615faaaaf828761a81aded386be4eef6de8359 Mon Sep 17 00:00:00 2001 From: chenlinfeng <723609220@qq.com> Date: Thu, 19 Aug 2021 15:22:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/pq_clone.cc | 175 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 116 insertions(+), 59 deletions(-) diff --git a/sql/pq_clone.cc b/sql/pq_clone.cc index 12aa41dd66f2..804cb286ea51 100644 --- a/sql/pq_clone.cc +++ b/sql/pq_clone.cc @@ -45,10 +45,11 @@ bool POSITION::pq_copy(THD *thd, POSITION *orig) { prefix_rowcount = orig->prefix_rowcount; prefix_cost = orig->prefix_cost; table = orig->table; - if (orig->key) + if (orig->key) { key = orig->key->pq_clone(thd); - else + } else { key = nullptr; + } ref_depend_map = orig->ref_depend_map; use_join_buffer = orig->use_join_buffer; sj_strategy = orig->sj_strategy; @@ -69,7 +70,6 @@ bool POSITION::pq_copy(THD *thd, POSITION *orig) { return false; } - bool QEP_TAB::pq_copy(THD *thd, QEP_TAB *orig) { set_type(orig->type()); set_index(orig->index()); @@ -84,15 +84,20 @@ bool QEP_TAB::pq_copy(THD *thd, QEP_TAB *orig) { cache_idx_cond = orig->cache_idx_cond; loosescan_key_len = orig->loosescan_key_len; POSITION *position = new (thd->pq_mem_root) POSITION; - if (!position || position->pq_copy(thd, orig->position())) + if (!position || position->pq_copy(thd, orig->position())) { return true; + } set_position(position); if (orig->pq_cond) { JOIN *join = this->join(); - if (!join) return true; + if (join == nullptr) { + return true; + } pq_cond = orig->pq_cond->pq_clone(join->thd, join->select_lex); - if (!pq_cond) return true; + if (pq_cond == nullptr) { + return true; + } } return false; @@ -117,7 +122,7 @@ bool TABLE::pq_copy(THD *thd, void *select_arg, TABLE *orig) { file->pushed_idx_cond = index_pushdown ? index_pushdown->pq_clone(thd, select) : nullptr; Item *copy_index_pushdown = file->pushed_idx_cond; - if ((index_pushdown && !copy_index_pushdown) || + if ((index_pushdown && copy_index_pushdown == nullptr) || (copy_index_pushdown && copy_index_pushdown->fix_fields(thd, ©_index_pushdown))) { return true; } @@ -142,16 +147,17 @@ bool TABLE_REF::pq_copy(JOIN *join, TABLE_REF *ref, QEP_TAB *qep_tab) { use_count = ref->use_count; disable_cache = ref->disable_cache; - if (!(key_buff = (uchar *)thd->mem_calloc(ALIGN_SIZE(key_length) * 2)) || !(key_copy = (store_key **)thd->mem_calloc((sizeof(store_key *) * (key_parts)))) || !(items = (Item **)thd->mem_calloc(sizeof(Item *) * key_parts)) || - !(cond_guards = (bool **)thd->mem_calloc(sizeof(uint *) * key_parts))) + !(cond_guards = (bool **)thd->mem_calloc(sizeof(uint *) * key_parts))) { return true; + } - if (ref->null_ref_key != nullptr) + if (ref->null_ref_key != nullptr) { null_ref_key = key_buff; + } key_buff2 = key_buff + ALIGN_SIZE(key_length); memcpy(key_buff, ref->key_buff, ALIGN_SIZE(key_length) * 2); @@ -161,8 +167,9 @@ bool TABLE_REF::pq_copy(JOIN *join, TABLE_REF *ref, QEP_TAB *qep_tab) { items[i] = ref->items[i]->pq_clone(thd, join->select_lex); DBUG_ASSERT(DBUG_EVALUATE_IF("skip_pq_clone_check", true, false) || items[i]); - if (!items[i]->fixed) + if (!items[i]->fixed) { items[i]->fix_fields(thd, &items[i]); + } if (qep_tab->table()->key_info) { KEY *const keyinfo = qep_tab->table()->key_info + key; @@ -202,7 +209,6 @@ int get_qep_tab_index(QEP_TAB *src, TABLE_LIST *first_tbl) { return -1; } - TABLE_LIST *get_next_table(TABLE_LIST *start_table, table_list_type_enum list_type) { if (list_type == TABLE_LIST_TYPE_DEFAULT) { return start_table->next_local; @@ -215,12 +221,13 @@ TABLE_LIST *get_next_table(TABLE_LIST *start_table, table_list_type_enum list_ty } return nullptr; } + TABLE_LIST *get_table_by_index(TABLE_LIST* start_table, table_list_type_enum list_type, int index) { if (start_table == nullptr) { return nullptr; } if (list_type == TABLE_LIST_TYPE_MERGE) { - start_table = start_table->merge_underlying_list; + start_table = start_table->merge_underlying_list; } int it = 0; for (TABLE_LIST *tbl_list = start_table; tbl_list != nullptr; it++) { @@ -246,7 +253,7 @@ bool copy_flush(QEP_TAB* des, JOIN *orig, int index, JOIN *join) { SJ_TMP_TABLE_TAB sjtabs[MAX_TABLES]; SJ_TMP_TABLE_TAB *last_tab = sjtabs; if (src->flush_weedout_table->tabs != nullptr) { - for (SJ_TMP_TABLE_TAB * t = src->flush_weedout_table->tabs; + for (SJ_TMP_TABLE_TAB *t = src->flush_weedout_table->tabs; t < src->flush_weedout_table->tabs_end; t++) { int n = get_qep_tab_index(t->qep_tab, orig); if (n == -1) { @@ -290,9 +297,13 @@ bool pq_dup_tabs(JOIN *join, JOIN *orig, bool setup MY_ATTRIBUTE((unused))) { //phase 1. Create qep_tab and qep_tab->qs; QEP_shared *qs = new (join->thd->pq_mem_root) QEP_shared[join->tables + 1]; - if (!qs) goto err; + if (qs == nullptr) { + goto err; + } join->qep_tab0 = new (join->thd->pq_mem_root) QEP_TAB[join->tables + 1]; - if (!join->qep_tab0) goto err; + if (join->qep_tab0 == nullptr) { + goto err; + } join->qep_tab = join->qep_tab0; for (uint i = 0; i < join->tables; i++) { @@ -319,7 +330,9 @@ bool pq_dup_tabs(JOIN *join, JOIN *orig, bool setup MY_ATTRIBUTE((unused))) { tab->db = new (join->thd->pq_mem_root) LEX_CSTRING{tb->s->db.str, tb->s->db.length}; - if (!tab->table_name|| !tab->db) goto err; + if (tab->table_name == nullptr|| tab->db == nullptr) { + goto err; + } /* * note: currently, setup is true. @@ -348,8 +361,9 @@ bool pq_dup_tabs(JOIN *join, JOIN *orig, bool setup MY_ATTRIBUTE((unused))) { tab->table_ref = tl; //phase 4. Copy table properties from leader - if (tab->ref().pq_copy(join, &orig_tab->ref(), tab)) + if (tab->ref().pq_copy(join, &orig_tab->ref(), tab)) { goto err; + } if (orig_tab->table()) { tab->table()->pq_copy(join->thd, (void *)select, orig_tab->table()); @@ -362,7 +376,9 @@ bool pq_dup_tabs(JOIN *join, JOIN *orig, bool setup MY_ATTRIBUTE((unused))) { Item *cond = condition->pq_clone(join->thd, select); DBUG_ASSERT(DBUG_EVALUATE_IF("skip_pq_clone_check", true, false) || cond); - if (!cond) goto err; + if (cond == nullptr) { + goto err; + } if (cond->fix_fields(join->thd, &cond)) { goto err; } @@ -376,7 +392,9 @@ bool pq_dup_tabs(JOIN *join, JOIN *orig, bool setup MY_ATTRIBUTE((unused))) { Item *cond = cache_idx_cond->pq_clone(join->thd, select); DBUG_ASSERT(DBUG_EVALUATE_IF("skip_pq_clone_check", true, false) || cond); - if (!cond) goto err; + if (cond == nullptr) { + goto err; + } if (cond->fix_fields(join->thd, &cond)) { goto err; } @@ -392,16 +410,18 @@ bool pq_dup_tabs(JOIN *join, JOIN *orig, bool setup MY_ATTRIBUTE((unused))) { } //phase 6. copy quick select - MEM_ROOT *saved_mem_root= join->thd->mem_root; + MEM_ROOT *saved_mem_root = join->thd->mem_root; if (orig_tab->quick()) { tab->set_quick(orig_tab->quick()->pq_clone( join->thd, tab->table())); DBUG_ASSERT(DBUG_EVALUATE_IF("pq_clone_error1", true, false) || tab->quick()); - if (! tab->quick()) goto err; + if (tab->quick() == nullptr){ + goto err; + } tab->set_quick_optim(); } - join->thd->mem_root= saved_mem_root; + join->thd->mem_root = saved_mem_root; } //phase 7. Copy having condition @@ -413,8 +433,9 @@ bool pq_dup_tabs(JOIN *join, JOIN *orig, bool setup MY_ATTRIBUTE((unused))) { select->resolve_place = SELECT_LEX::RESOLVE_HAVING; if (!m_having_cond->fixed && (m_having_cond->fix_fields(join->thd, &m_having_cond) || - m_having_cond->check_cols(1))) + m_having_cond->check_cols(1))) { goto err; + } select->having_fix_field = false; select->resolve_place = SELECT_LEX::RESOLVE_NONE; @@ -423,7 +444,7 @@ bool pq_dup_tabs(JOIN *join, JOIN *orig, bool setup MY_ATTRIBUTE((unused))) { for (uint i = 0; i < join->tables; i++) { QEP_TAB *t = &orig->qep_tab[i]; if (t->flush_weedout_table != nullptr) { - if (!copy_flush(&join->qep_tab[i], orig, i , join)) { + if (!copy_flush(&join->qep_tab[i], orig, i, join)) { goto err; } } @@ -483,6 +504,7 @@ int get_table_index(TABLE_LIST* start_table, table_list_type_enum list_type, TAB } return -1; } + TABLE_LIST *copy_table(THD *thd, TABLE_LIST *src, SELECT_LEX *select, SELECT_LEX *orig) { TABLE_LIST *ptr = new (thd->mem_root) TABLE_LIST; if (ptr == nullptr) { @@ -493,7 +515,7 @@ TABLE_LIST *copy_table(THD *thd, TABLE_LIST *src, SELECT_LEX *select, SELECT_LEX ptr->effective_algorithm = src->effective_algorithm; ptr->outer_join = src->outer_join; if (src->merge_underlying_list != nullptr) { - TABLE_LIST * foundtable = nullptr; + TABLE_LIST *foundtable = nullptr; int index = get_table_index(orig->leaf_tables, TABLE_LIST_TYPE_GLOBAL, src->merge_underlying_list); if (index != -1) { foundtable = get_table_by_index(select->leaf_tables, TABLE_LIST_TYPE_GLOBAL, index); @@ -547,7 +569,7 @@ TABLE_LIST *copy_table(THD *thd, TABLE_LIST *src, SELECT_LEX *select, SELECT_LEX return ptr; } -bool copy_table_field( TABLE_LIST * src, TABLE_LIST * des, THD *thd, SELECT_LEX *dest_select) { +bool copy_table_field( TABLE_LIST *src, TABLE_LIST *des, THD *thd, SELECT_LEX *dest_select) { int count = src->field_translation_end - src->field_translation; if (count <= 0) { return false; @@ -572,11 +594,11 @@ bool copy_table_field( TABLE_LIST * src, TABLE_LIST * des, THD *thd, SELECT_LEX } bool copy_merge_table_field(THD *thd, SELECT_LEX *dest_select, int tableindex, int mergeindex, TABLE_LIST *srctb) { - TABLE_LIST * tb = get_table_by_index(dest_select->table_list.first, TABLE_LIST_TYPE_DEFAULT, tableindex); + TABLE_LIST *tb = get_table_by_index(dest_select->table_list.first, TABLE_LIST_TYPE_DEFAULT, tableindex); if (tb == nullptr) { return true; } - TABLE_LIST *mergetable = get_table_by_index(tb, TABLE_LIST_TYPE_MERGE, mergeindex); + TABLE_LIST *mergetable = get_table_by_index(tb, TABLE_LIST_TYPE_MERGE, mergeindex); if (mergetable == nullptr) { return true; } @@ -590,11 +612,11 @@ bool copy_global_table_list_field(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_s int tableindex = 0; for (TABLE_LIST *tbl_list = orig->leaf_tables; tbl_list != nullptr; tbl_list = tbl_list->next_global) { if (tbl_list->field_translation != nullptr) { - TABLE_LIST * src = get_table_by_index(dest_select->leaf_tables, TABLE_LIST_TYPE_GLOBAL, tableindex); + TABLE_LIST *src = get_table_by_index(dest_select->leaf_tables, TABLE_LIST_TYPE_GLOBAL, tableindex); if (src == nullptr) { return true; } - if (copy_table_field(tbl_list,src, thd, dest_select)) { + if (copy_table_field(tbl_list, src, thd, dest_select)) { return true; } } @@ -641,6 +663,7 @@ bool copy_leaf_tables(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) { last->next_leaf = nullptr; return false; } + void set_up_leaf_tables(THD *thd, SELECT_LEX *select) { select->partitioned_table_count = 0; for (TABLE_LIST *tr = select->leaf_tables; tr != nullptr; tr = tr->next_leaf) { @@ -651,14 +674,19 @@ void set_up_leaf_tables(THD *thd, SELECT_LEX *select) { { tr->opt_hints_table = select->opt_hints_qb->adjust_table_hints(tr); } - if (table == nullptr) continue; + if (table == nullptr) { + continue; + } table->pos_in_table_list = tr; } - if (select->opt_hints_qb) select->opt_hints_qb->check_unresolved(thd); + if (select->opt_hints_qb) { + select->opt_hints_qb->check_unresolved(thd); + } } + bool copy_global_tables(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) { for (TABLE_LIST *tbl_list = orig->leaf_tables; tbl_list != nullptr; tbl_list = tbl_list->next_global) { - int index = get_table_index(orig->leaf_tables, TABLE_LIST_TYPE_LEAF, tbl_list); + int index = get_table_index(orig->leaf_tables, TABLE_LIST_TYPE_LEAF, tbl_list); TABLE_LIST *tmp = nullptr; if (index != -1) { tmp = get_table_by_index(dest_select->leaf_tables, TABLE_LIST_TYPE_LEAF, index); @@ -672,10 +700,11 @@ bool copy_global_tables(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) { } return false; } + bool copy_table_list(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) { for (TABLE_LIST *tbl_list = orig->table_list.first; tbl_list != nullptr; tbl_list = tbl_list->next_local) { int index = get_table_index(orig->leaf_tables, TABLE_LIST_TYPE_GLOBAL, tbl_list); - TABLE_LIST * tmp = nullptr; + TABLE_LIST *tmp = nullptr; if (index != -1) { tmp = get_table_by_index(dest_select->leaf_tables, TABLE_LIST_TYPE_GLOBAL, index); } else { @@ -688,9 +717,10 @@ bool copy_table_list(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) { } return false; } + bool init_table_list_field_space(THD *thd, SELECT_LEX *select, table_list_type_enum list_type) { - TABLE_LIST* start_src = nullptr; - TABLE_LIST* start_des = nullptr; + TABLE_LIST *start_src = nullptr; + TABLE_LIST *start_des = nullptr; if (list_type == TABLE_LIST_TYPE_DEFAULT) { start_src = select->orig->table_list.first; start_des = select->table_list.first; @@ -701,7 +731,7 @@ bool init_table_list_field_space(THD *thd, SELECT_LEX *select, table_list_type_e int tableindex = 0; for (TABLE_LIST *tbl_list = start_src; tbl_list != nullptr; tableindex++) { if (tbl_list->field_translation != nullptr) { - TABLE_LIST *des = get_table_by_index(start_des, list_type, tableindex); + TABLE_LIST *des = get_table_by_index(start_des, list_type, tableindex); if (des == nullptr) { return true; } @@ -725,11 +755,11 @@ bool init_field_space(THD *thd, SELECT_LEX *orig, SELECT_LEX *select) { int mergeindex = 0; for (TABLE_LIST *tb = tbl_list->merge_underlying_list; tb != nullptr; tb = tb->merge_underlying_list) { if (tb->field_translation != nullptr) { - TABLE_LIST * ta = get_table_by_index(select->table_list.first, TABLE_LIST_TYPE_DEFAULT, tableindex); + TABLE_LIST *ta = get_table_by_index(select->table_list.first, TABLE_LIST_TYPE_DEFAULT, tableindex); if (ta == nullptr) { return true; } - TABLE_LIST * mergetable = get_table_by_index(ta, TABLE_LIST_TYPE_MERGE , mergeindex); + TABLE_LIST *mergetable = get_table_by_index(ta, TABLE_LIST_TYPE_MERGE, mergeindex); if (mergetable == nullptr) { return true; } @@ -744,6 +774,7 @@ bool init_field_space(THD *thd, SELECT_LEX *orig, SELECT_LEX *select) { } return false; } + bool copy_merge_table_list_field(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) { int tableindex = 0; int mergeindex = 0; @@ -762,11 +793,12 @@ bool copy_merge_table_list_field(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_se } return false; } + bool copy_table_list_field(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) { int tableindex = 0; for (TABLE_LIST *tbl_list = orig->table_list.first; tbl_list != nullptr; tbl_list = tbl_list->next_local) { if (tbl_list->field_translation != nullptr) { - TABLE_LIST * src = get_table_by_index(dest_select->table_list.first, TABLE_LIST_TYPE_DEFAULT, tableindex); + TABLE_LIST *src = get_table_by_index(dest_select->table_list.first, TABLE_LIST_TYPE_DEFAULT, tableindex); if (src == nullptr) { return true; } @@ -778,6 +810,7 @@ bool copy_table_list_field(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) } return false; } + bool copy_all_table_list(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) { if (copy_leaf_tables(thd, orig, dest_select) || copy_global_tables(thd, orig, dest_select) || @@ -792,6 +825,7 @@ bool copy_all_table_list(THD *thd, SELECT_LEX *orig, SELECT_LEX *dest_select) { } return false; } + SELECT_LEX *pq_dup_select(THD *thd, SELECT_LEX *orig) { Item *item = nullptr; Item *new_item = nullptr; @@ -806,7 +840,9 @@ SELECT_LEX *pq_dup_select(THD *thd, SELECT_LEX *orig) { List_iterator_fast li(orig->item_list); LEX *lex = new (thd->pq_mem_root) LEX(); - if (!lex) goto err; + if (lex == nullptr) { + goto err; + } lex->reset(); lex->result = orig->parent_lex->result; lex->sql_command = orig->parent_lex->sql_command; @@ -817,8 +853,9 @@ SELECT_LEX *pq_dup_select(THD *thd, SELECT_LEX *orig) { thd->query_plan.set_query_plan(SQLCOM_SELECT, lex, false); select = lex->new_query(nullptr); - if (!select || DBUG_EVALUATE_IF("dup_select_abort1", true, false)) + if (!select || DBUG_EVALUATE_IF("dup_select_abort1", true, false)) { goto err; + } select->orig = orig; select->renumber(thd->lex); select->with_sum_func = orig->with_sum_func; @@ -872,7 +909,9 @@ SELECT_LEX *pq_dup_select(THD *thd, SELECT_LEX *orig) { new_item = item->pq_clone(thd, select); DBUG_ASSERT(DBUG_EVALUATE_IF("skip_pq_clone_check", true, false) || new_item); - if (!new_item) goto err; + if (new_item == nullptr) { + goto err; + } select->item_list.push_back(new_item); } @@ -895,7 +934,9 @@ SELECT_LEX *pq_dup_select(THD *thd, SELECT_LEX *orig) { if (orig_list.elements) { for (group = orig_list.first; group; group = group->next) { group_new = pq_dup_order(thd, select, group); - if (!group_new) goto err; + if (group_new == nullptr) { + goto err; + } select->group_list.link_in_list(group_new, &group_new->next); } @@ -912,21 +953,26 @@ SELECT_LEX *pq_dup_select(THD *thd, SELECT_LEX *orig) { if (orig_list.elements) { for (order = orig_list.first; order; order = order->next) { order_new = pq_dup_order(thd, select, order); - if (!order_new) goto err; + if (order_new == nullptr) { + goto err; + } select->order_list.link_in_list(order_new, &order_new->next); } } /** mianly used for optimized_group_by */ - if (select->group_list.elements) + if (select->group_list.elements) { select->fix_prepare_information_for_order(thd, &select->group_list, &select->saved_group_list_ptrs); - if (select->order_list.elements) + } + if (select->order_list.elements) { select->fix_prepare_information_for_order(thd, &select->order_list, &select->saved_order_list_ptrs); + } if (select->setup_base_ref_items(thd) || - DBUG_EVALUATE_IF("dup_select_abort2", true, false)) + DBUG_EVALUATE_IF("dup_select_abort2", true, false)) { goto err; + } select->all_fields = select->fields_list; thd->mark_used_columns = MARK_COLUMNS_READ; @@ -935,19 +981,25 @@ SELECT_LEX *pq_dup_select(THD *thd, SELECT_LEX *orig) { if (orig->where_cond()) { where = orig->where_cond()->pq_clone(thd, select); DBUG_ASSERT(DBUG_EVALUATE_IF("skip_pq_clone_check", true, false) || where); - if (!where) goto err; + if (where == nullptr) { + goto err; + } select->set_where_cond(where); - } else + } else { select->set_where_cond(nullptr); + } // phase 6. duplicate having cond if (orig->having_cond()) { having = orig->having_cond()->pq_clone(thd, select); DBUG_ASSERT(DBUG_EVALUATE_IF("skip_pq_clone_check", true, false) || having); - if (!having) goto err; + if (having == nullptr) { + goto err; + } select->set_having_cond(having); - } else + } else { select->set_having_cond(nullptr); + } // phase 7: allow local set functions in HAVING and ORDER BY lex->allow_sum_func |= (nesting_map)1 << (nesting_map)select->nest_level; @@ -971,12 +1023,15 @@ static bool pq_select_prepare(THD *thd, SELECT_LEX *select, List &orig_all thd->mark_used_columns = MARK_COLUMNS_READ; ulong want_privilege = 0; if (setup_fields(thd, select->base_ref_items, select->fields_list, - want_privilege, &select->all_fields, true, false, true)) + want_privilege, &select->all_fields, true, false, true)) { return true; + } // Setup.2 setup GROUP BY clause int all_fields_count = select->all_fields.elements; - if (select->group_list.elements && select->setup_group(thd)) return true; + if (select->group_list.elements && select->setup_group(thd)) { + return true; + } select->hidden_group_field_count = select->all_fields.elements - all_fields_count; @@ -984,23 +1039,26 @@ static bool pq_select_prepare(THD *thd, SELECT_LEX *select, List &orig_all if (select->order_list.elements && setup_order(thd, select->base_ref_items, select->table_list.first, select->fields_list, select->all_fields, - select->order_list.first)) + select->order_list.first)) { return true; + } select->hidden_order_field_count = select->all_fields.elements - all_fields_count; // Setup.4: check item's property */ - if (select->all_fields.elements != orig_all_fields.elements) + if (select->all_fields.elements != orig_all_fields.elements) { return true; + } List_iterator_fast lm(select->all_fields); Item *item = nullptr; Item *orig_item = nullptr; for (uint i = 0; (item = lm++); i++) { orig_item = orig_all_fields[i]; - if(item == nullptr || (item->type() != orig_item->type())) + if(item == nullptr || (item->type() != orig_item->type())) { return true; + } } return false; @@ -1038,7 +1096,6 @@ JOIN *pq_make_join(THD *thd, JOIN *join) { return nullptr; } - bool System_variables::pq_copy_from(struct System_variables orig) { pseudo_thread_id = orig.pseudo_thread_id; sql_mode = orig.sql_mode;