1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

cleanup: sysvar, only one common check_update_type()

This commit is contained in:
Sergei Golubchik
2014-08-27 20:32:32 +02:00
parent 051c132635
commit 28ebc2a724
3 changed files with 31 additions and 70 deletions

View File

@@ -273,7 +273,6 @@ public:
plugin_var(plugin_var_arg)
{ plugin_var->name= name_arg; }
sys_var_pluginvar *cast_pluginvar() { return this; }
bool check_update_type(Item_result type);
SHOW_TYPE show_type();
uchar* real_value_ptr(THD *thd, enum_var_type type);
TYPELIB* plugin_var_typelib(void);
@@ -3251,27 +3250,6 @@ static SHOW_TYPE pluginvar_show_type(st_mysql_sys_var *plugin_var)
}
bool sys_var_pluginvar::check_update_type(Item_result type)
{
switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
case PLUGIN_VAR_INT:
case PLUGIN_VAR_LONG:
case PLUGIN_VAR_LONGLONG:
return type != INT_RESULT;
case PLUGIN_VAR_STR:
return type != STRING_RESULT;
case PLUGIN_VAR_ENUM:
case PLUGIN_VAR_BOOL:
case PLUGIN_VAR_SET:
return type != STRING_RESULT && type != INT_RESULT;
case PLUGIN_VAR_DOUBLE:
return type != INT_RESULT && type != REAL_RESULT && type != DECIMAL_RESULT;
default:
return true;
}
}
uchar* sys_var_pluginvar::real_value_ptr(THD *thd, enum_var_type type)
{
DBUG_ASSERT(thd || (type == OPT_GLOBAL));