diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/contributors.h | 13 | ||||
-rw-r--r-- | sql/item.cc | 31 | ||||
-rw-r--r-- | sql/item.h | 10 | ||||
-rw-r--r-- | sql/item_cmpfunc.cc | 2 | ||||
-rw-r--r-- | sql/item_subselect.cc | 49 | ||||
-rw-r--r-- | sql/item_subselect.h | 6 | ||||
-rw-r--r-- | sql/mysqld.cc | 3 | ||||
-rw-r--r-- | sql/sql_class.h | 19 | ||||
-rw-r--r-- | sql/sql_cte.cc | 1 | ||||
-rw-r--r-- | sql/sql_join_cache.cc | 88 | ||||
-rw-r--r-- | sql/sql_join_cache.h | 11 | ||||
-rw-r--r-- | sql/sql_parse.cc | 8 | ||||
-rw-r--r-- | sql/sql_plugin_services.ic | 1 | ||||
-rw-r--r-- | sql/sql_show.cc | 11 | ||||
-rw-r--r-- | sql/wsrep_dummy.cc | 10 | ||||
-rw-r--r-- | sql/wsrep_thd.cc | 19 |
16 files changed, 202 insertions, 80 deletions
diff --git a/sql/contributors.h b/sql/contributors.h index 34f06087c8c..e16448ee985 100644 --- a/sql/contributors.h +++ b/sql/contributors.h @@ -37,22 +37,17 @@ struct show_table_contributors_st { struct show_table_contributors_st show_table_contributors[]= { /* MariaDB foundation sponsors, in contribution, size , time order */ - {"Booking.com", "https://www.booking.com", "Founding member, Platinum Sponsor of the MariaDB Foundation"}, {"Alibaba Cloud", "https://www.alibabacloud.com/", "Platinum Sponsor of the MariaDB Foundation"}, {"Tencent Cloud", "https://cloud.tencent.com", "Platinum Sponsor of the MariaDB Foundation"}, {"Microsoft", "https://microsoft.com/", "Platinum Sponsor of the MariaDB Foundation"}, {"MariaDB Corporation", "https://mariadb.com", "Founding member, Platinum Sponsor of the MariaDB Foundation"}, + {"ServiceNow", "https://servicenow.com", "Platinum Sponsor of the MariaDB Foundation"}, {"Visma", "https://visma.com", "Gold Sponsor of the MariaDB Foundation"}, {"DBS", "https://dbs.com", "Gold Sponsor of the MariaDB Foundation"}, {"IBM", "https://www.ibm.com", "Gold Sponsor of the MariaDB Foundation"}, - {"Tencent Games", "http://game.qq.com/", "Gold Sponsor of the MariaDB Foundation"}, - {"Nexedi", "https://www.nexedi.com", "Silver Sponsor of the MariaDB Foundation"}, - {"Acronis", "https://www.acronis.com", "Silver Sponsor of the MariaDB Foundation"}, - {"Verkkokauppa.com", "https://www.verkkokauppa.com", "Bronze Sponsor of the MariaDB Foundation"}, - {"Virtuozzo", "https://virtuozzo.com", "Bronze Sponsor of the MariaDB Foundation"}, - {"Tencent Game DBA", "http://tencentdba.com/about", "Bronze Sponsor of the MariaDB Foundation"}, - {"Tencent TDSQL", "http://tdsql.org", "Bronze Sponsor of the MariaDB Foundation"}, - {"Percona", "https://www.percona.com/", "Bronze Sponsor of the MariaDB Foundation"}, + {"Automattic", "https://automattic.com", "Silver Sponsor of the MariaDB Foundation"}, + {"Percona", "https://www.percona.com/", "Sponsor of the MariaDB Foundation"}, + {"Galera Cluster", "https://galeracluster.com", "Sponsor of the MariaDB Foundation"}, /* Sponsors of important features */ {"Google", "USA", "Sponsoring encryption, parallel replication and GTID"}, diff --git a/sql/item.cc b/sql/item.cc index 7caa9e41e2f..1a86b8b3114 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2018, Oracle and/or its affiliates. - Copyright (c) 2010, 2020, MariaDB Corporation. + Copyright (c) 2010, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -9905,7 +9905,7 @@ bool Item_cache_int::cache_value() return FALSE; value_cached= TRUE; value= example->val_int_result(); - null_value= example->null_value; + null_value_inside= null_value= example->null_value; unsigned_flag= example->unsigned_flag; return TRUE; } @@ -9982,7 +9982,7 @@ bool Item_cache_temporal::cache_value() return false; value_cached= true; value= example->val_datetime_packed_result(current_thd); - null_value= example->null_value; + null_value_inside= null_value= example->null_value; return true; } @@ -9993,7 +9993,7 @@ bool Item_cache_time::cache_value() return false; value_cached= true; value= example->val_time_packed_result(current_thd); - null_value= example->null_value; + null_value_inside= null_value= example->null_value; return true; } @@ -10132,7 +10132,7 @@ bool Item_cache_real::cache_value() return FALSE; value_cached= TRUE; value= example->val_result(); - null_value= example->null_value; + null_value_inside= null_value= example->null_value; return TRUE; } @@ -10199,7 +10199,8 @@ bool Item_cache_decimal::cache_value() return FALSE; value_cached= TRUE; my_decimal *val= example->val_decimal_result(&decimal_value); - if (!(null_value= example->null_value) && val != &decimal_value) + if (!(null_value_inside= null_value= example->null_value) && + val != &decimal_value) my_decimal2decimal(val, &decimal_value); return TRUE; } @@ -10248,11 +10249,14 @@ Item *Item_cache_decimal::convert_to_basic_const_item(THD *thd) bool Item_cache_str::cache_value() { if (!example) + { + DBUG_ASSERT(value_cached == FALSE); return FALSE; + } value_cached= TRUE; value_buff.set(buffer, sizeof(buffer), example->collation.collation); value= example->str_result(&value_buff); - if ((null_value= example->null_value)) + if ((null_value= null_value_inside= example->null_value)) value= 0; else if (value != &value_buff) { @@ -10347,6 +10351,8 @@ Item *Item_cache_str::convert_to_basic_const_item(THD *thd) bool Item_cache_row::setup(THD *thd, Item *item) { example= item; + null_value= true; + if (!values && allocate(thd, item->cols())) return 1; for (uint i= 0; i < item_count; i++) @@ -10379,12 +10385,19 @@ bool Item_cache_row::cache_value() if (!example) return FALSE; value_cached= TRUE; - null_value= 0; + null_value= TRUE; + null_value_inside= false; example->bring_value(); + + /* + For Item_cache_row null_value is set to TRUE only when ALL the values + inside the cache are NULL + */ for (uint i= 0; i < item_count; i++) { values[i]->cache_value(); - null_value|= values[i]->null_value; + null_value&= values[i]->null_value; + null_value_inside|= values[i]->null_value; } return TRUE; } diff --git a/sql/item.h b/sql/item.h index d328a0ec923..a1c288ab1f0 100644 --- a/sql/item.h +++ b/sql/item.h @@ -6754,6 +6754,14 @@ protected: table_map used_table_map; public: + /* + This is set if at least one of the values of a sub query is NULL + Item_cache_row returns this with null_inside(). + For not row items, it's set to the value of null_value + It is set after cache_value() is called. + */ + bool null_value_inside; + Item_cache(THD *thd): Item(thd), Type_handler_hybrid_field_type(&type_handler_string), @@ -6763,6 +6771,7 @@ public: { maybe_null= 1; null_value= 1; + null_value_inside= true; } protected: Item_cache(THD *thd, const Type_handler *handler): @@ -6774,6 +6783,7 @@ protected: { maybe_null= 1; null_value= 1; + null_value_inside= true; } public: diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index ae3b96f8b8a..4a134e99bfc 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1571,7 +1571,7 @@ longlong Item_in_optimizer::val_int() DBUG_RETURN(res); } - if (cache->null_value) + if (cache->null_value_inside) { DBUG_PRINT("info", ("Left NULL...")); /* diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 76dbe06c50e..34ae6f54f8c 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -915,7 +915,7 @@ bool Item_subselect::expr_cache_is_needed(THD *thd) inline bool Item_in_subselect::left_expr_has_null() { - return (*(optimizer->get_cache()))->null_value; + return (*(optimizer->get_cache()))->null_value_inside; } @@ -1369,7 +1369,17 @@ bool Item_singlerow_subselect::null_inside() void Item_singlerow_subselect::bring_value() { if (!exec() && assigned()) - null_value= 0; + { + null_value= true; + for (uint i= 0; i < max_columns ; i++) + { + if (!row[i]->null_value) + { + null_value= false; + return; + } + } + } else reset(); } @@ -1395,7 +1405,11 @@ longlong Item_singlerow_subselect::val_int() { DBUG_ASSERT(fixed == 1); if (forced_const) - return value->val_int(); + { + longlong val= value->val_int(); + null_value= value->null_value; + return val; + } if (!exec() && !value->null_value) { null_value= FALSE; @@ -1404,6 +1418,7 @@ longlong Item_singlerow_subselect::val_int() else { reset(); + DBUG_ASSERT(null_value); return 0; } } @@ -1412,7 +1427,11 @@ String *Item_singlerow_subselect::val_str(String *str) { DBUG_ASSERT(fixed == 1); if (forced_const) - return value->val_str(str); + { + String *res= value->val_str(str); + null_value= value->null_value; + return res; + } if (!exec() && !value->null_value) { null_value= FALSE; @@ -1421,6 +1440,7 @@ String *Item_singlerow_subselect::val_str(String *str) else { reset(); + DBUG_ASSERT(null_value); return 0; } } @@ -1448,7 +1468,11 @@ my_decimal *Item_singlerow_subselect::val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); if (forced_const) - return value->val_decimal(decimal_value); + { + my_decimal *val= value->val_decimal(decimal_value); + null_value= value->null_value; + return val; + } if (!exec() && !value->null_value) { null_value= FALSE; @@ -1457,6 +1481,7 @@ my_decimal *Item_singlerow_subselect::val_decimal(my_decimal *decimal_value) else { reset(); + DBUG_ASSERT(null_value); return 0; } } @@ -1466,7 +1491,11 @@ bool Item_singlerow_subselect::val_bool() { DBUG_ASSERT(fixed == 1); if (forced_const) - return value->val_bool(); + { + bool val= value->val_bool(); + null_value= value->null_value; + return val; + } if (!exec() && !value->null_value) { null_value= FALSE; @@ -1475,6 +1504,7 @@ bool Item_singlerow_subselect::val_bool() else { reset(); + DBUG_ASSERT(null_value); return 0; } } @@ -1484,7 +1514,11 @@ bool Item_singlerow_subselect::get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t { DBUG_ASSERT(fixed == 1); if (forced_const) - return value->get_date(thd, ltime, fuzzydate); + { + bool val= value->get_date(thd, ltime, fuzzydate); + null_value= value->null_value; + return val; + } if (!exec() && !value->null_value) { null_value= FALSE; @@ -1493,6 +1527,7 @@ bool Item_singlerow_subselect::get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t else { reset(); + DBUG_ASSERT(null_value); return 1; } } diff --git a/sql/item_subselect.h b/sql/item_subselect.h index b5894041320..1089249c048 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -50,7 +50,11 @@ class Item_subselect :public Item_result_field, protected Used_tables_and_const_cache, protected With_sum_func_cache { - bool value_assigned; /* value already assigned to subselect */ + /* + Set to TRUE if the value is assigned for the subselect + FALSE: subquery not executed or the subquery returns an empty result + */ + bool value_assigned; bool own_engine; /* the engine was not taken from other Item_subselect */ protected: /* thread handler, will be assigned in fix_fields only */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 39c764d71b9..d96be8f13f7 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6964,8 +6964,11 @@ static int show_memory_used(THD *thd, SHOW_VAR *var, char *buff, var->type= SHOW_LONGLONG; var->value= buff; if (scope == OPT_GLOBAL) + { + calc_sum_of_all_status_if_needed(status_var); *(longlong*) buff= (status_var->global_memory_used + status_var->local_memory_used); + } else *(longlong*) buff= status_var->local_memory_used; return 0; diff --git a/sql/sql_class.h b/sql/sql_class.h index ff743519b1f..f001f14c219 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1016,11 +1016,24 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var); void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var, STATUS_VAR *dec_var); +uint calc_sum_of_all_status(STATUS_VAR *to); +static inline void calc_sum_of_all_status_if_needed(STATUS_VAR *to) +{ + if (to->local_memory_used == 0) + { + mysql_mutex_lock(&LOCK_status); + *to= global_status_var; + mysql_mutex_unlock(&LOCK_status); + calc_sum_of_all_status(to); + DBUG_ASSERT(to->local_memory_used); + } +} + /* Update global_memory_used. We have to do this with atomic_add as the global value can change outside of LOCK_status. */ -inline void update_global_memory_status(int64 size) +static inline void update_global_memory_status(int64 size) { DBUG_PRINT("info", ("global memory_used: %lld size: %lld", (longlong) global_status_var.global_memory_used, @@ -1038,7 +1051,7 @@ inline void update_global_memory_status(int64 size) @retval NULL on error @retval Pointter to CHARSET_INFO with the given name on success */ -inline CHARSET_INFO * +static inline CHARSET_INFO * mysqld_collation_get_by_name(const char *name, CHARSET_INFO *name_cs= system_charset_info) { @@ -1057,7 +1070,7 @@ mysqld_collation_get_by_name(const char *name, return cs; } -inline bool is_supported_parser_charset(CHARSET_INFO *cs) +static inline bool is_supported_parser_charset(CHARSET_INFO *cs) { return MY_TEST(cs->mbminlen == 1); } diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc index c32ea8c0238..815a0f43c17 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -907,6 +907,7 @@ st_select_lex_unit *With_element::clone_parsed_spec(THD *thd, with_table->next_global= spec_tables; } res= &lex->unit; + res->with_element= this; lex->unit.include_down(with_table->select_lex); lex->unit.set_slave(with_select); diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 4b879293fdb..8fae2073b01 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -1651,7 +1651,7 @@ void JOIN_CACHE::get_record_by_pos(uchar *rec_ptr) } -/* +/* Get the match flag from the referenced record: the default implementation SYNOPSIS @@ -1663,6 +1663,7 @@ void JOIN_CACHE::get_record_by_pos(uchar *rec_ptr) get the match flag for the record pointed by the reference at the position rec_ptr. If the match flag is placed in one of the previous buffers the function first reaches the linked record fields in this buffer. + The function returns the value of the first encountered match flag. RETURN VALUE match flag for the record at the position rec_ptr @@ -1687,6 +1688,39 @@ enum JOIN_CACHE::Match_flag JOIN_CACHE::get_match_flag_by_pos(uchar *rec_ptr) /* + Get the match flag for the referenced record from specified join buffer + + SYNOPSIS + get_match_flag_by_pos_from_join_buffer() + rec_ptr position of the first field of the record in the join buffer + tab join table with join buffer where to look for the match flag + + DESCRIPTION + This default implementation of the get_match_flag_by_pos_from_join_buffer + method gets the match flag for the record pointed by the reference at the + position rec_ptr from the join buffer attached to the join table tab. + + RETURN VALUE + match flag for the record at the position rec_ptr from the join + buffer attached to the table tab. +*/ + +enum JOIN_CACHE::Match_flag +JOIN_CACHE::get_match_flag_by_pos_from_join_buffer(uchar *rec_ptr, + JOIN_TAB *tab) +{ + DBUG_ASSERT(tab->cache && tab->cache->with_match_flag); + for (JOIN_CACHE *cache= this; ; ) + { + if (cache->join_tab == tab) + return (enum Match_flag) rec_ptr[0]; + cache= cache->prev_cache; + rec_ptr= cache->get_rec_ref(rec_ptr); + } +} + + +/* Calculate the increment of the auxiliary buffer for a record write SYNOPSIS @@ -1956,6 +1990,10 @@ bool JOIN_CACHE::read_referenced_field(CACHE_FIELD *copy, If the record is skipped the value of 'pos' is set to point to the position right after the record. + NOTE + Currently this function is called only when generating null complemented + records for outer joins (=> only when join_tab->first_unmatched != NULL). + RETURN VALUE TRUE the match flag is set to MATCH_FOUND and the record has been skipped FALSE otherwise @@ -1968,7 +2006,9 @@ bool JOIN_CACHE::skip_if_matched() if (prev_cache) offset+= prev_cache->get_size_of_rec_offset(); /* Check whether the match flag is MATCH_FOUND */ - if (get_match_flag_by_pos(pos+offset) == MATCH_FOUND) + if (get_match_flag_by_pos_from_join_buffer(pos+offset, + join_tab->first_unmatched) == + MATCH_FOUND) { pos+= size_of_rec_len + get_rec_length(pos); return TRUE; @@ -1985,13 +2025,23 @@ bool JOIN_CACHE::skip_if_matched() DESCRIPTION This default implementation of the virtual function skip_if_not_needed_match - skips the next record from the join buffer if its match flag is not - MATCH_NOT_FOUND, and, either its value is MATCH_FOUND and join_tab is the - first inner table of an inner join, or, its value is MATCH_IMPOSSIBLE - and join_tab is the first inner table of an outer join. + skips the next record from the join when generating join extensions + for the records in the join buffer depending on the value of the match flag. + - In the case of a semi-nest the match flag may be in two states + {MATCH_NOT_FOUND, MATCH_FOUND}. The record is skipped if the flag is set + to MATCH_FOUND. + - In the case of a outer join nest when not_exists optimization is applied + the match may be in three states {MATCH_NOT_FOUND, MATCH_IMPOSSIBLE, + MATCH_FOUND. The record is skipped if the flag is set to MATCH_FOUND or + to MATCH_IMPOSSIBLE. + If the record is skipped the value of 'pos' is set to point to the position right after the record. + NOTE + Currently the function is called only when generating non-null complemented + extensions for records in the join buffer. + RETURN VALUE TRUE the record has to be skipped FALSE otherwise @@ -2002,11 +2052,19 @@ bool JOIN_CACHE::skip_if_not_needed_match() DBUG_ASSERT(with_length); enum Match_flag match_fl; uint offset= size_of_rec_len; + bool skip= FALSE; if (prev_cache) offset+= prev_cache->get_size_of_rec_offset(); - if ((match_fl= get_match_flag_by_pos(pos+offset)) != MATCH_NOT_FOUND && - (join_tab->check_only_first_match() == (match_fl == MATCH_FOUND)) ) + if (!join_tab->check_only_first_match()) + return FALSE; + + match_fl= get_match_flag_by_pos(pos+offset); + skip= join_tab->first_sj_inner_tab ? + match_fl == MATCH_FOUND : // the case of semi-join + match_fl != MATCH_NOT_FOUND; // the case of outer-join + + if (skip) { pos+= size_of_rec_len + get_rec_length(pos); return TRUE; @@ -2111,7 +2169,14 @@ enum_nested_loop_state JOIN_CACHE::join_records(bool skip_last) goto finish; } join_tab->not_null_compl= FALSE; - /* Prepare for generation of null complementing extensions */ + /* + Prepare for generation of null complementing extensions. + For all inner tables of the outer join operation for which + regular matches have been just found the field 'first_unmatched' + is set to point the the first inner table. After all null + complement rows are generated for this outer join this field + is set back to NULL. + */ for (tab= join_tab->first_inner; tab <= join_tab->last_inner; tab++) tab->first_unmatched= join_tab->first_inner; } @@ -2228,7 +2293,10 @@ enum_nested_loop_state JOIN_CACHE::join_matching_records(bool skip_last) int error; enum_nested_loop_state rc= NESTED_LOOP_OK; join_tab->table->null_row= 0; - bool check_only_first_match= join_tab->check_only_first_match(); + bool check_only_first_match= + join_tab->check_only_first_match() && + (!join_tab->first_inner || // semi-join case + join_tab->first_inner == join_tab->first_unmatched); // outer join case bool outer_join_first_inner= join_tab->is_first_inner_for_outer_join(); DBUG_ENTER("JOIN_CACHE::join_matching_records"); diff --git a/sql/sql_join_cache.h b/sql/sql_join_cache.h index 7b8b942180f..d0bf4761f65 100644 --- a/sql/sql_join_cache.h +++ b/sql/sql_join_cache.h @@ -206,7 +206,9 @@ protected: /* This flag indicates that records written into the join buffer contain - a match flag field. The flag must be set by the init method. + a match flag field. The flag must be set by the init method. + Currently any implementation of the virtial init method calls + the function JOIN_CACHE::calc_record_fields() to set this flag. */ bool with_match_flag; /* @@ -646,6 +648,13 @@ public: /* Shall return the value of the match flag for the positioned record */ virtual enum Match_flag get_match_flag_by_pos(uchar *rec_ptr); + /* + Shall return the value of the match flag for the positioned record + from the join buffer attached to the specified table + */ + virtual enum Match_flag + get_match_flag_by_pos_from_join_buffer(uchar *rec_ptr, JOIN_TAB *tab); + /* Shall return the position of the current record */ virtual uchar *get_curr_rec() { return curr_rec_pos; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d1b4c2881aa..119c7360f07 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -9001,7 +9001,13 @@ push_new_name_resolution_context(THD *thd, left_op->first_leaf_for_name_resolution(); on_context->last_name_resolution_table= right_op->last_leaf_for_name_resolution(); - return thd->lex->push_context(on_context); + LEX *lex= thd->lex; + on_context->select_lex = lex->current_select; + st_select_lex *curr_select= lex->pop_select(); + st_select_lex *outer_sel= lex->select_stack_head(); + lex->push_select(curr_select); + on_context->outer_context = outer_sel ? &outer_sel->context : 0; + return lex->push_context(on_context); } diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic index 25fa4b3afd1..8f2296160e6 100644 --- a/sql/sql_plugin_services.ic +++ b/sql/sql_plugin_services.ic @@ -156,7 +156,6 @@ static struct wsrep_service_st wsrep_handler = { wsrep_thd_retry_counter, wsrep_thd_ignore_table, wsrep_thd_trx_seqno, - wsrep_thd_auto_increment_variables, wsrep_thd_is_aborting, wsrep_set_data_home_dir, wsrep_thd_is_BF, diff --git a/sql/sql_show.cc b/sql/sql_show.cc index f706b99a195..a5c9b505ec1 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3775,15 +3775,8 @@ static bool show_status_array(THD *thd, const char *wild, if (show_type == SHOW_SYS) mysql_mutex_lock(&LOCK_global_system_variables); - else if (show_type >= SHOW_LONG_STATUS && scope == OPT_GLOBAL && - !status_var->local_memory_used) - { - mysql_mutex_lock(&LOCK_status); - *status_var= global_status_var; - mysql_mutex_unlock(&LOCK_status); - calc_sum_of_all_status(status_var); - DBUG_ASSERT(status_var->local_memory_used); - } + else if (show_type >= SHOW_LONG_STATUS && scope == OPT_GLOBAL) + calc_sum_of_all_status_if_needed(status_var); pos= get_one_variable(thd, var, scope, show_type, status_var, &charset, buff, &length); diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc index 5174b6e0b07..68cc3cf4ae4 100644 --- a/sql/wsrep_dummy.cc +++ b/sql/wsrep_dummy.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2014, 2020, MariaDB +/* Copyright (C) 2014, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,14 +107,6 @@ const char* wsrep_thd_client_state_str(const THD*) const char* wsrep_thd_client_mode_str(const THD*) { return 0; } -void wsrep_thd_auto_increment_variables(THD *thd, - unsigned long long *offset, - unsigned long long *increment) -{ - *offset= thd->variables.auto_increment_offset; - *increment= thd->variables.auto_increment_increment; -} - const char* wsrep_thd_transaction_state_str(const THD*) { return 0; } diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index 816c8ce9fb6..15fd87eda5d 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -368,25 +368,6 @@ bool wsrep_bf_abort(const THD* bf_thd, THD* victim_thd) return ret; } -/* - Get auto increment variables for THD. Use global settings for - applier threads. - */ -void wsrep_thd_auto_increment_variables(THD* thd, - unsigned long long* offset, - unsigned long long* increment) -{ - if (wsrep_thd_is_applying(thd) && - thd->wsrep_trx().state() != wsrep::transaction::s_replaying) - { - *offset= global_system_variables.auto_increment_offset; - *increment= global_system_variables.auto_increment_increment; - return; - } - *offset= thd->variables.auto_increment_offset; - *increment= thd->variables.auto_increment_increment; -} - int wsrep_create_threadvars() { int ret= 0; |