diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-05-11 11:25:33 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-05-11 11:25:33 +0200 |
commit | fd132be117e44318de04973e8bc825651b220792 (patch) | |
tree | a78222eeae060b5a605633a9f603e5e7528f12c3 /sql/sql_class.h | |
parent | 7b05fc5cdd6058e91a26836ace54f45f37fa88b5 (diff) | |
parent | a917be3e7f07fc803fb04aba7173081550dcc7db (diff) | |
download | mariadb-git-fd132be117e44318de04973e8bc825651b220792.tar.gz |
Merge branch '10.6' into 10.7
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 73 |
1 files changed, 55 insertions, 18 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 9592eafde8e..f8985d2093d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2016, Oracle and/or its affiliates. - Copyright (c) 2009, 2021, MariaDB Corporation. + Copyright (c) 2009, 2022, 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 @@ -1181,7 +1181,7 @@ public: /* We build without RTTI, so dynamic_cast can't be used. */ enum Type { - STATEMENT, PREPARED_STATEMENT, STORED_PROCEDURE, TABLE_ARENA + STATEMENT, PREPARED_STATEMENT, STORED_PROCEDURE }; Query_arena(MEM_ROOT *mem_root_arg, enum enum_state state_arg) : @@ -2359,6 +2359,39 @@ struct wait_for_commit void reinit(); }; + +class Sp_caches +{ +public: + sp_cache *sp_proc_cache; + sp_cache *sp_func_cache; + sp_cache *sp_package_spec_cache; + sp_cache *sp_package_body_cache; + Sp_caches() + :sp_proc_cache(NULL), + sp_func_cache(NULL), + sp_package_spec_cache(NULL), + sp_package_body_cache(NULL) + { } + ~Sp_caches() + { + // All caches must be freed by the caller explicitly + DBUG_ASSERT(sp_proc_cache == NULL); + DBUG_ASSERT(sp_func_cache == NULL); + DBUG_ASSERT(sp_package_spec_cache == NULL); + DBUG_ASSERT(sp_package_body_cache == NULL); + } + void sp_caches_swap(Sp_caches &rhs) + { + swap_variables(sp_cache*, sp_proc_cache, rhs.sp_proc_cache); + swap_variables(sp_cache*, sp_func_cache, rhs.sp_func_cache); + swap_variables(sp_cache*, sp_package_spec_cache, rhs.sp_package_spec_cache); + swap_variables(sp_cache*, sp_package_body_cache, rhs.sp_package_body_cache); + } + void sp_caches_clear(); +}; + + extern "C" void my_message_sql(uint error, const char *str, myf MyFlags); @@ -2554,7 +2587,8 @@ class THD: public THD_count, /* this must be first */ */ public Item_change_list, public MDL_context_owner, - public Open_tables_state + public Open_tables_state, + public Sp_caches { private: inline bool is_stmt_prepare() const @@ -3583,10 +3617,6 @@ public: enum_sql_command last_sql_command; // Last sql_command exceuted in mysql_execute_command() sp_rcontext *spcont; // SP runtime context - sp_cache *sp_proc_cache; - sp_cache *sp_func_cache; - sp_cache *sp_package_spec_cache; - sp_cache *sp_package_body_cache; /** number of name_const() substitutions, see sp_head.cc:subst_spvars() */ uint query_name_consts; @@ -4384,8 +4414,7 @@ public: bool is_item_tree_change_register_required() { - return !stmt_arena->is_conventional() - || stmt_arena->type() == Query_arena::TABLE_ARENA; + return !stmt_arena->is_conventional(); } void change_item_tree(Item **place, Item *new_value) @@ -4975,18 +5004,18 @@ public: mdl_context.release_transactional_locks(this); } int decide_logging_format(TABLE_LIST *tables); + /* - In Some cases when decide_logging_format is called it does not have all - information to decide the logging format. So that cases we call decide_logging_format_2 - at later stages in execution. - One example would be binlog format for IODKU but column with unique key is not inserted. - We don't have inserted columns info when we call decide_logging_format so on later stage we call - decide_logging_format_low + In Some cases when decide_logging_format is called it does not have + all information to decide the logging format. So that cases we call + decide_logging_format_2 at later stages in execution. - @returns 0 if no format is changed - 1 if there is change in binlog format + One example would be binlog format for insert on duplicate key + (IODKU) but column with unique key is not inserted. We do not have + inserted columns info when we call decide_logging_format so on + later stage we call reconsider_logging_format_for_iodup() */ - int decide_logging_format_low(TABLE *table); + void reconsider_logging_format_for_iodup(TABLE *table); enum need_invoker { INVOKER_NONE=0, INVOKER_USER, INVOKER_ROLE}; void binlog_invoker(bool role) { m_binlog_invoker= role ? INVOKER_ROLE : INVOKER_USER; } @@ -5236,6 +5265,14 @@ public: bool is_binlog_dump_thread(); #endif + /* + Indicates if this thread is suspended due to awaiting an ACK from a + replica. True if suspended, false otherwise. + + Note that this variable is protected by Repl_semi_sync_master::LOCK_binlog + */ + bool is_awaiting_semisync_ack; + inline ulong wsrep_binlog_format() const { return WSREP_BINLOG_FORMAT(variables.binlog_format); |