summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-04-29 16:50:58 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2016-04-29 16:50:58 -0400
commit8a1efa1bdd29b756c93a3ddbd8ad6fadec1082bc (patch)
tree9827e75d29817f3ddbc2008ba2b5b21553c14c5e /client
parent7c42b47e67918104fddd121a1ca9fede28ed47cf (diff)
parent9eba34f08675c31b0796eeb127582be827773070 (diff)
downloadmariadb-git-8a1efa1bdd29b756c93a3ddbd8ad6fadec1082bc.tar.gz
Merge branch '10.0' into 10.0-galera
Diffstat (limited to 'client')
-rw-r--r--client/client_priv.h1
-rw-r--r--client/mysql.cc37
-rw-r--r--client/mysql_upgrade.c4
-rw-r--r--client/mysqladmin.cc2
-rw-r--r--client/mysqlbinlog.cc15
-rw-r--r--client/mysqlcheck.c7
-rw-r--r--client/mysqldump.c2
-rw-r--r--client/mysqlimport.c2
-rw-r--r--client/mysqlshow.c2
-rw-r--r--client/mysqlslap.c2
-rw-r--r--client/mysqltest.cc8
11 files changed, 52 insertions, 30 deletions
diff --git a/client/client_priv.h b/client/client_priv.h
index 67a6e822ea3..3905f323156 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -1,5 +1,6 @@
/*
Copyright (c) 2001, 2012, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2016, MariaDB
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
diff --git a/client/mysql.cc b/client/mysql.cc
index f1346395dfe..89f9a75ec11 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1,7 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013, Monty Program Ab.
- Copyright (c) 2013, 2014, SkySQL Ab
+ Copyright (c) 2009, 2016, MariaDB
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
@@ -96,9 +95,16 @@ extern "C" {
#endif
}
-#if !defined(HAVE_VIDATTR)
-#undef vidattr
-#define vidattr(A) {} // Can't get this to work
+#ifdef HAVE_VIDATTR
+static int have_curses= 0;
+static void my_vidattr(chtype attrs)
+{
+ if (have_curses)
+ vidattr(attrs);
+}
+#else
+#undef HAVE_SETUPTERM
+#define my_vidattr(A) {} // Can't get this to work
#endif
#ifdef FN_NO_CASE_SENSE
@@ -3358,7 +3364,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
end:
- /* Show warnings if any or error occured */
+ /* Show warnings if any or error occurred */
if (show_warnings == 1 && (warnings >= 1 || error))
print_warnings();
@@ -4740,9 +4746,9 @@ com_status(String *buffer __attribute__((unused)),
if (skip_updates)
{
- vidattr(A_BOLD);
+ my_vidattr(A_BOLD);
tee_fprintf(stdout, "\nAll updates ignored to this database\n");
- vidattr(A_NORMAL);
+ my_vidattr(A_NORMAL);
}
#ifdef USE_POPEN
tee_fprintf(stdout, "Current pager:\t\t%s\n", pager);
@@ -4810,9 +4816,9 @@ com_status(String *buffer __attribute__((unused)),
}
if (safe_updates)
{
- vidattr(A_BOLD);
+ my_vidattr(A_BOLD);
tee_fprintf(stdout, "\nNote that you are running in safe_update_mode:\n");
- vidattr(A_NORMAL);
+ my_vidattr(A_NORMAL);
tee_fprintf(stdout, "\
UPDATEs and DELETEs that don't use a key in the WHERE clause are not allowed.\n\
(One can force an UPDATE/DELETE by adding LIMIT # at the end of the command.)\n\
@@ -4905,10 +4911,11 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
{
if (!inited)
{
- inited=1;
#ifdef HAVE_SETUPTERM
- (void) setupterm((char *)0, 1, (int *) 0);
+ int errret;
+ have_curses= setupterm((char *)0, 1, &errret) != ERR;
#endif
+ inited=1;
}
if (info_type == INFO_ERROR)
{
@@ -4920,7 +4927,7 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
putchar('\a'); /* This should make a bell */
#endif
}
- vidattr(A_STANDOUT);
+ my_vidattr(A_STANDOUT);
if (error)
{
if (sqlstate)
@@ -4939,9 +4946,9 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
tee_fputs(": ", file);
}
else
- vidattr(A_BOLD);
+ my_vidattr(A_BOLD);
(void) tee_puts(str, file);
- vidattr(A_NORMAL);
+ my_vidattr(A_NORMAL);
}
if (unbuffered)
fflush(file);
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index f3076f61b3e..e7170201a2a 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2006, 2013, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+ Copyright (c) 2010, 2016, MariaDB
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
@@ -649,7 +649,7 @@ static int get_upgrade_info_file_name(char* name)
/*
Read the content of mysql_upgrade_info file and
compare the version number form file against
- version number wich mysql_upgrade was compiled for
+ version number which mysql_upgrade was compiled for
NOTE
This is an optimization to avoid running mysql_upgrade
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index bc6b68c63d1..daffdefd768 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+ Copyright (c) 2010, 2016, MariaDB
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
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 315fdcd22dc..4be31421f9b 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -34,6 +34,7 @@
#define TABLE TABLE_CLIENT
#include "client_priv.h"
#include <my_time.h>
+#include <sslopt-vars.h>
/* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */
#include "sql_priv.h"
#include "log_event.h"
@@ -1392,6 +1393,7 @@ static struct my_option my_options[] =
{"socket", 'S', "The socket file to use for connection.",
&sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
+#include <sslopt-longopts.h>
{"start-datetime", OPT_START_DATETIME,
"Start reading the binlog at first event having a datetime equal or "
"posterior to the argument; the argument must be a date and time "
@@ -1599,6 +1601,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
#endif
+#include <sslopt-case.h>
case 'd':
one_database = 1;
break;
@@ -1748,6 +1751,18 @@ static Exit_status safe_connect()
return ERROR_STOP;
}
+#ifdef HAVE_OPENSSL
+ if (opt_use_ssl)
+ {
+ mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
+ opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
+ mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+ (char*)&opt_ssl_verify_server_cert);
+#endif /*HAVE_OPENSSL*/
+
if (opt_plugindir && *opt_plugindir)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugindir);
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 15b98bb59c2..8dc3efd1ab2 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+ Copyright (c) 2010, 2016, MariaDB
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
@@ -277,8 +277,8 @@ static void usage(void)
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
my_progname);
- puts("Please consult the MariaDB/MySQL knowledgebase at");
- puts("http://kb.askmonty.org/v/mysqlcheck for latest information about");
+ puts("Please consult the MariaDB Knowledge Base at");
+ puts("https://mariadb.com/kb/en/mysqlcheck for latest information about");
puts("this program.");
print_defaults("my", load_default_groups);
puts("");
@@ -523,7 +523,6 @@ static int is_view(const char *table)
{
fprintf(stderr, "Failed to %s\n", query);
fprintf(stderr, "Error: %s\n", mysql_error(sock));
- my_free(query);
DBUG_RETURN(-1);
}
res= mysql_store_result(sock);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index e41305d7c07..dc6798560c3 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, Monty Program Ab.
+ Copyright (c) 2010, 2016, MariaDB
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
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 2363f1b69df..5b15155e039 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2011, 2015, MariaDB
+ Copyright (c) 2011, 2016, MariaDB
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
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index fd81f18790a..444278d40f1 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+ Copyright (c) 2010, 2016, MariaDB
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
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 29919f3028d..b3229980e77 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2015, MariaDB
+ Copyright (c) 2010, 2016, MariaDB
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
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 026934a2feb..84d5abc1a67 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013, Monty Program Ab.
+ Copyright (c) 2009, 2016, Monty Program Ab.
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
@@ -1104,7 +1104,7 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
Run query and dump the result to stderr in vertical format
NOTE! This function should be safe to call when an error
- has occured and thus any further errors will be ignored(although logged)
+ has occurred and thus any further errors will be ignored (although logged)
SYNOPSIS
show_query
@@ -1170,7 +1170,7 @@ static void show_query(MYSQL* mysql, const char* query)
is added to the warning stack, only print @@warning_count-1 warnings.
NOTE! This function should be safe to call when an error
- has occured and this any further errors will be ignored(although logged)
+ has occurred and this any further errors will be ignored(although logged)
SYNOPSIS
show_warnings_before_error
@@ -4701,7 +4701,7 @@ void do_sync_with_master2(struct st_command *command, long offset,
master_pos_wait returned NULL. This indicates that
slave SQL thread is not started, the slave's master
information is not initialized, the arguments are
- incorrect, or an error has occured
+ incorrect, or an error has occurred
*/
die("%.*s failed: '%s' returned NULL " \
"indicating slave SQL thread failure",