diff options
author | Sergei Golubchik <serg@mariadb.org> | 2014-12-02 22:25:16 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2014-12-02 22:25:16 +0100 |
commit | 853077ad7e81be1ade20b4beab1b95d5766d87b1 (patch) | |
tree | 4c158691947ba7beb4577f26b160f243eabf39ef /client | |
parent | bf3b4a23f75de50e0f1ab4a562e5801dabc7305b (diff) | |
parent | 2b5db1d5bcd7b46b654d59a07fc119ef6a6b8651 (diff) | |
download | mariadb-git-853077ad7e81be1ade20b4beab1b95d5766d87b1.tar.gz |
Merge branch '10.0' into bb-10.1-merge
Conflicts:
.bzrignore
VERSION
cmake/plugin.cmake
debian/dist/Debian/control
debian/dist/Ubuntu/control
mysql-test/r/join_outer.result
mysql-test/r/join_outer_jcl6.result
mysql-test/r/null.result
mysql-test/r/old-mode.result
mysql-test/r/union.result
mysql-test/t/join_outer.test
mysql-test/t/null.test
mysql-test/t/old-mode.test
mysql-test/t/union.test
packaging/rpm-oel/mysql.spec.in
scripts/mysql_config.sh
sql/ha_ndbcluster.cc
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_cond.cc
sql/item_cmpfunc.h
sql/lock.cc
sql/sql_select.cc
sql/sql_show.cc
sql/sql_update.cc
sql/sql_yacc.yy
storage/innobase/buf/buf0flu.cc
storage/innobase/fil/fil0fil.cc
storage/innobase/include/srv0srv.h
storage/innobase/lock/lock0lock.cc
storage/tokudb/CMakeLists.txt
storage/xtradb/buf/buf0flu.cc
storage/xtradb/fil/fil0fil.cc
storage/xtradb/include/srv0srv.h
storage/xtradb/lock/lock0lock.cc
support-files/mysql.spec.sh
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 10 | ||||
-rw-r--r-- | client/mysql_plugin.c | 5 | ||||
-rw-r--r-- | client/mysql_upgrade.c | 15 | ||||
-rw-r--r-- | client/mysqlimport.c | 13 | ||||
-rw-r--r-- | client/mysqlslap.c | 2 | ||||
-rw-r--r-- | client/mysqltest.cc | 8 |
6 files changed, 32 insertions, 21 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 25e6c0255c6..b299ab96b1d 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1290,6 +1290,16 @@ int main(int argc,char *argv[]) sig_handler mysql_end(int sig) { +#ifndef _WIN32 + /* + Ingnoring SIGQUIT and SIGINT signals when cleanup process starts. + This will help in resolving the double free issues, which occures in case + the signal handler function is started in between the clean up function. + */ + signal(SIGQUIT, SIG_IGN); + signal(SIGINT, SIG_IGN); +#endif + mysql_close(&mysql); #ifdef HAVE_READLINE if (!status.batch && !quick && !opt_html && !opt_xml && diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index 99da157f8c6..034f021109a 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -15,14 +15,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <my_global.h> #include <m_string.h> #include <mysql.h> #include <my_getopt.h> #include <my_dir.h> -#include <my_global.h> -#include <stdio.h> -#include <string.h> - #define SHOW_VERSION "1.0.0" #define PRINT_VERSION do { printf("%s Ver %s Distrib %s\n", \ diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index cef5e22647d..a6fbcb406b9 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -776,7 +776,7 @@ static int run_mysqlcheck_upgrade(const char *arg1, const char *arg2) static int run_mysqlcheck_fixnames(void) { - verbose("Phase 3/4: Fixing table and database names"); + verbose("Phase 3/5: Fixing table and database names"); print_conn_args("mysqlcheck"); return run_tool(mysqlcheck_path, NULL, /* Send output from mysqlcheck directly to screen */ @@ -874,7 +874,8 @@ static int run_sql_fix_privilege_tables(void) query_ptr++ ) { - dynstr_append(&ds_script, *query_ptr); + if (strcasecmp(*query_ptr, "flush privileges;\n")) + dynstr_append(&ds_script, *query_ptr); } run_query(ds_script.str, @@ -1035,19 +1036,23 @@ int main(int argc, char **argv) /* Run "mysqlcheck" and "mysql_fix_privilege_tables.sql" */ - verbose("Phase 1/4: Checking mysql database"); + verbose("Phase 1/5: Checking mysql database"); if (run_mysqlcheck_upgrade("--databases", "mysql")) die("Upgrade failed" ); - verbose("Phase 2/4: Running 'mysql_fix_privilege_tables'..."); + verbose("Phase 2/5: Running 'mysql_fix_privilege_tables'..."); if (run_sql_fix_privilege_tables()) die("Upgrade failed" ); if (!opt_systables_only && (run_mysqlcheck_fixnames() || - verbose("Phase 4/4: Checking and upgrading tables") || + verbose("Phase 4/5: Checking and upgrading tables") || run_mysqlcheck_upgrade("--all-databases","--skip-database=mysql"))) die("Upgrade failed" ); + verbose("Phase 5/5: Running 'FLUSH PRIVILEGES'..."); + if (run_query("FLUSH PRIVILEGES", NULL, TRUE)) + die("Upgrade failed" ); + verbose("OK"); /* Create a file indicating upgrade has been performed */ diff --git a/client/mysqlimport.c b/client/mysqlimport.c index af0d86b1ed5..0d4ee549c4f 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -30,19 +30,15 @@ #include "client_priv.h" #include "mysql_version.h" -#ifdef HAVE_LIBPTHREAD #include <my_pthread.h> -#endif #include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ /* Global Thread counter */ uint counter; -#ifdef HAVE_LIBPTHREAD pthread_mutex_t counter_mutex; pthread_cond_t count_threshhold; -#endif static void db_error_with_table(MYSQL *mysql, char *table); static void db_error(MYSQL *mysql); @@ -502,7 +498,10 @@ static void safe_exit(int error, MYSQL *mysql) free_defaults(argv_to_free); mysql_library_end(); my_free(opt_password); - my_end(my_end_arg); + if (error) + sf_leaking_memory= 1; /* dirty exit, some threads are still running */ + else + my_end(my_end_arg); /* clean exit */ exit(error); } @@ -575,7 +574,6 @@ static char *field_escape(char *to,const char *from,uint length) int exitcode= 0; -#ifdef HAVE_LIBPTHREAD pthread_handler_t worker_thread(void *arg) { int error; @@ -615,7 +613,6 @@ error: return 0; } -#endif int main(int argc, char **argv) @@ -635,7 +632,6 @@ int main(int argc, char **argv) } sf_leaking_memory=0; /* from now on we cleanup properly */ -#ifdef HAVE_LIBPTHREAD if (opt_use_threads && !lock_tables) { pthread_t mainthread; /* Thread descriptor */ @@ -689,7 +685,6 @@ int main(int argc, char **argv) pthread_attr_destroy(&attr); } else -#endif { MYSQL *mysql= 0; if (!(mysql= db_connect(current_host,current_db,current_user,opt_password))) diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 01064f74261..b67e409ef0b 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -84,9 +84,7 @@ TODO: #include <mysqld_error.h> #include <my_dir.h> #include <signal.h> -#include <stdarg.h> #include <sslopt-vars.h> -#include <sys/types.h> #ifndef __WIN__ #include <sys/wait.h> #endif diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 6c11cd234a9..69b94bad106 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5766,6 +5766,7 @@ void do_connect(struct st_command *command) { int con_port= opt_port; char *con_options; + char *ssl_cipher= 0; my_bool con_ssl= 0, con_compress= 0; my_bool con_pipe= 0; my_bool con_shm __attribute__ ((unused))= 0; @@ -5854,6 +5855,11 @@ void do_connect(struct st_command *command) length= (size_t) (end - con_options); if (length == 3 && !strncmp(con_options, "SSL", 3)) con_ssl= 1; + else if (!strncmp(con_options, "SSL-CIPHER=", 11)) + { + con_ssl= 1; + ssl_cipher=con_options + 11; + } else if (length == 8 && !strncmp(con_options, "COMPRESS", 8)) con_compress= 1; else if (length == 4 && !strncmp(con_options, "PIPE", 4)) @@ -5910,7 +5916,7 @@ void do_connect(struct st_command *command) { #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) mysql_ssl_set(con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, - opt_ssl_capath, opt_ssl_cipher); + opt_ssl_capath, ssl_cipher ? ssl_cipher : opt_ssl_cipher); mysql_options(con_slot->mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl); mysql_options(con_slot->mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath); #if MYSQL_VERSION_ID >= 50000 |