=== modified file 'client/mysqltest.cc' --- client/mysqltest.cc 2010-03-12 06:06:23 +0000 +++ client/mysqltest.cc 2010-03-23 10:07:06 +0000 @@ -189,6 +189,8 @@ static int match_re(my_regex_t *, char *); static void free_re(void); +static uint opt_protocol=0; + DYNAMIC_ARRAY q_lines; #include "sslopt-vars.h" @@ -5108,11 +5110,13 @@ #ifdef __WIN__ if (con_pipe) { - uint protocol= MYSQL_PROTOCOL_PIPE; - mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol); + opt_protocol= MYSQL_PROTOCOL_PIPE; } #endif + if (opt_protocol) + mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); + #ifdef HAVE_SMEM if (con_shm) { @@ -5826,6 +5830,8 @@ GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection or 0 for default to, in " "order of preference, my.cnf, $MYSQL_TCP_PORT, " #if MYSQL_PORT_DEFAULT == 0 @@ -5967,7 +5973,7 @@ static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), +get_one_option(int optid, const struct my_option *opt, char *argument) { switch(optid) { @@ -6059,6 +6065,10 @@ case 'V': print_version(); exit(0); + case OPT_MYSQL_PROTOCOL: + opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, + opt->name); + break; case '?': usage(); exit(0); @@ -7797,6 +7807,9 @@ mysql_options(&con->mysql, MYSQL_SET_CHARSET_DIR, opt_charsets_dir); + if (opt_protocol) + mysql_options(&con->mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); + #ifdef HAVE_OPENSSL if (opt_use_ssl)