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

Function find_sys_var

sql/sql_plugin.cc:2976–3002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2974****************************************************************************/
2975
2976sys_var *find_sys_var(THD *thd, const char *str, size_t length,
2977 bool throw_error, bool hash_already_locked)
2978{
2979 sys_var *var;
2980 sys_var_pluginvar *pi;
2981 DBUG_ENTER("find_sys_var");
2982 DBUG_PRINT("enter", ("var '%.*s'", (int)length, str));
2983
2984 if (!hash_already_locked)
2985 mysql_prlock_rdlock(&LOCK_system_variables_hash);
2986 if ((var= intern_find_sys_var(str, length)) &&
2987 (pi= var->cast_pluginvar()))
2988 {
2989 mysql_mutex_lock(&LOCK_plugin);
2990 if (!intern_plugin_lock(thd ? thd->lex : 0, plugin_int_to_ref(pi->plugin),
2991 PLUGIN_IS_READY))
2992 var= NULL; /* failed to lock it, it must be uninstalling */
2993 mysql_mutex_unlock(&LOCK_plugin);
2994 }
2995 if (!hash_already_locked)
2996 mysql_prlock_unlock(&LOCK_system_variables_hash);
2997
2998 if (unlikely(!throw_error && !var))
2999 my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0),
3000 (int) (length ? length : strlen(str)), (char*) str);
3001 DBUG_RETURN(var);
3002}
3003
3004
3005/*

Callers 8

get_system_varFunction · 0.85
set_system_variableMethod · 0.85
parse_var_listMethod · 0.85

Calls 4

intern_find_sys_varFunction · 0.85
intern_plugin_lockFunction · 0.85
my_errorFunction · 0.85
cast_pluginvarMethod · 0.45

Tested by

no test coverage detected