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

Method session_is_default

sql/sql_plugin.cc:3567–3597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3565
3566
3567bool sys_var_pluginvar::session_is_default(THD *thd)
3568{
3569 uchar *value= plugin_var->flags & PLUGIN_VAR_THDLOCAL
3570 ? static_cast<uchar*>(intern_sys_var_ptr(thd, *(int*) (plugin_var+1), true))
3571 : *reinterpret_cast<uchar**>(plugin_var+1);
3572
3573 real_value_ptr(thd, OPT_SESSION);
3574
3575 switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
3576 case PLUGIN_VAR_BOOL:
3577 return option.def_value == *(my_bool*)value;
3578 case PLUGIN_VAR_INT:
3579 return option.def_value == *(int*)value;
3580 case PLUGIN_VAR_LONG:
3581 case PLUGIN_VAR_ENUM:
3582 return option.def_value == *(long*)value;
3583 case PLUGIN_VAR_LONGLONG:
3584 case PLUGIN_VAR_SET:
3585 return option.def_value == *(longlong*)value;
3586 case PLUGIN_VAR_STR:
3587 {
3588 const char *a=(char*)option.def_value;
3589 const char *b=(char*)value;
3590 return (!a && !b) || (a && b && strcmp(a,b));
3591 }
3592 case PLUGIN_VAR_DOUBLE:
3593 return getopt_ulonglong2double(option.def_value) == *(double*)value;
3594 }
3595 DBUG_ASSERT(0);
3596 return 0;
3597}
3598
3599
3600TYPELIB* sys_var_pluginvar::plugin_var_typelib(void) const

Callers 2

extend_option_listFunction · 0.45

Calls 2

intern_sys_var_ptrFunction · 0.85
getopt_ulonglong2doubleFunction · 0.85

Tested by

no test coverage detected