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/mysqlcheck.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/mysqlcheck.c')
-rw-r--r-- | client/mysqlcheck.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 24b67a60255..6b56603946a 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -41,6 +41,10 @@ static char *opt_password = 0, *current_user = 0, *default_charset = 0, *current_host = 0; static int first_error = 0; DYNAMIC_ARRAY tables4repair; +#ifdef HAVE_SMEM +static char *shared_memory_base_name=0; +#endif +static uint opt_protocol=0; enum operations {DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE}; @@ -109,6 +113,8 @@ static struct my_option my_long_options[] = {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port, (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 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}, {"quick", 'q', "If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.", (gptr*) &opt_quick, (gptr*) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, @@ -116,6 +122,11 @@ static struct my_option my_long_options[] = {"repair", 'r', "Can fix almost anything except unique keys that aren't unique.", 0, 0, 0, GET_NO_ARG, NO_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 {"silent", 's', "Print only error messages.", (gptr*) &opt_silent, (gptr*) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "Socket file to use for connection.", @@ -233,7 +244,7 @@ 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 '#': @@ -247,6 +258,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), verbose++; break; case 'V': print_version(); exit(0); + 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; + } } return 0; } @@ -534,6 +554,12 @@ static int dbConnect(char *host, char *user, char *passwd) mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, opt_ssl_capath, opt_ssl_cipher); #endif + if (opt_protocol) + mysql_options(&mysql_connection,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); +#ifdef HAVE_SMEM + if (shared_memory_base_name) + mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); +#endif if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd, NULL, opt_mysql_port, opt_mysql_unix_port, 0))) { @@ -621,6 +647,9 @@ int main(int argc, char **argv) if (opt_auto_repair) delete_dynamic(&tables4repair); my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR)); +#ifdef HAVE_SMEM + my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); +#endif my_end(0); return(first_error!=0); } /* main */ |