diff --git a/client/mysql.cc b/client/mysql.cc index 02198cc6fd9..0a09caa9b2a 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -753,7 +753,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_nopager= 1; case OPT_MYSQL_PROTOCOL: { - if (!(opt_protocol= find_type(argument, &sql_protocol_typelib,0))) + if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", argument); exit(1); diff --git a/client/mysqladmin.c b/client/mysqladmin.c index 3c7a870a309..a3bb0fea180 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.c @@ -249,7 +249,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case OPT_MYSQL_PROTOCOL: { - if (!(opt_protocol= find_type(argument, &sql_protocol_typelib,0))) + if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", argument); exit(1); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index d1411a67b68..5f9a499bd31 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -633,7 +633,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case OPT_MYSQL_PROTOCOL: { - if (!(opt_protocol= find_type(argument, &sql_protocol_typelib,0))) + if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", argument); exit(1); diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 50133ac4059..47512b2a277 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -271,7 +271,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'V': print_version(); exit(0); case OPT_MYSQL_PROTOCOL: { - if (!(opt_protocol= find_type(argument, &sql_protocol_typelib,0))) + if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", argument); exit(1); diff --git a/client/mysqldump.c b/client/mysqldump.c index 6015fd00ffd..8fcf1bb1781 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -582,7 +582,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } case (int) OPT_MYSQL_PROTOCOL: { - if (!(opt_protocol= find_type(argument, &sql_protocol_typelib,0))) + if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", argument); exit(1); diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 3db13519a46..86f373d75fe 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -203,7 +203,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), #endif case OPT_MYSQL_PROTOCOL: { - if (!(opt_protocol= find_type(argument, &sql_protocol_typelib,0))) + if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", argument); exit(1); diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 285b229550f..05108bd03c8 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -268,7 +268,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case OPT_MYSQL_PROTOCOL: { - if (!(opt_protocol= find_type(argument, &sql_protocol_typelib,0))) + if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", argument); exit(1); diff --git a/sql-common/client.c b/sql-common/client.c index 68878df50e8..43377bb09b1 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1057,9 +1057,8 @@ void mysql_read_default_options(struct st_mysql_options *options, options->max_allowed_packet= atoi(opt_arg); break; case 28: /* protocol */ - if ((options->protocol = find_type(opt_arg, - &sql_protocol_typelib,0)) - == ~(ulong) 0) + if ((options->protocol= find_type(opt_arg, + &sql_protocol_typelib,0)) <= 0) { fprintf(stderr, "Unknown option to protocol: %s\n", opt_arg); exit(1);