Commit 68db3c52 authored by Davi Arnaut's avatar Davi Arnaut

Bug#45288: pb2 returns a lot of compilation warnings on linux

Fix compiler warnings due to: a mismatch in the prototypes for
check_access and implicit conversions from double to ulonglong
and vice-versa.

mysys/my_getopt.c:
  Explicit conversion from ulonglong to double. Might need to
  be tweaked in the future.
sql/sql_parse.h:
  Make prototype equal to the case when not compiling under embedded.
sql/sys_vars.cc:
  Explicit conversion from ulonglong to double. Destination var
  is a ulonglong.
sql/sys_vars.h:
  Explicit conversion from ulonglong to double. Might need to
  be tweaked in the future.
parent dfd35b86
......@@ -1032,7 +1032,7 @@ static void init_one_value(const struct my_option *option, void *variable,
*((ulonglong*) variable)= (ulonglong) value;
break;
case GET_DOUBLE:
*((double*) variable)= (double) value;
*((double*) variable)= ulonglong2double(value);
break;
case GET_STR:
/*
......
......@@ -183,9 +183,8 @@ inline bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list)
inline bool check_some_routine_access(THD *thd, const char *db,
const char *name, bool is_proc)
{ return false; }
inline bool check_access(THD *thd, ulong access, const char *db,
ulong *save_priv, bool no_grant, bool no_errors,
bool schema_db)
inline bool check_access(THD *, ulong, const char *, ulong *save_priv,
GRANT_INTERNAL_INFO *, bool, bool)
{
if (save_priv)
*save_priv= GLOBAL_ACLS;
......
......@@ -942,10 +942,10 @@ static bool update_cached_long_query_time(sys_var *self, THD *thd,
{
if (type == OPT_SESSION)
thd->variables.long_query_time=
thd->variables.long_query_time_double * 1e6;
double2ulonglong(thd->variables.long_query_time_double * 1e6);
else
global_system_variables.long_query_time=
global_system_variables.long_query_time_double * 1e6;
double2ulonglong(global_system_variables.long_query_time_double * 1e6);
return false;
}
......
......@@ -741,13 +741,13 @@ class Sys_var_double: public sys_var
uint deprecated_version=0, 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, def_val, lock, binlog_status_arg,
on_check_func, on_update_func, deprecated_version, substitute,
parse_flag)
getopt.arg_type, SHOW_DOUBLE, (longlong) double2ulonglong(def_val),
lock, binlog_status_arg, on_check_func, on_update_func,
deprecated_version, substitute, parse_flag)
{
option.var_type= GET_DOUBLE;
option.min_value= min_val;
option.max_value= max_val;
option.min_value= (longlong) double2ulonglong(min_val);
option.max_value= (longlong) double2ulonglong(max_val);
global_var(double)= (double)option.def_value;
DBUG_ASSERT(min_val < max_val);
DBUG_ASSERT(min_val <= def_val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment