MCPcopy Create free account
hub / github.com/MariaDB/server / show_status_array

Function show_status_array

sql/sql_show.cc:3995–4141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3993
3994
3995static bool show_status_array(THD *thd, const char *wild,
3996 SHOW_VAR *variables,
3997 enum enum_var_type scope,
3998 struct system_status_var *status_var,
3999 const LEX_CSTRING &prefix, TABLE *table,
4000 bool ucase_names,
4001 COND *cond)
4002{
4003 my_aligned_storage<SHOW_VAR_FUNC_BUFF_SIZE, MY_ALIGNOF(long)> buffer;
4004 char * const buff= buffer.data;
4005 CharBuffer<NAME_CHAR_LEN> name_buffer;
4006 SHOW_VAR tmp, *var;
4007 bool res= FALSE;
4008 CHARSET_INFO *charset= system_charset_info;
4009 DBUG_ENTER("show_status_array");
4010
4011 if (prefix.length)
4012 {
4013 if (ucase_names)
4014 name_buffer.copy_caseup(system_charset_info, prefix);
4015 else
4016 name_buffer.copy_casedn(system_charset_info, prefix);
4017 name_buffer.append(Lex_cstring("_", 1));
4018 }
4019 size_t prefix_length= name_buffer.length();
4020
4021#ifdef WITH_WSREP
4022 bool is_wsrep_var= FALSE;
4023 /*
4024 This is a workaround for lp:1306875 (PBX) to skip switching of wsrep
4025 status variable name's first letter to uppercase. This is an optimization
4026 for status variables defined under wsrep plugin.
4027 TODO: remove once lp:1306875 has been addressed.
4028 */
4029 if (prefix.length && Lex_ident_sys_var(prefix).streq("wsrep"_LEX_CSTRING))
4030 {
4031 is_wsrep_var= TRUE;
4032 }
4033#endif /* WITH_WSREP */
4034
4035 for (; variables->name; variables++)
4036 {
4037 bool wild_checked= false;
4038 Lex_cstring_strlen var_name(variables->name);
4039 name_buffer.truncate(prefix_length);
4040
4041#ifdef WITH_WSREP
4042 /*
4043 If the prefix is NULL, that means we are looking into the status variables
4044 defined directly under mysqld.cc. Do not capitalize wsrep status variable
4045 names until lp:1306875 has been fixed.
4046 TODO: remove once lp:1306875 has been addressed.
4047 */
4048 if (!prefix.length &&
4049 !strncasecmp(variables->name, STRING_WITH_LEN("wsrep")))
4050 {
4051 is_wsrep_var= TRUE;
4052 }

Callers 2

fill_variablesFunction · 0.85
fill_statusFunction · 0.85

Calls 15

Lex_cstringClass · 0.85
Lex_ident_sys_varClass · 0.85
wild_case_compareFunction · 0.85
get_one_variableFunction · 0.85
copy_caseupMethod · 0.80
copy_casednMethod · 0.80
set_notnullMethod · 0.80
get_stmt_daMethod · 0.80
appendMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected