Commit 3e2cd574 authored by unknown's avatar unknown

WL#2936 - Falcon & MySQL plugin interface: server variables

Avoid compiler warnings


cmd-line-utils/readline/rltty.c:
  Avoid a compiler warning
config/ac-macros/misc.m4:
  Avoid a compiler warning, which could abort ./configure
  if CFLAGS contain -Werror.
parent c63e7c3e
......@@ -139,8 +139,7 @@ static int ksrflow;
/* Dummy call to force a backgrounded readline to stop before it tries
to get the tty settings. */
static void
set_winsize (tty)
int tty;
set_winsize (int tty __attribute__((unused)))
{
#if defined (TIOCGWINSZ)
struct winsize w;
......
......@@ -479,7 +479,7 @@ AC_MSG_CHECKING(if conversion of longlong to float works)
AC_CACHE_VAL(ac_cv_conv_longlong_to_float,
[AC_TRY_RUN([#include <stdio.h>
typedef long long longlong;
main()
int main()
{
longlong ll=1;
float f;
......@@ -487,7 +487,7 @@ main()
f = (float) ll;
fprintf(file,"%g\n",f);
fclose(file);
exit (0);
return (0);
}], ac_cv_conv_longlong_to_float=`cat conftestval`, ac_cv_conv_longlong_to_float=0, ifelse([$2], , , ac_cv_conv_longlong_to_float=$2))])dnl
if test "$ac_cv_conv_longlong_to_float" = "1" -o "$ac_cv_conv_longlong_to_float" = "yes"
then
......
......@@ -842,19 +842,23 @@ static void init_one_value(const struct my_option *option, gptr *variable,
/*
Do not clear variable value if it has no default value.
The default value may already be set.
NOTE: To avoid compiler warnings, we first cast longlong to intptr,
so that the value has the same size as a pointer.
*/
if ((char*) value)
*((char**) variable)= (char*) value;
if ((char*) (intptr) value)
*((char**) variable)= (char*) (intptr) value;
break;
case GET_STR_ALLOC:
/*
Do not clear variable value if it has no default value.
The default value may already be set.
NOTE: To avoid compiler warnings, we first cast longlong to intptr,
so that the value has the same size as a pointer.
*/
if ((char*) value)
if ((char*) (intptr) value)
{
my_free((*(char**) variable), MYF(MY_ALLOW_ZERO_PTR));
*((char**) variable)= my_strdup((char*) value, MYF(MY_WME));
*((char**) variable)= my_strdup((char*) (intptr) value, MYF(MY_WME));
}
break;
default: /* dummy default to avoid compiler warnings */
......
......@@ -677,7 +677,6 @@ pthread_handler_t signal_hand(void *arg);
static void mysql_init_variables(void);
static void get_options(int *argc,char **argv);
static my_bool get_one_option(int, const struct my_option *, char *);
static void usage(void);
static void set_server_version(void);
static int init_thread_environment();
static char *get_relative_path(const char *path);
......@@ -700,6 +699,7 @@ static void clean_up(bool print_message);
static int test_if_case_insensitive(const char *dir_name);
#ifndef EMBEDDED_LIBRARY
static void usage(void);
static void start_signal_handler(void);
static void close_server_sock();
static void clean_up_mutexes(void);
......@@ -6877,6 +6877,7 @@ static void print_version(void)
server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT);
}
#ifndef EMBEDDED_LIBRARY
static void usage(void)
{
if (!(default_charset_info= get_charset_by_csname(default_character_set_name,
......@@ -6922,6 +6923,7 @@ To see what values a running MySQL server is using, type\n\
'mysqladmin variables' instead of 'mysqld --verbose --help'.\n");
}
}
#endif /*!EMBEDDED_LIBRARY*/
/*
......
......@@ -43,37 +43,37 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables);
const char *any_db="*any*"; // Special symbol for check_access
const LEX_STRING command_name[]={
{ STRING_WITH_LEN("Sleep") },
{ STRING_WITH_LEN("Quit") },
{ STRING_WITH_LEN("Init DB") },
{ STRING_WITH_LEN("Query") },
{ STRING_WITH_LEN("Field List") },
{ STRING_WITH_LEN("Create DB") },
{ STRING_WITH_LEN("Drop DB") },
{ STRING_WITH_LEN("Refresh") },
{ STRING_WITH_LEN("Shutdown") },
{ STRING_WITH_LEN("Statistics") },
{ STRING_WITH_LEN("Processlist") },
{ STRING_WITH_LEN("Connect") },
{ STRING_WITH_LEN("Kill") },
{ STRING_WITH_LEN("Debug") },
{ STRING_WITH_LEN("Ping") },
{ STRING_WITH_LEN("Time") },
{ STRING_WITH_LEN("Delayed insert") },
{ STRING_WITH_LEN("Change user") },
{ STRING_WITH_LEN("Binlog Dump") },
{ STRING_WITH_LEN("Table Dump") },
{ STRING_WITH_LEN("Connect Out") },
{ STRING_WITH_LEN("Register Slave") },
{ STRING_WITH_LEN("Prepare") },
{ STRING_WITH_LEN("Execute") },
{ STRING_WITH_LEN("Long Data") },
{ STRING_WITH_LEN("Close stmt") },
{ STRING_WITH_LEN("Reset stmt") },
{ STRING_WITH_LEN("Set option") },
{ STRING_WITH_LEN("Fetch") },
{ STRING_WITH_LEN("Daemon") },
{ STRING_WITH_LEN("Error") } // Last command number
{ C_STRING_WITH_LEN("Sleep") },
{ C_STRING_WITH_LEN("Quit") },
{ C_STRING_WITH_LEN("Init DB") },
{ C_STRING_WITH_LEN("Query") },
{ C_STRING_WITH_LEN("Field List") },
{ C_STRING_WITH_LEN("Create DB") },
{ C_STRING_WITH_LEN("Drop DB") },
{ C_STRING_WITH_LEN("Refresh") },
{ C_STRING_WITH_LEN("Shutdown") },
{ C_STRING_WITH_LEN("Statistics") },
{ C_STRING_WITH_LEN("Processlist") },
{ C_STRING_WITH_LEN("Connect") },
{ C_STRING_WITH_LEN("Kill") },
{ C_STRING_WITH_LEN("Debug") },
{ C_STRING_WITH_LEN("Ping") },
{ C_STRING_WITH_LEN("Time") },
{ C_STRING_WITH_LEN("Delayed insert") },
{ C_STRING_WITH_LEN("Change user") },
{ C_STRING_WITH_LEN("Binlog Dump") },
{ C_STRING_WITH_LEN("Table Dump") },
{ C_STRING_WITH_LEN("Connect Out") },
{ C_STRING_WITH_LEN("Register Slave") },
{ C_STRING_WITH_LEN("Prepare") },
{ C_STRING_WITH_LEN("Execute") },
{ C_STRING_WITH_LEN("Long Data") },
{ C_STRING_WITH_LEN("Close stmt") },
{ C_STRING_WITH_LEN("Reset stmt") },
{ C_STRING_WITH_LEN("Set option") },
{ C_STRING_WITH_LEN("Fetch") },
{ C_STRING_WITH_LEN("Daemon") },
{ C_STRING_WITH_LEN("Error") } // Last command number
};
const char *xa_state_names[]={
......
......@@ -2506,10 +2506,9 @@ byte* sys_var_pluginvar::value_ptr(THD *thd, enum_var_type type,
result= real_value_ptr(thd, type);
if ((plugin_var->flags && PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_ENUM)
if ((plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_ENUM)
result= (byte*) get_type(plugin_var_typelib(), *(ulong*)result);
else
if ((plugin_var->flags && PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_SET)
else if ((plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_SET)
{
char buffer[STRING_BUFFER_USUAL_SIZE];
String str(buffer, sizeof(buffer), system_charset_info);
......@@ -2620,7 +2619,7 @@ bool sys_var_pluginvar::update(THD *thd, set_var *var)
options->def_value= (opt)->def_val; \
options->min_value= (opt)->min_val; \
options->max_value= (opt)->max_val; \
options->block_size= (opt)->blk_sz
options->block_size= (long) (opt)->blk_sz
static void plugin_opt_set_limits(struct my_option *options,
......
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