diff options
author | unknown <wax@mysql.com> | 2002-11-15 00:16:30 +0500 |
---|---|---|
committer | unknown <wax@mysql.com> | 2002-11-15 00:16:30 +0500 |
commit | 64dd949c419898111c673eed4efadf32acd3e435 (patch) | |
tree | f80131afae1725b283113608c4f38e9e43ace61b /client/mysqlshow.c | |
parent | ccf7226c2759bf6549c2cdd615ef55e95318520b (diff) | |
download | mariadb-git-64dd949c419898111c673eed4efadf32acd3e435.tar.gz |
Add shared memory protocol and option --protocol
client/client_priv.h:
Add OPT_MYSQL_PROTOCOL and OPT_SHARED_MEMORY_BASE_NAME
include/config-win.h:
Add shared memory protocol
include/errmsg.h:
Add error codes of shared memory protocol
include/my_sys.h:
Delete TYPELIB, moved to typelib.h
include/mysql.h:
Add shared memory protocol
include/violite.h:
Add shared memory protocol
libmysql/errmsg.c:
Add texts of errors of shared memory protocol
sql/mysqld.cc:
Add shared memory protocol and option --shared-memory, correct option --named-pipe
sql/set_var.cc:
Add shared memory protocol variables
vio/vio.c:
Add shared memory protocol
vio/viosocket.c:
Add shared memory protocol
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'client/mysqlshow.c')
-rw-r--r-- | client/mysqlshow.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 5475fc7b531..dc1d37b98f6 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -31,6 +31,11 @@ static my_string host=0,opt_password=0,user=0; static my_bool opt_show_keys=0,opt_compress=0,opt_status=0, tty_password=0; static uint opt_verbose=0; +#ifdef HAVE_SMEM +static char *shared_memory_base_name=0; +#endif +static uint opt_protocol=0; + static void get_options(int *argc,char ***argv); static uint opt_mysql_port=0; static int list_dbs(MYSQL *mysql,const char *wild); @@ -87,6 +92,12 @@ int main(int argc, char **argv) mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, opt_ssl_capath, opt_ssl_cipher); #endif + if (opt_protocol) + mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); +#ifdef HAVE_SMEM + if (shared_memory_base_name) + mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); +#endif if (!(mysql_real_connect(&mysql,host,user,opt_password, argv[0],opt_mysql_port,opt_mysql_unix_port, 0))) @@ -114,6 +125,9 @@ int main(int argc, char **argv) mysql_close(&mysql); /* Close & free connection */ if (opt_password) my_free(opt_password,MYF(0)); +#ifdef HAVE_SMEM + my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); +#endif my_end(0); exit(error ? 1 : 0); return 0; /* No compiler warnings */ @@ -148,6 +162,13 @@ static struct my_option my_long_options[] = {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #endif + {"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}, +#ifdef HAVE_SMEM + {"shared_memory_base_name", OPT_SHARED_MEMORY_BASE_NAME, + "Base name of shared memory", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name, + 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"socket", 'S', "Socket file to use for connection.", (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -213,9 +234,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case 'W': #ifdef __WIN__ - opt_mysql_unix_port=MYSQL_NAMEDPIPE; + opt_protocol = MYSQL_PROTOCOL_PIPE; #endif break; + case OPT_MYSQL_PROTOCOL: + { + if ((opt_protocol = find_type(argument, &sql_protocol_typelib,0)) == ~(ulong) 0) + { + fprintf(stderr, "Unknown option to protocol: %s\n", argument); + exit(1); + } + break; + } case '#': DBUG_PUSH(argument ? argument : "d:t:o"); break; |