mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
5.5-merge
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000-2006 MySQL AB
|
||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -25,6 +25,7 @@
|
||||
#include <signal.h>
|
||||
#include <stdarg.h>
|
||||
#include <sslopt-vars.h>
|
||||
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
|
||||
|
||||
static char * host=0, *opt_password=0, *user=0;
|
||||
static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0;
|
||||
@ -33,6 +34,7 @@ static my_bool debug_info_flag= 0, debug_check_flag= 0;
|
||||
static uint my_end_arg= 0;
|
||||
static uint opt_verbose=0;
|
||||
static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
|
||||
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
|
||||
|
||||
#ifdef HAVE_SMEM
|
||||
static char *shared_memory_base_name=0;
|
||||
@ -123,6 +125,12 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
|
||||
|
||||
if (opt_plugin_dir && *opt_plugin_dir)
|
||||
mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
|
||||
|
||||
if (opt_default_auth && *opt_default_auth)
|
||||
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
|
||||
|
||||
if (!(mysql_real_connect(&mysql,host,user,opt_password,
|
||||
(first_argument_uses_wildcards) ? "" :
|
||||
argv[0],opt_mysql_port,opt_mysql_unix_port,
|
||||
@ -181,6 +189,10 @@ static struct my_option my_long_options[] =
|
||||
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
|
||||
&debug_info_flag, &debug_info_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
|
||||
@ -194,6 +206,9 @@ static struct my_option my_long_options[] =
|
||||
"Password to use when connecting to server. If password is not given, it's "
|
||||
"solicited on the tty.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
&opt_plugin_dir, &opt_plugin_dir, 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
|
||||
@ -247,8 +262,7 @@ static void print_version(void)
|
||||
static void usage(void)
|
||||
{
|
||||
print_version();
|
||||
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
|
||||
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010)"));
|
||||
puts("Shows the structure of a MySQL database (databases, tables, and columns).\n");
|
||||
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
|
||||
puts("\n\
|
||||
|
Reference in New Issue
Block a user