MDEV-12684 Show what config file a sysvar got a value from

change get_one_option() prototype to pass the filename and
not to pass the redundant optid.
This commit is contained in:
Sergei Golubchik 2019-09-29 16:30:57 +02:00
parent 927521a2c1
commit f217612fad
44 changed files with 151 additions and 153 deletions

View File

@ -1728,10 +1728,9 @@ static void usage(int version)
my_bool my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt, char *argument, const char *)
char *argument)
{ {
switch(optid) { switch(opt->id) {
case OPT_CHARSETS_DIR: case OPT_CHARSETS_DIR:
strmake_buf(mysql_charsets_dir, argument); strmake_buf(mysql_charsets_dir, argument);
charsets_dir = mysql_charsets_dir; charsets_dir = mysql_charsets_dir;

View File

@ -474,11 +474,10 @@ static void print_default_values(void)
*/ */
static my_bool static my_bool
get_one_option(int optid, get_one_option(const struct my_option *opt,
const struct my_option *opt __attribute__((unused)), char *argument, const char *filename __attribute__((unused)))
char *argument)
{ {
switch(optid) { switch(opt->id) {
case 'n': case 'n':
opt_no_defaults++; opt_no_defaults++;
break; break;

View File

@ -268,12 +268,12 @@ static void add_one_option_cnf_file(DYNAMIC_STRING *ds,
} }
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt, get_one_option(const struct my_option *opt, char *argument,
char *argument) const char *filename __attribute__((unused)))
{ {
my_bool add_option= TRUE; my_bool add_option= TRUE;
switch (optid) { switch (opt->id) {
case '?': case '?':
printf("%s Ver %s Distrib %s, for %s (%s)\n", printf("%s Ver %s Distrib %s, for %s (%s)\n",
@ -317,7 +317,7 @@ get_one_option(int optid, const struct my_option *opt,
case 'b': /* --basedir */ case 'b': /* --basedir */
case 'd': /* --datadir */ case 'd': /* --datadir */
fprintf(stderr, "%s: the '--%s' option is always ignored\n", fprintf(stderr, "%s: the '--%s' option is always ignored\n",
my_progname, optid == 'b' ? "basedir" : "datadir"); my_progname, opt->id == 'b' ? "basedir" : "datadir");
/* FALLTHROUGH */ /* FALLTHROUGH */
case 'k': /* --version-check */ case 'k': /* --version-check */

View File

@ -241,10 +241,9 @@ static const char *load_default_groups[]=
0 }; 0 };
my_bool my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt, char *argument, const char *)
char *argument)
{ {
switch(optid) { switch(opt->id) {
case 'c': case 'c':
opt_count_iterations= 1; opt_count_iterations= 1;
break; break;

View File

@ -1932,11 +1932,10 @@ static my_time_t convert_str_to_timestamp(const char* str)
extern "C" my_bool extern "C" my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt, char *argument, const char *)
char *argument)
{ {
bool tty_password=0; bool tty_password=0;
switch (optid) { switch (opt->id) {
#ifndef DBUG_OFF #ifndef DBUG_OFF
case '#': case '#':
if (!argument) if (!argument)

View File

@ -284,13 +284,13 @@ static void usage(void)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument) char *argument, const char *filename __attribute__((unused)))
{ {
int orig_what_to_do= what_to_do; int orig_what_to_do= what_to_do;
DBUG_ENTER("get_one_option"); DBUG_ENTER("get_one_option");
switch(optid) { switch(opt->id) {
case 'a': case 'a':
what_to_do = DO_ANALYZE; what_to_do = DO_ANALYZE;
break; break;

View File

@ -815,10 +815,10 @@ uchar* get_table_key(const char *entry, size_t *length,
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument) char *argument, const char *filename __attribute__((unused)))
{ {
switch (optid) { switch (opt->id) {
case 'p': case 'p':
if (argument == disabled_my_option) if (argument == disabled_my_option)
argument= (char*) ""; /* Don't require password */ argument= (char*) ""; /* Don't require password */

View File

@ -221,10 +221,10 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt, char *argument,
char *argument) const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'p': case 'p':
if (argument == disabled_my_option) if (argument == disabled_my_option)
argument= (char*) ""; /* Don't require password */ argument= (char*) ""; /* Don't require password */

View File

@ -289,10 +289,10 @@ are shown.");
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt, char *argument,
char *argument) const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'v': case 'v':
opt_verbose++; opt_verbose++;
break; break;

View File

@ -726,11 +726,11 @@ static void usage(void)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt, char *argument,
char *argument) const char *filename __attribute__((unused)))
{ {
DBUG_ENTER("get_one_option"); DBUG_ENTER("get_one_option");
switch(optid) { switch(opt->id) {
case 'v': case 'v':
verbose++; verbose++;
break; break;

View File

@ -96,8 +96,7 @@ static int setenv(const char *name, const char *value, int overwrite);
C_MODE_START C_MODE_START
static sig_handler signal_handler(int sig); static sig_handler signal_handler(int sig);
static my_bool get_one_option(int optid, const struct my_option *, static my_bool get_one_option(const struct my_option *, char *, const char *);
char *argument);
C_MODE_END C_MODE_END
enum { enum {
@ -7193,9 +7192,9 @@ void read_embedded_server_arguments(const char *name)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt, char *argument) get_one_option(const struct my_option *opt, char *argument, const char *)
{ {
switch(optid) { switch(opt->id) {
case '#': case '#':
#ifndef DBUG_OFF #ifndef DBUG_OFF
DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysqltest.trace"); DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysqltest.trace");

View File

@ -150,8 +150,6 @@ static uint parse_input_file(const char *file_name, struct errors **top_error,
static int get_options(int *argc, char ***argv); static int get_options(int *argc, char ***argv);
static void print_version(void); static void print_version(void);
static void usage(void); static void usage(void);
static my_bool get_one_option(int optid, const struct my_option *opt,
char *argument);
static char *parse_text_line(char *pos); static char *parse_text_line(char *pos);
static int copy_rows(FILE * to, char *row, int row_nr, long start_pos); static int copy_rows(FILE * to, char *row, int row_nr, long start_pos);
static char *parse_default_language(char *str); static char *parse_default_language(char *str);
@ -1134,11 +1132,12 @@ static void print_version(void)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__ ((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__ ((unused))) char *argument __attribute__ ((unused)),
const char *filename __attribute__ ((unused)))
{ {
DBUG_ENTER("get_one_option"); DBUG_ENTER("get_one_option");
switch (optid) { switch (opt->id) {
case 'V': case 'V':
print_version(); print_version();
my_end(0); my_end(0);

View File

@ -1332,11 +1332,11 @@ static void usage(void)
extern "C" my_bool extern "C" my_bool
innochecksum_get_one_option( innochecksum_get_one_option(
int optid, const struct my_option *opt,
const struct my_option *opt MY_ATTRIBUTE((unused)), char *argument MY_ATTRIBUTE((unused)),
char *argument MY_ATTRIBUTE((unused))) const char *)
{ {
switch (optid) { switch (opt->id) {
#ifndef DBUG_OFF #ifndef DBUG_OFF
case '#': case '#':
dbug_setting = argument dbug_setting = argument

View File

@ -728,11 +728,10 @@ indicates an error.\n");
static static
my_bool my_bool
ibx_get_one_option(int optid, ibx_get_one_option(const struct my_option *opt,
const struct my_option *opt __attribute__((unused)), char *argument, const char *)
char *argument)
{ {
switch(optid) { switch(opt->id) {
case '?': case '?':
usage(); usage();
exit(0); exit(0);

View File

@ -90,8 +90,8 @@ typedef struct {
static int get_options(int *argc, char ***argv); static int get_options(int *argc, char ***argv);
static int mode_create(int argc, char **argv); static int mode_create(int argc, char **argv);
static int mode_extract(int n_threads, int argc, char **argv); static int mode_extract(int n_threads, int argc, char **argv);
static my_bool get_one_option(int optid, const struct my_option *opt, static my_bool get_one_option(const struct my_option *opt,
char *argument); char *argument, const char *filename);
int int
main(int argc, char **argv) main(int argc, char **argv)
@ -194,10 +194,9 @@ set_run_mode(run_mode_t mode)
static static
my_bool my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt, char *, const char *)
char *argument __attribute__((unused)))
{ {
switch (optid) { switch (opt->id) {
case 'c': case 'c':
if (set_run_mode(RUN_MODE_CREATE)) { if (set_run_mode(RUN_MODE_CREATE)) {
return TRUE; return TRUE;

View File

@ -1628,11 +1628,10 @@ check_if_param_set(const char *param)
} }
my_bool my_bool
xb_get_one_option(int optid, xb_get_one_option(const struct my_option *opt,
const struct my_option *opt __attribute__((unused)), char *argument, const char *)
char *argument)
{ {
switch(optid) { switch(opt->id) {
case 'h': case 'h':
strmake(mysql_real_data_home,argument, FN_REFLEN - 1); strmake(mysql_real_data_home,argument, FN_REFLEN - 1);
mysql_data_home= mysql_real_data_home; mysql_data_home= mysql_real_data_home;

View File

@ -104,10 +104,11 @@ static void usage()
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt __attribute__((unused)),
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename)
{ {
switch (optid) { switch (opt->id) {
case 'c': case 'c':
opt_defaults_file_used= 1; opt_defaults_file_used= 1;
break; break;

View File

@ -44,10 +44,11 @@ static struct my_option my_long_options[] =
}; };
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'V': case 'V':
printf("%s version %s by Jani Tolonen\n", progname, VER); printf("%s version %s by Jani Tolonen\n", progname, VER);
exit(0); exit(0);

View File

@ -96,10 +96,11 @@ static void usage(void)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch (optid) { switch (opt->id) {
case 's': case 's':
verbose=0; verbose=0;
break; break;

View File

@ -102,10 +102,11 @@ static void die(const char* fmt, ...)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'V': case 'V':
print_version(); print_version();
exit(0); exit(0);

View File

@ -71,10 +71,11 @@ static void usage(void)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch (optid) { switch (opt->id) {
case 'V': print_version(); exit(0); case 'V': print_version(); exit(0);
case 'I': case 'I':
case '?': case '?':

View File

@ -89,7 +89,7 @@ struct my_option
void *app_type; /**< To be used by an application */ void *app_type; /**< To be used by an application */
}; };
typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *); typedef my_bool (*my_get_one_option)(const struct my_option *, char *, const char *);
/** /**
Used to retrieve a reference to the object (variable) that holds the value Used to retrieve a reference to the object (variable) that holds the value

View File

@ -442,8 +442,9 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
my_progname, optp->name, optend); my_progname, optp->name, optend);
continue; continue;
} }
if (get_one_option(optp->id, optp, *((my_bool*) value) ? if (get_one_option(optp, *((my_bool*) value) ?
enabled_my_option : disabled_my_option)) enabled_my_option : disabled_my_option,
filename))
DBUG_RETURN(EXIT_ARGUMENT_INVALID); DBUG_RETURN(EXIT_ARGUMENT_INVALID);
continue; continue;
} }
@ -518,7 +519,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
optp->arg_type == NO_ARG) optp->arg_type == NO_ARG)
{ {
*((my_bool*) optp->value)= (my_bool) 1; *((my_bool*) optp->value)= (my_bool) 1;
if (get_one_option(optp->id, optp, argument)) if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR); DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
continue; continue;
} }
@ -538,7 +539,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
{ {
if (optp->var_type == GET_BOOL) if (optp->var_type == GET_BOOL)
*((my_bool*) optp->value)= (my_bool) 1; *((my_bool*) optp->value)= (my_bool) 1;
if (get_one_option(optp->id, optp, argument)) if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR); DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
continue; continue;
} }
@ -559,7 +560,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
if ((error= setval(optp, optp->value, argument, if ((error= setval(optp, optp->value, argument,
set_maximum_value))) set_maximum_value)))
DBUG_RETURN(error); DBUG_RETURN(error);
if (get_one_option(optp->id, optp, argument)) if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR); DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
break; break;
} }
@ -606,7 +607,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
((error= setval(optp, value, argument, set_maximum_value))) && ((error= setval(optp, value, argument, set_maximum_value))) &&
!option_is_loose) !option_is_loose)
DBUG_RETURN(error); DBUG_RETURN(error);
if (get_one_option(optp->id, optp, argument)) if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR); DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
(*argc)--; /* option handled (long), decrease argument count */ (*argc)--; /* option handled (long), decrease argument count */

View File

@ -96,10 +96,10 @@ static struct my_option my_long_options[]=
static my_bool static my_bool
get_one_option(int optid, const struct my_option *, char *) get_one_option(const struct my_option *opt, char *, const char *)
{ {
DBUG_ENTER("get_one_option"); DBUG_ENTER("get_one_option");
switch (optid) { switch (opt->id) {
case '?': case '?':
printf("%s\n", USAGETEXT); printf("%s\n", USAGETEXT);
my_print_help(my_long_options); my_print_help(my_long_options);

View File

@ -78,12 +78,10 @@ static struct my_option my_long_options[]=
static my_bool static my_bool
get_one_option(int optid, get_one_option(const struct my_option *opt, char *, const char *)
const struct my_option *opt __attribute__ ((unused)),
char *argument __attribute__ ((unused)))
{ {
DBUG_ENTER("get_one_option"); DBUG_ENTER("get_one_option");
switch (optid) { switch (opt->id) {
case '?': case '?':
printf("%s\n", USAGETEXT); printf("%s\n", USAGETEXT);
my_print_help(my_long_options); my_print_help(my_long_options);

View File

@ -1472,7 +1472,7 @@ static int mysql_init_variables(void);
static int get_options(int *argc_ptr, char ***argv_ptr); static int get_options(int *argc_ptr, char ***argv_ptr);
static bool add_terminator(DYNAMIC_ARRAY *options); static bool add_terminator(DYNAMIC_ARRAY *options);
static bool add_many_options(DYNAMIC_ARRAY *, my_option *, size_t); static bool add_many_options(DYNAMIC_ARRAY *, my_option *, size_t);
extern "C" my_bool mysqld_get_one_option(int, const struct my_option *, char *); extern "C" my_bool mysqld_get_one_option(const struct my_option *, char *, const char *);
static int init_thread_environment(); static int init_thread_environment();
static char *get_relative_path(const char *path); static char *get_relative_path(const char *path);
static int fix_paths(void); static int fix_paths(void);
@ -7981,7 +7981,8 @@ static int mysql_init_variables(void)
} }
my_bool my_bool
mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) mysqld_get_one_option(const struct my_option *opt, char *argument,
const char *)
{ {
if (opt->app_type) if (opt->app_type)
{ {
@ -7994,7 +7995,7 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
var->value_origin= sys_var::CONFIG; var->value_origin= sys_var::CONFIG;
} }
switch(optid) { switch(opt->id) {
case '#': case '#':
#ifndef DBUG_OFF #ifndef DBUG_OFF
if (!argument) if (!argument)

View File

@ -3984,8 +3984,8 @@ static my_option *construct_help_options(MEM_ROOT *mem_root,
DBUG_RETURN(opts); DBUG_RETURN(opts);
} }
extern "C" my_bool mark_changed(int, const struct my_option *, char *); extern "C" my_bool mark_changed(const struct my_option *, char *, const char *);
my_bool mark_changed(int, const struct my_option *opt, char *) my_bool mark_changed(const struct my_option *opt, char *, const char *)
{ {
if (opt->app_type) if (opt->app_type)
{ {

View File

@ -2641,8 +2641,7 @@ static struct my_option my_long_options[] =
C_MODE_START C_MODE_START
static my_bool get_one_option(int optid, const struct my_option *, static my_bool get_one_option(const struct my_option *, char *, const char *);
char *argument);
C_MODE_END C_MODE_END
static void print_version(void) static void print_version(void)
@ -2664,9 +2663,9 @@ static void print_usage(void)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt, char *argument) get_one_option(const struct my_option *opt, char *argument, const char *)
{ {
switch(optid) { switch(opt->id) {
case '#': case '#':
#ifndef DBUG_OFF #ifndef DBUG_OFF
DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysq_tzinfo_to_sql.trace"); DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysq_tzinfo_to_sql.trace");

View File

@ -643,10 +643,11 @@ static struct my_option my_long_options[] =
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'c': case 'c':
create_flag|= HA_CREATE_CHECKSUM | HA_CREATE_PAGE_CHECKSUM; create_flag|= HA_CREATE_CHECKSUM | HA_CREATE_PAGE_CHECKSUM;
break; break;

View File

@ -814,10 +814,11 @@ static struct my_option my_long_options[] =
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'a': case 'a':
key_type= HA_KEYTYPE_TEXT; key_type= HA_KEYTYPE_TEXT;
break; break;

View File

@ -633,11 +633,10 @@ TYPELIB maria_stats_method_typelib= {
/* Read options */ /* Read options */
static my_bool static my_bool
get_one_option(int optid, get_one_option(const struct my_option *opt,
const struct my_option *opt __attribute__((unused)), char *argument, const char *filename __attribute__((unused)))
char *argument)
{ {
switch (optid) { switch (opt->id) {
#ifdef __NETWARE__ #ifdef __NETWARE__
case OPT_AUTO_CLOSE: case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT); setscreenmode(SCR_AUTOCLOSE_ON_EXIT);

View File

@ -87,11 +87,11 @@ static void usage(void)
static my_bool static my_bool
get_one_option(int optid __attribute__((unused)), get_one_option(const struct my_option *opt,
const struct my_option *opt __attribute__((unused)), char *argument __attribute__((unused)),
char *argument __attribute__((unused))) const char *filename __attribute__((unused)))
{ {
switch (optid) { switch (opt->id) {
case '?': case '?':
usage(); usage();
exit(0); exit(0);

View File

@ -21,7 +21,7 @@
static void usage(); static void usage();
static void complain(int val); static void complain(int val);
static my_bool get_one_option(int, const struct my_option *, char *); static my_bool get_one_option(const struct my_option *, char *, const char*);
static int count=0, stats=0, dump=0, lstats=0; static int count=0, stats=0, dump=0, lstats=0;
static my_bool verbose; static my_bool verbose;
@ -232,10 +232,11 @@ err:
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'd': case 'd':
dump=1; dump=1;
complain(count || query); complain(count || query);

View File

@ -317,12 +317,12 @@ static void usage(void)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument) char *argument, const char *filename __attribute__((unused)))
{ {
uint length; uint length;
switch(optid) { switch(opt->id) {
#ifdef __NETWARE__ #ifdef __NETWARE__
case OPT_AUTO_CLOSE: case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT); setscreenmode(SCR_AUTOCLOSE_ON_EXIT);

View File

@ -302,11 +302,10 @@ static uchar* my_hash_get_string(const uchar *record, size_t *length,
static my_bool static my_bool
get_one_option(int optid __attribute__((unused)), get_one_option(const struct my_option *opt,
const struct my_option *opt __attribute__((unused)), char *argument, const char *filename __attribute__((unused)))
char *argument)
{ {
switch (optid) { switch (opt->id) {
case '?': case '?':
usage(); usage();
exit(0); exit(0);

View File

@ -579,10 +579,11 @@ static void version(void)
} }
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'V': case 'V':
version(); version();
exit(0); exit(0);

View File

@ -189,11 +189,11 @@ static void usage(void)
static my_bool static my_bool
get_one_option(int optid __attribute__((unused)), get_one_option(const struct my_option *opt,
const struct my_option *opt __attribute__((unused)), char *argument __attribute__((unused)),
char *argument __attribute__((unused))) const char *filename __attribute__((unused)))
{ {
switch (optid) { switch (opt->id) {
case '?': case '?':
usage(); usage();
exit(0); exit(0);

View File

@ -590,10 +590,11 @@ static struct my_option my_long_options[] =
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'a': case 'a':
key_type= HA_KEYTYPE_TEXT; key_type= HA_KEYTYPE_TEXT;
break; break;

View File

@ -22,7 +22,7 @@
static void usage(); static void usage();
static void complain(int val); static void complain(int val);
static my_bool get_one_option(int, const struct my_option *, char *); static my_bool get_one_option(const struct my_option *, char *, const char *);
static int count=0, stats=0, dump=0, lstats=0; static int count=0, stats=0, dump=0, lstats=0;
static my_bool verbose; static my_bool verbose;
@ -228,10 +228,11 @@ err:
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument __attribute__((unused))) char *argument __attribute__((unused)),
const char *filename __attribute__((unused)))
{ {
switch(optid) { switch(opt->id) {
case 'd': case 'd':
dump=1; dump=1;
complain(count || query); complain(count || query);

View File

@ -470,11 +470,10 @@ TYPELIB myisam_stats_method_typelib= {
/* Read options */ /* Read options */
static my_bool static my_bool
get_one_option(int optid, get_one_option(const struct my_option *opt,
const struct my_option *opt __attribute__((unused)), char *argument, const char *filename __attribute__((unused)))
char *argument)
{ {
switch (optid) { switch (opt->id) {
case 'a': case 'a':
if (argument == disabled_my_option) if (argument == disabled_my_option)
check_param.testflag&= ~T_STATISTICS; check_param.testflag&= ~T_STATISTICS;

View File

@ -316,12 +316,12 @@ static void usage(void)
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt,
char *argument) char *argument, const char *filename __attribute__((unused)))
{ {
uint length; uint length;
switch(optid) { switch(opt->id) {
case 'f': case 'f':
force_pack= 1; force_pack= 1;
tmpfile_createflag= O_RDWR | O_TRUNC; tmpfile_createflag= O_RDWR | O_TRUNC;

View File

@ -335,10 +335,10 @@ add_query(const char *q)
static my_bool static my_bool
handle_option(int optid, const struct my_option *opt __attribute__((unused)), handle_option(const struct my_option *opt, char *arg,
char *arg) const char *filename __attribute__((unused)))
{ {
switch (optid) switch (opt->id)
{ {
case '?': case '?':
printf("Usage: async_queries [OPTIONS] query ...\n"); printf("Usage: async_queries [OPTIONS] query ...\n");

View File

@ -1273,10 +1273,10 @@ static struct my_tests_st *get_my_tests(); /* To be defined in main .c file */
static struct my_tests_st *my_testlist= 0; static struct my_tests_st *my_testlist= 0;
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(const struct my_option *opt, char *argument,
char *argument) const char *filename __attribute__((unused)))
{ {
switch (optid) { switch (opt->id) {
case '#': case '#':
DBUG_PUSH(argument ? argument : default_dbug_option); DBUG_PUSH(argument ? argument : default_dbug_option);
break; break;

View File

@ -60,9 +60,9 @@ static struct my_option mopts_options[]=
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };
my_bool dummy_get_one_option(int optid __attribute__((unused)), my_bool dummy_get_one_option(const struct my_option *opt __attribute__((unused)),
const struct my_option *opt __attribute__((unused)), char *argument __attribute__((unused)),
char *argument __attribute__((unused))) const char *filename __attribute__((unused)))
{ {
return FALSE; return FALSE;
} }
@ -234,9 +234,9 @@ static struct my_option auto_options[]=
my_bool auto_get_one_option(int optid __attribute__((unused)), my_bool auto_get_one_option(const struct my_option *opt,
const struct my_option *opt, char *argument,
char *argument) const char *filename __attribute__((unused)))
{ {
if (argument == autoset_my_option) if (argument == autoset_my_option)
{ {