MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / update

Method update

sql/set_var.cc:174–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174bool sys_var::update(THD *thd, set_var *var)
175{
176 enum_var_type type= var->type;
177 if (type == OPT_GLOBAL || scope() == GLOBAL)
178 {
179 /*
180 Yes, both locks need to be taken before an update, just as
181 both are taken to get a value. If we'll take only 'guard' here,
182 then value_ptr() for strings won't be safe in SHOW VARIABLES anymore,
183 to make it safe we'll need value_ptr_unlock().
184 */
185 AutoWLock lock1(&PLock_global_system_variables);
186 AutoWLock lock2(guard);
187 return global_update(thd, var) ||
188 (on_update && on_update(this, thd, OPT_GLOBAL));
189 }
190 else
191 return session_update(thd, var) ||
192 (on_update && on_update(this, thd, OPT_SESSION));
193}
194
195uchar *sys_var::session_value_ptr(THD *thd, LEX_STRING *base)
196{

Callers

nothing calls this directly

Calls 2

set_defaultMethod · 0.80
update_charsetMethod · 0.80

Tested by

no test coverage detected