summaryrefslogtreecommitdiff
path: root/client
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 /client
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.
Diffstat (limited to 'client')
-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
11 files changed, 31 insertions, 36 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");