diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-19 13:35:18 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-19 13:35:18 +0200 |
commit | 00528a04457d33210baceba1a79e82ea126b48bd (patch) | |
tree | dab4b198ef2e8a1473d9bbdc9c0fcd879cc4cd3c /sql/sql_class.h | |
parent | dbe941e06fe51fe0ff30dff5f1ae62960ff4fc61 (diff) | |
parent | 233c09138f10830ec07ca6a5277f18d415806ece (diff) | |
download | mariadb-git-00528a04457d33210baceba1a79e82ea126b48bd.tar.gz |
Merge 10.5 into 10.6
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 19 |
1 files changed, 16 insertions, 3 deletions
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); } |