summaryrefslogtreecommitdiff
path: root/sql/sys_vars.h
diff options
context:
space:
mode:
authorAshish Agarwal <ashish.y.agarwal@oracle.com>2013-05-19 23:38:06 +0530
committerAshish Agarwal <ashish.y.agarwal@oracle.com>2013-05-19 23:38:06 +0530
commit0c4f4ff015f7c4a06b9d4c9e8f22f44a57e2a318 (patch)
tree24753afbd8c14c24de460f691e8e4a67e50a32c8 /sql/sys_vars.h
parent5ca36b3b46de00e9eb8030c0551e7e97bc8e24eb (diff)
downloadmariadb-git-0c4f4ff015f7c4a06b9d4c9e8f22f44a57e2a318.tar.gz
Bug#16194302: SUPPORT FOR FLOATING-POINT SYSTEM VARIABLES
USING THE PLUGIN INTERFACE. ISSUE: No support for floating-point plugin system variables. SOLUTION: Allowing plugins to define and expose floating-point system variables of type double. MYSQL_SYSVAR_DOUBLE and MYSQL_THDVAR_DOUBLE are added. ISSUE: Fractional part of the def, min, max values of system variables are ignored. SOLUTION: Adding functions that are used to store the raw representation of a double in the raw bits of unsigned longlong in a way that the binary representation remains the same.
Diffstat (limited to 'sql/sys_vars.h')
-rw-r--r--sql/sys_vars.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sys_vars.h b/sql/sys_vars.h
index ca6e7d40b0e..443e843bdde 100644
--- a/sql/sys_vars.h
+++ b/sql/sys_vars.h
@@ -729,13 +729,14 @@ public:
const char *substitute=0,
int parse_flag= PARSE_NORMAL)
: sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
- getopt.arg_type, SHOW_DOUBLE, (longlong) double2ulonglong(def_val),
+ getopt.arg_type, SHOW_DOUBLE,
+ (longlong) getopt_double2ulonglong(def_val),
lock, binlog_status_arg, on_check_func, on_update_func,
substitute, parse_flag)
{
option.var_type= GET_DOUBLE;
- option.min_value= (longlong) double2ulonglong(min_val);
- option.max_value= (longlong) double2ulonglong(max_val);
+ option.min_value= (longlong) getopt_double2ulonglong(min_val);
+ option.max_value= (longlong) getopt_double2ulonglong(max_val);
global_var(double)= (double)option.def_value;
DBUG_ASSERT(min_val < max_val);
DBUG_ASSERT(min_val <= def_val);
@@ -767,7 +768,7 @@ public:
void session_save_default(THD *thd, set_var *var)
{ var->save_result.double_value= global_var(double); }
void global_save_default(THD *thd, set_var *var)
- { var->save_result.double_value= (double)option.def_value; }
+ { var->save_result.double_value= getopt_ulonglong2double(option.def_value); }
};
/**