From 3615debeb1377b1ddf51b546ed7342186c18db59 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Mar 2007 11:19:51 +0200 Subject: Added find_type_or_exit and find_bit_type_or_exit as wrappers around the original functions. These will ensure that error message is always in unique form, reduce code and print the right alternatives automatically in an error case. client/mysql.cc: Changed find_type to find_type_or_exit client/mysqladmin.cc: Changed find_type to find_type_or_exit client/mysqlbinlog.cc: Changed find_type to find_type_or_exit client/mysqlcheck.c: Changed find_type to find_type_or_exit client/mysqldump.c: Changed find_type to find_type_or_exit client/mysqlimport.c: Changed find_type to find_type_or_exit client/mysqlshow.c: Changed find_type to find_type_or_exit client/mysqlslap.c: Changed find_type to find_type_or_exit include/typelib.h: Added find_type_or_exit mysql-test/r/mysql_protocols.result: Fixed result. mysys/typelib.c: Added find_type_or_exit sql/mysqld.cc: Added use of find_type_or_exit and find_bit_type_or_exit Fixed a missing break; from an option handling. (Bug in --tc-heuristic-recover) --- client/mysqlimport.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'client/mysqlimport.c') diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 3e054fba308..c037da9c0b9 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -231,14 +231,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; #endif case OPT_MYSQL_PROTOCOL: - { - if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) - { - fprintf(stderr, "Unknown option to protocol: %s\n", argument); - exit(1); - } + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); break; - } case '#': DBUG_PUSH(argument ? argument : "d:t:o"); break; -- cgit v1.2.1