diff options
author | unknown <jani@hynda.(none)> | 2002-05-29 15:07:30 +0300 |
---|---|---|
committer | unknown <jani@hynda.(none)> | 2002-05-29 15:07:30 +0300 |
commit | a90b2f309eed146670390b7d4a31a20192685ac7 (patch) | |
tree | f5eba07b104573f7bffdb03106d52dd2c350b85a /client | |
parent | bb4cf4c24ee92de34ec2314eb84e0a9a4169172d (diff) | |
download | mariadb-git-a90b2f309eed146670390b7d4a31a20192685ac7.tar.gz |
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
Changed some exit code names and corresponding numbers.
Fixed a bug in mysqld.cc, in replication related options.
Added a global flag in my_getopt, which can be set by any program
that is using my_getopt, which tells whether the client should
print the error message itself, or whether my_getopt should do it.
The default is that my_getopt will print the error messages.
client/mysql.cc:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/mysqladmin.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/mysqlbinlog.cc:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/mysqlcheck.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/mysqldump.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/mysqlimport.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/mysqlmanager-pwgen.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/mysqlmanagerc.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/mysqlshow.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/mysqltest.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
client/thread_test.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
extra/my_print_defaults.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
extra/mysql_install.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
extra/perror.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
extra/resolve_stack_dump.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
extra/resolveip.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
include/my_getopt.h:
Added global (flag) variable which tells my_getopt whether to
print errors or just silently exit with proper error code.
include/mysys_err.h:
Changed exit code names and corresponding numbers.
isam/isamchk.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
isam/pack_isam.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
myisam/ft_dump.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
myisam/ft_eval.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
myisam/ft_test1.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
myisam/mi_test1.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
myisam/myisamchk.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
myisam/myisampack.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
mysys/my_getopt.c:
Changed exit code names and corresponding numbers. Added a flag
for checking whether my_getopt should print the error message,
or whether it should be printed by the client itself.
sql/gen_lex_hash.cc:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
sql/mysqld.cc:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
Fixed a bug when compiling in non-debug mode, some replication
related options were not enabled while they should be. This made
'make test' to fail in rpl000010 when --with-debug was not used.
tools/mysqlmanager.c:
Added useful exit error code for programs using my_getopt in case
of an error in option handling. This can sometimes be useful in
scripts.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 8 | ||||
-rw-r--r-- | client/mysqladmin.c | 9 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 9 | ||||
-rw-r--r-- | client/mysqlcheck.c | 8 | ||||
-rw-r--r-- | client/mysqldump.c | 8 | ||||
-rw-r--r-- | client/mysqlimport.c | 9 | ||||
-rw-r--r-- | client/mysqlmanager-pwgen.c | 9 | ||||
-rw-r--r-- | client/mysqlmanagerc.c | 10 | ||||
-rw-r--r-- | client/mysqlshow.c | 8 | ||||
-rw-r--r-- | client/mysqltest.c | 8 | ||||
-rw-r--r-- | client/thread_test.c | 6 |
11 files changed, 27 insertions, 65 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 10c3709c166..fc085838f36 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -40,7 +40,7 @@ #include <signal.h> #include <violite.h> -const char *VER= "12.7"; +const char *VER= "12.8"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 @@ -739,11 +739,7 @@ static int get_options(int argc, char **argv) strmov(default_pager, pager); if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); if (status.batch) /* disable pager and outfile in this case */ { diff --git a/client/mysqladmin.c b/client/mysqladmin.c index 6fa8e8220f4..54103c010b3 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.c @@ -23,7 +23,7 @@ #include <my_pthread.h> /* because of signal() */ #endif -#define ADMIN_VERSION "8.34" +#define ADMIN_VERSION "8.35" #define MAX_MYSQL_VAR 64 #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define MAX_TRUNC_LENGTH 3 @@ -247,11 +247,8 @@ int main(int argc,char *argv[]) free_defaults() */ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); + if (argc == 0) { usage(); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index e420e3b6ad8..3020e105954 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -124,7 +124,7 @@ static void die(const char* fmt, ...) static void print_version() { - printf("%s Ver 2.2 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); + printf("%s Ver 2.3 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); } @@ -223,11 +223,8 @@ static int parse_args(int *argc, char*** argv) result_file = stdout; if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); + return 0; } diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index f0d7e998aa9..78cd277f9be 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -16,7 +16,7 @@ /* By Jani Tolonen, 2001-04-20, MySQL Development Team */ -#define CHECK_VERSION "2.3" +#define CHECK_VERSION "2.4" #include "client_priv.h" #include <m_ctype.h> @@ -265,11 +265,7 @@ static int get_options(int *argc, char ***argv) load_defaults("my", load_default_groups, argc, argv); if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); if (!what_to_do) { diff --git a/client/mysqldump.c b/client/mysqldump.c index e2b9ab3f6b5..8f23e3d4a14 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -35,7 +35,7 @@ ** and adapted to mysqldump 05/11/01 by Jani Tolonen */ -#define DUMP_VERSION "9.05" +#define DUMP_VERSION "9.06" #include <my_global.h> #include <my_sys.h> @@ -360,11 +360,7 @@ static int get_options(int *argc, char ***argv) load_defaults("my",load_default_groups,argc,argv); if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); if (opt_delayed) opt_lock=0; /* Can't have lock with delayed */ diff --git a/client/mysqlimport.c b/client/mysqlimport.c index bc7860a052d..1933ea41bcf 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -25,7 +25,7 @@ ** * * ** ************************* */ -#define IMPORT_VERSION "3.3" +#define IMPORT_VERSION "3.4" #include "client_priv.h" #include "mysql_version.h" @@ -204,11 +204,8 @@ static int get_options(int *argc, char ***argv) int ho_error; if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); + if (enclosed && opt_enclosed) { fprintf(stderr, "You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.\n"); diff --git a/client/mysqlmanager-pwgen.c b/client/mysqlmanager-pwgen.c index cd308a53d46..40126e279b5 100644 --- a/client/mysqlmanager-pwgen.c +++ b/client/mysqlmanager-pwgen.c @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define MANAGER_PWGEN_VERSION "1.3" +#define MANAGER_PWGEN_VERSION "1.4" #include <my_global.h> #include <m_ctype.h> @@ -96,11 +96,8 @@ int parse_args(int argc, char** argv) int ho_error; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); + return 0; } diff --git a/client/mysqlmanagerc.c b/client/mysqlmanagerc.c index 82b70ed1b44..f200b993147 100644 --- a/client/mysqlmanagerc.c +++ b/client/mysqlmanagerc.c @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define MANAGER_CLIENT_VERSION "1.3" +#define MANAGER_CLIENT_VERSION "1.4" #include <my_global.h> #include <mysql.h> @@ -132,12 +132,10 @@ int parse_args(int argc, char **argv) load_defaults("my",load_default_groups,&argc,&argv); default_argv= argv; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); + return 0; } int main(int argc, char** argv) diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 74a41e69b1f..81b4d2ab4f7 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -16,7 +16,7 @@ /* Show databases, tables or columns */ -#define SHOW_VERSION "9.3" +#define SHOW_VERSION "9.4" #include <my_global.h> #include "client_priv.h" @@ -241,11 +241,7 @@ get_options(int *argc,char ***argv) int ho_error; if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); if (tty_password) opt_password=get_tty_password(NullS); diff --git a/client/mysqltest.c b/client/mysqltest.c index 27763736f96..9244ca01d64 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -42,7 +42,7 @@ **********************************************************************/ -#define MTEST_VERSION "1.22" +#define MTEST_VERSION "1.23" #include <my_global.h> #include <mysql_embed.h> @@ -1957,11 +1957,7 @@ int parse_args(int argc, char **argv) default_argv= argv; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); if (argc > 1) { diff --git a/client/thread_test.c b/client/thread_test.c index 10183ca5150..2900ab712e2 100644 --- a/client/thread_test.c +++ b/client/thread_test.c @@ -173,11 +173,7 @@ static void get_options(int argc, char **argv) load_defaults("my",load_default_groups,&argc,&argv); if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) - { - printf("%s: handle_options() failed with error %d\n", my_progname, - ho_error); - exit(1); - } + exit(ho_error); free_defaults(argv); if (tty_password) |