summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-09-29 16:30:57 +0200
committerSergei Golubchik <serg@mariadb.org>2019-10-14 10:29:30 +0200
commitf217612fade6684c6003aea9a9bfc7ab41685ace (patch)
tree65ebc4daa0720dd13034840f716437671160f54d
parent927521a2c18954f03869e91281b90af79b719166 (diff)
downloadmariadb-git-f217612fade6684c6003aea9a9bfc7ab41685ace.tar.gz
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.
-rw-r--r--client/mysql.cc5
-rw-r--r--client/mysql_plugin.c7
-rw-r--r--client/mysql_upgrade.c8
-rw-r--r--client/mysqladmin.cc5
-rw-r--r--client/mysqlbinlog.cc5
-rw-r--r--client/mysqlcheck.c6
-rw-r--r--client/mysqldump.c6
-rw-r--r--client/mysqlimport.c6
-rw-r--r--client/mysqlshow.c6
-rw-r--r--client/mysqlslap.c6
-rw-r--r--client/mysqltest.cc7
-rw-r--r--extra/comp_err.c9
-rw-r--r--extra/innochecksum.cc8
-rw-r--r--extra/mariabackup/innobackupex.cc7
-rw-r--r--extra/mariabackup/xbstream.cc9
-rw-r--r--extra/mariabackup/xtrabackup.cc7
-rw-r--r--extra/my_print_defaults.c7
-rw-r--r--extra/mysql_waitpid.c7
-rw-r--r--extra/perror.c7
-rw-r--r--extra/resolve_stack_dump.c7
-rw-r--r--extra/resolveip.c7
-rw-r--r--include/my_getopt.h2
-rw-r--r--mysys/my_getopt.c13
-rw-r--r--sql/mysql_install_db.cc4
-rw-r--r--sql/mysql_upgrade_service.cc6
-rw-r--r--sql/mysqld.cc7
-rw-r--r--sql/sql_plugin.cc4
-rw-r--r--sql/tztime.cc7
-rw-r--r--storage/maria/ma_rt_test.c7
-rw-r--r--storage/maria/ma_test1.c7
-rw-r--r--storage/maria/maria_chk.c7
-rw-r--r--storage/maria/maria_dump_log.c8
-rw-r--r--storage/maria/maria_ftdump.c9
-rw-r--r--storage/maria/maria_pack.c6
-rw-r--r--storage/maria/maria_read_log.c7
-rw-r--r--storage/maria/unittest/ma_control_file-t.c7
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multigroup-t.c8
-rw-r--r--storage/myisam/mi_test1.c7
-rw-r--r--storage/myisam/myisam_ftdump.c9
-rw-r--r--storage/myisam/myisamchk.c7
-rw-r--r--storage/myisam/myisampack.c6
-rw-r--r--tests/async_queries.c6
-rw-r--r--tests/mysql_client_fw.c6
-rw-r--r--unittest/mysys/my_getopt-t.c12
44 files changed, 151 insertions, 153 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 6402d651038..7df2d5ee42d 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1728,10 +1728,9 @@ static void usage(int version)
my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt, char *argument, const char *)
{
- switch(optid) {
+ switch(opt->id) {
case OPT_CHARSETS_DIR:
strmake_buf(mysql_charsets_dir, argument);
charsets_dir = mysql_charsets_dir;
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c
index 8e5897b4b86..998524ac1f1 100644
--- a/client/mysql_plugin.c
+++ b/client/mysql_plugin.c
@@ -474,11 +474,10 @@ static void print_default_values(void)
*/
static my_bool
-get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt,
+ char *argument, const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'n':
opt_no_defaults++;
break;
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 39fe715bdff..8fb5ae4a577 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -268,12 +268,12 @@ static void add_one_option_cnf_file(DYNAMIC_STRING *ds,
}
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 *filename __attribute__((unused)))
{
my_bool add_option= TRUE;
- switch (optid) {
+ switch (opt->id) {
case '?':
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 'd': /* --datadir */
fprintf(stderr, "%s: the '--%s' option is always ignored\n",
- my_progname, optid == 'b' ? "basedir" : "datadir");
+ my_progname, opt->id == 'b' ? "basedir" : "datadir");
/* FALLTHROUGH */
case 'k': /* --version-check */
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 32096fef996..bc1403b283a 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -241,10 +241,9 @@ static const char *load_default_groups[]=
0 };
my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt, char *argument, const char *)
{
- switch(optid) {
+ switch(opt->id) {
case 'c':
opt_count_iterations= 1;
break;
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 2d861ce077f..47a7f9e01b2 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1932,11 +1932,10 @@ static my_time_t convert_str_to_timestamp(const char* str)
extern "C" my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt, char *argument, const char *)
{
bool tty_password=0;
- switch (optid) {
+ switch (opt->id) {
#ifndef DBUG_OFF
case '#':
if (!argument)
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index c1859440446..e949c8059bf 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -284,13 +284,13 @@ static void usage(void)
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt,
+ char *argument, const char *filename __attribute__((unused)))
{
int orig_what_to_do= what_to_do;
DBUG_ENTER("get_one_option");
- switch(optid) {
+ switch(opt->id) {
case 'a':
what_to_do = DO_ANALYZE;
break;
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 16acc88b221..ca141b091d2 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -815,10 +815,10 @@ uchar* get_table_key(const char *entry, size_t *length,
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt,
+ char *argument, const char *filename __attribute__((unused)))
{
- switch (optid) {
+ switch (opt->id) {
case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; /* Don't require password */
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 67dc11d7117..76923e036b5 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -221,10 +221,10 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt, char *argument,
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; /* Don't require password */
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index db5c2bbbbe6..d71a8aa5132 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -289,10 +289,10 @@ are shown.");
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt, char *argument,
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'v':
opt_verbose++;
break;
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 473bb12dc11..996f9bb79c6 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -726,11 +726,11 @@ static void usage(void)
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt, char *argument,
+ const char *filename __attribute__((unused)))
{
DBUG_ENTER("get_one_option");
- switch(optid) {
+ switch(opt->id) {
case 'v':
verbose++;
break;
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index bb3effafc84..59cf7065a69 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -96,8 +96,7 @@ static int setenv(const char *name, const char *value, int overwrite);
C_MODE_START
static sig_handler signal_handler(int sig);
-static my_bool get_one_option(int optid, const struct my_option *,
- char *argument);
+static my_bool get_one_option(const struct my_option *, char *, const char *);
C_MODE_END
enum {
@@ -7193,9 +7192,9 @@ void read_embedded_server_arguments(const char *name)
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 '#':
#ifndef DBUG_OFF
DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysqltest.trace");
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 704bbc0eaf6..a504832a60f 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -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 void print_version(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 int copy_rows(FILE * to, char *row, int row_nr, long start_pos);
static char *parse_default_language(char *str);
@@ -1134,11 +1132,12 @@ static void print_version(void)
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__ ((unused)),
- char *argument __attribute__ ((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__ ((unused)),
+ const char *filename __attribute__ ((unused)))
{
DBUG_ENTER("get_one_option");
- switch (optid) {
+ switch (opt->id) {
case 'V':
print_version();
my_end(0);
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index aa591de944e..f971fac20ec 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -1332,11 +1332,11 @@ static void usage(void)
extern "C" my_bool
innochecksum_get_one_option(
- int optid,
- const struct my_option *opt MY_ATTRIBUTE((unused)),
- char *argument MY_ATTRIBUTE((unused)))
+ const struct my_option *opt,
+ char *argument MY_ATTRIBUTE((unused)),
+ const char *)
{
- switch (optid) {
+ switch (opt->id) {
#ifndef DBUG_OFF
case '#':
dbug_setting = argument
diff --git a/extra/mariabackup/innobackupex.cc b/extra/mariabackup/innobackupex.cc
index 952d1f4ec63..fc5e1eef70b 100644
--- a/extra/mariabackup/innobackupex.cc
+++ b/extra/mariabackup/innobackupex.cc
@@ -728,11 +728,10 @@ indicates an error.\n");
static
my_bool
-ibx_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument)
+ibx_get_one_option(const struct my_option *opt,
+ char *argument, const char *)
{
- switch(optid) {
+ switch(opt->id) {
case '?':
usage();
exit(0);
diff --git a/extra/mariabackup/xbstream.cc b/extra/mariabackup/xbstream.cc
index 1655b69235c..d22437427fa 100644
--- a/extra/mariabackup/xbstream.cc
+++ b/extra/mariabackup/xbstream.cc
@@ -90,8 +90,8 @@ typedef struct {
static int get_options(int *argc, char ***argv);
static int mode_create(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,
- char *argument);
+static my_bool get_one_option(const struct my_option *opt,
+ char *argument, const char *filename);
int
main(int argc, char **argv)
@@ -194,10 +194,9 @@ set_run_mode(run_mode_t mode)
static
my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt, char *, const char *)
{
- switch (optid) {
+ switch (opt->id) {
case 'c':
if (set_run_mode(RUN_MODE_CREATE)) {
return TRUE;
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index d4badc15520..7924791f0e9 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -1628,11 +1628,10 @@ check_if_param_set(const char *param)
}
my_bool
-xb_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument)
+xb_get_one_option(const struct my_option *opt,
+ char *argument, const char *)
{
- switch(optid) {
+ switch(opt->id) {
case 'h':
strmake(mysql_real_data_home,argument, FN_REFLEN - 1);
mysql_data_home= mysql_real_data_home;
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index 20daa530dbb..85827b74466 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -104,10 +104,11 @@ static void usage()
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt __attribute__((unused)),
+ char *argument __attribute__((unused)),
+ const char *filename)
{
- switch (optid) {
+ switch (opt->id) {
case 'c':
opt_defaults_file_used= 1;
break;
diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c
index e19f92261db..92716489bea 100644
--- a/extra/mysql_waitpid.c
+++ b/extra/mysql_waitpid.c
@@ -44,10 +44,11 @@ static struct my_option my_long_options[] =
};
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'V':
printf("%s version %s by Jani Tolonen\n", progname, VER);
exit(0);
diff --git a/extra/perror.c b/extra/perror.c
index e3db7b951b7..15c12f10353 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -96,10 +96,11 @@ static void usage(void)
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch (optid) {
+ switch (opt->id) {
case 's':
verbose=0;
break;
diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c
index e46d0addcc1..1aae413d2a9 100644
--- a/extra/resolve_stack_dump.c
+++ b/extra/resolve_stack_dump.c
@@ -102,10 +102,11 @@ static void die(const char* fmt, ...)
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'V':
print_version();
exit(0);
diff --git a/extra/resolveip.c b/extra/resolveip.c
index 59a32f5f084..6812bc47e8e 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -71,10 +71,11 @@ static void usage(void)
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch (optid) {
+ switch (opt->id) {
case 'V': print_version(); exit(0);
case 'I':
case '?':
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 1868c44b60e..a299c315785 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -89,7 +89,7 @@ struct my_option
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
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index ab85e231c0f..57c8efd797d 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -442,8 +442,9 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
my_progname, optp->name, optend);
continue;
}
- if (get_one_option(optp->id, optp, *((my_bool*) value) ?
- enabled_my_option : disabled_my_option))
+ if (get_one_option(optp, *((my_bool*) value) ?
+ enabled_my_option : disabled_my_option,
+ filename))
DBUG_RETURN(EXIT_ARGUMENT_INVALID);
continue;
}
@@ -518,7 +519,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
optp->arg_type == NO_ARG)
{
*((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);
continue;
}
@@ -538,7 +539,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
{
if (optp->var_type == GET_BOOL)
*((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);
continue;
}
@@ -559,7 +560,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
if ((error= setval(optp, optp->value, argument,
set_maximum_value)))
DBUG_RETURN(error);
- if (get_one_option(optp->id, optp, argument))
+ if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
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))) &&
!option_is_loose)
DBUG_RETURN(error);
- if (get_one_option(optp->id, optp, argument))
+ if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
(*argc)--; /* option handled (long), decrease argument count */
diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc
index 8a83f22751a..915db629f44 100644
--- a/sql/mysql_install_db.cc
+++ b/sql/mysql_install_db.cc
@@ -96,10 +96,10 @@ static struct my_option my_long_options[]=
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");
- switch (optid) {
+ switch (opt->id) {
case '?':
printf("%s\n", USAGETEXT);
my_print_help(my_long_options);
diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc
index a9df9eaf13b..b612f31a289 100644
--- a/sql/mysql_upgrade_service.cc
+++ b/sql/mysql_upgrade_service.cc
@@ -78,12 +78,10 @@ static struct my_option my_long_options[]=
static my_bool
-get_one_option(int optid,
- const struct my_option *opt __attribute__ ((unused)),
- char *argument __attribute__ ((unused)))
+get_one_option(const struct my_option *opt, char *, const char *)
{
DBUG_ENTER("get_one_option");
- switch (optid) {
+ switch (opt->id) {
case '?':
printf("%s\n", USAGETEXT);
my_print_help(my_long_options);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 4fc24c3a7d5..fba19622995 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1472,7 +1472,7 @@ static int mysql_init_variables(void);
static int get_options(int *argc_ptr, char ***argv_ptr);
static bool add_terminator(DYNAMIC_ARRAY *options);
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 char *get_relative_path(const char *path);
static int fix_paths(void);
@@ -7981,7 +7981,8 @@ static int mysql_init_variables(void)
}
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)
{
@@ -7994,7 +7995,7 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
var->value_origin= sys_var::CONFIG;
}
- switch(optid) {
+ switch(opt->id) {
case '#':
#ifndef DBUG_OFF
if (!argument)
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 7e56e0c3a67..9807a1235f5 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -3984,8 +3984,8 @@ static my_option *construct_help_options(MEM_ROOT *mem_root,
DBUG_RETURN(opts);
}
-extern "C" my_bool mark_changed(int, const struct my_option *, char *);
-my_bool mark_changed(int, const struct my_option *opt, char *)
+extern "C" my_bool mark_changed(const struct my_option *, char *, const char *);
+my_bool mark_changed(const struct my_option *opt, char *, const char *)
{
if (opt->app_type)
{
diff --git a/sql/tztime.cc b/sql/tztime.cc
index c45a6598d69..afbe7639dda 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -2641,8 +2641,7 @@ static struct my_option my_long_options[] =
C_MODE_START
-static my_bool get_one_option(int optid, const struct my_option *,
- char *argument);
+static my_bool get_one_option(const struct my_option *, char *, const char *);
C_MODE_END
static void print_version(void)
@@ -2664,9 +2663,9 @@ static void print_usage(void)
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 '#':
#ifndef DBUG_OFF
DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysq_tzinfo_to_sql.trace");
diff --git a/storage/maria/ma_rt_test.c b/storage/maria/ma_rt_test.c
index ea82de9c488..0ba0bda2343 100644
--- a/storage/maria/ma_rt_test.c
+++ b/storage/maria/ma_rt_test.c
@@ -643,10 +643,11 @@ static struct my_option my_long_options[] =
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'c':
create_flag|= HA_CREATE_CHECKSUM | HA_CREATE_PAGE_CHECKSUM;
break;
diff --git a/storage/maria/ma_test1.c b/storage/maria/ma_test1.c
index 091ac7e9278..8a4d1e15917 100644
--- a/storage/maria/ma_test1.c
+++ b/storage/maria/ma_test1.c
@@ -814,10 +814,11 @@ static struct my_option my_long_options[] =
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'a':
key_type= HA_KEYTYPE_TEXT;
break;
diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c
index f5b9029d6ff..bd62859f66b 100644
--- a/storage/maria/maria_chk.c
+++ b/storage/maria/maria_chk.c
@@ -633,11 +633,10 @@ TYPELIB maria_stats_method_typelib= {
/* Read options */
static my_bool
-get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt,
+ char *argument, const char *filename __attribute__((unused)))
{
- switch (optid) {
+ switch (opt->id) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
diff --git a/storage/maria/maria_dump_log.c b/storage/maria/maria_dump_log.c
index 998d2e74014..2e69c56a470 100644
--- a/storage/maria/maria_dump_log.c
+++ b/storage/maria/maria_dump_log.c
@@ -87,11 +87,11 @@ static void usage(void)
static my_bool
-get_one_option(int optid __attribute__((unused)),
- const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch (optid) {
+ switch (opt->id) {
case '?':
usage();
exit(0);
diff --git a/storage/maria/maria_ftdump.c b/storage/maria/maria_ftdump.c
index 01dcbd90837..d0c98086ad2 100644
--- a/storage/maria/maria_ftdump.c
+++ b/storage/maria/maria_ftdump.c
@@ -21,7 +21,7 @@
static void usage();
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 my_bool verbose;
@@ -232,10 +232,11 @@ err:
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'd':
dump=1;
complain(count || query);
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c
index fd67dd8bb39..762d2890294 100644
--- a/storage/maria/maria_pack.c
+++ b/storage/maria/maria_pack.c
@@ -317,12 +317,12 @@ static void usage(void)
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt,
+ char *argument, const char *filename __attribute__((unused)))
{
uint length;
- switch(optid) {
+ switch(opt->id) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
diff --git a/storage/maria/maria_read_log.c b/storage/maria/maria_read_log.c
index 59d5c8abce8..f0dc331cf10 100644
--- a/storage/maria/maria_read_log.c
+++ b/storage/maria/maria_read_log.c
@@ -302,11 +302,10 @@ static uchar* my_hash_get_string(const uchar *record, size_t *length,
static my_bool
-get_one_option(int optid __attribute__((unused)),
- const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt,
+ char *argument, const char *filename __attribute__((unused)))
{
- switch (optid) {
+ switch (opt->id) {
case '?':
usage();
exit(0);
diff --git a/storage/maria/unittest/ma_control_file-t.c b/storage/maria/unittest/ma_control_file-t.c
index 7f2bd6768a6..a382aaf3fcc 100644
--- a/storage/maria/unittest/ma_control_file-t.c
+++ b/storage/maria/unittest/ma_control_file-t.c
@@ -579,10 +579,11 @@ static void version(void)
}
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'V':
version();
exit(0);
diff --git a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
index 6ba0d00f884..f08fb744813 100644
--- a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
@@ -189,11 +189,11 @@ static void usage(void)
static my_bool
-get_one_option(int optid __attribute__((unused)),
- const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch (optid) {
+ switch (opt->id) {
case '?':
usage();
exit(0);
diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c
index 6e1cbb716ba..daeaf957b4d 100644
--- a/storage/myisam/mi_test1.c
+++ b/storage/myisam/mi_test1.c
@@ -590,10 +590,11 @@ static struct my_option my_long_options[] =
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'a':
key_type= HA_KEYTYPE_TEXT;
break;
diff --git a/storage/myisam/myisam_ftdump.c b/storage/myisam/myisam_ftdump.c
index 7ced701ed5b..63f40daad5c 100644
--- a/storage/myisam/myisam_ftdump.c
+++ b/storage/myisam/myisam_ftdump.c
@@ -22,7 +22,7 @@
static void usage();
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 my_bool verbose;
@@ -228,10 +228,11 @@ err:
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(const struct my_option *opt,
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
- switch(optid) {
+ switch(opt->id) {
case 'd':
dump=1;
complain(count || query);
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index f616a9f9b1a..69c30dedb89 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -470,11 +470,10 @@ TYPELIB myisam_stats_method_typelib= {
/* Read options */
static my_bool
-get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt,
+ char *argument, const char *filename __attribute__((unused)))
{
- switch (optid) {
+ switch (opt->id) {
case 'a':
if (argument == disabled_my_option)
check_param.testflag&= ~T_STATISTICS;
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index ba6744ae815..b2a2909ad73 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -316,12 +316,12 @@ static void usage(void)
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt,
+ char *argument, const char *filename __attribute__((unused)))
{
uint length;
- switch(optid) {
+ switch(opt->id) {
case 'f':
force_pack= 1;
tmpfile_createflag= O_RDWR | O_TRUNC;
diff --git a/tests/async_queries.c b/tests/async_queries.c
index a8889fc8d5a..60b58685daa 100644
--- a/tests/async_queries.c
+++ b/tests/async_queries.c
@@ -335,10 +335,10 @@ add_query(const char *q)
static my_bool
-handle_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *arg)
+handle_option(const struct my_option *opt, char *arg,
+ const char *filename __attribute__((unused)))
{
- switch (optid)
+ switch (opt->id)
{
case '?':
printf("Usage: async_queries [OPTIONS] query ...\n");
diff --git a/tests/mysql_client_fw.c b/tests/mysql_client_fw.c
index 8a6d38d9e30..cfcb6690f4a 100644
--- a/tests/mysql_client_fw.c
+++ b/tests/mysql_client_fw.c
@@ -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 my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
+get_one_option(const struct my_option *opt, char *argument,
+ const char *filename __attribute__((unused)))
{
- switch (optid) {
+ switch (opt->id) {
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
diff --git a/unittest/mysys/my_getopt-t.c b/unittest/mysys/my_getopt-t.c
index 181b5a6ec12..fb0922b88f8 100644
--- a/unittest/mysys/my_getopt-t.c
+++ b/unittest/mysys/my_getopt-t.c
@@ -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}
};
-my_bool dummy_get_one_option(int optid __attribute__((unused)),
- const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+my_bool dummy_get_one_option(const struct my_option *opt __attribute__((unused)),
+ char *argument __attribute__((unused)),
+ const char *filename __attribute__((unused)))
{
return FALSE;
}
@@ -234,9 +234,9 @@ static struct my_option auto_options[]=
-my_bool auto_get_one_option(int optid __attribute__((unused)),
- const struct my_option *opt,
- char *argument)
+my_bool auto_get_one_option(const struct my_option *opt,
+ char *argument,
+ const char *filename __attribute__((unused)))
{
if (argument == autoset_my_option)
{