Commit c295e3d7 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 2fce37d2
...@@ -1032,7 +1032,7 @@ static void init_one_value(const struct my_option *option, void *variable, ...@@ -1032,7 +1032,7 @@ static void init_one_value(const struct my_option *option, void *variable,
*((ulonglong*) variable)= (ulonglong) value; *((ulonglong*) variable)= (ulonglong) value;
break; break;
case GET_DOUBLE: case GET_DOUBLE:
*((double*) variable)= (double) value; *((double*) variable)= ulonglong2double(value);
break; break;
case GET_STR: case GET_STR:
/* /*
......
...@@ -183,9 +183,8 @@ inline bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list) ...@@ -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, inline bool check_some_routine_access(THD *thd, const char *db,
const char *name, bool is_proc) const char *name, bool is_proc)
{ return false; } { return false; }
inline bool check_access(THD *thd, ulong access, const char *db, inline bool check_access(THD *, ulong, const char *, ulong *save_priv,
ulong *save_priv, bool no_grant, bool no_errors, GRANT_INTERNAL_INFO *, bool, bool)
bool schema_db)
{ {
if (save_priv) if (save_priv)
*save_priv= GLOBAL_ACLS; *save_priv= GLOBAL_ACLS;
......
...@@ -942,10 +942,10 @@ static bool update_cached_long_query_time(sys_var *self, THD *thd, ...@@ -942,10 +942,10 @@ static bool update_cached_long_query_time(sys_var *self, THD *thd,
{ {
if (type == OPT_SESSION) if (type == OPT_SESSION)
thd->variables.long_query_time= thd->variables.long_query_time=
thd->variables.long_query_time_double * 1e6; double2ulonglong(thd->variables.long_query_time_double * 1e6);
else else
global_system_variables.long_query_time= 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; return false;
} }
......
...@@ -741,13 +741,13 @@ public: ...@@ -741,13 +741,13 @@ public:
uint deprecated_version=0, const char *substitute=0, uint deprecated_version=0, const char *substitute=0,
int parse_flag= PARSE_NORMAL) int parse_flag= PARSE_NORMAL)
: sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id, : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id,
getopt.arg_type, SHOW_DOUBLE, def_val, lock, binlog_status_arg, getopt.arg_type, SHOW_DOUBLE, (longlong) double2ulonglong(def_val),
on_check_func, on_update_func, deprecated_version, substitute, lock, binlog_status_arg, on_check_func, on_update_func,
parse_flag) deprecated_version, substitute, parse_flag)
{ {
option.var_type= GET_DOUBLE; option.var_type= GET_DOUBLE;
option.min_value= min_val; option.min_value= (longlong) double2ulonglong(min_val);
option.max_value= max_val; option.max_value= (longlong) double2ulonglong(max_val);
global_var(double)= (double)option.def_value; global_var(double)= (double)option.def_value;
DBUG_ASSERT(min_val < max_val); DBUG_ASSERT(min_val < max_val);
DBUG_ASSERT(min_val <= def_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