diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-02-26 15:28:07 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-02-26 15:28:07 +0100 |
commit | 0dc23679c867629ded5f9534d2ab6e8edf238aa0 (patch) | |
tree | 9cf966507fa2ef0fd17932b600d051df5f7bd2e5 /client | |
parent | 6efa5efa7dd112b6ac2efdd84235a13cca51c4d4 (diff) | |
parent | 0b9a0a3517ca2b75655f3af5c372cf333d3d5fe2 (diff) | |
download | mariadb-git-0dc23679c867629ded5f9534d2ab6e8edf238aa0.tar.gz |
10.0-base merge
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql_plugin.c | 4 | ||||
-rw-r--r-- | client/mysqldump.c | 22 | ||||
-rw-r--r-- | client/mysqltest.cc | 18 |
3 files changed, 27 insertions, 17 deletions
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index c3fa1a49e81..99da157f8c6 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2011, 2013, 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 @@ -857,7 +857,7 @@ static int process_options(int argc, char *argv[], char *operation) strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1); #endif buff[sizeof(buff) - 1]= 0; - my_delete(opt_basedir, MYF(0)); + my_free(opt_basedir); opt_basedir= my_strdup(buff, MYF(MY_FAE)); } } diff --git a/client/mysqldump.c b/client/mysqldump.c index 151a66302b2..fa5c06786d2 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -166,6 +166,8 @@ static void dynstr_set_checked(DYNAMIC_STRING *str, const char *init_str); static void dynstr_append_mem_checked(DYNAMIC_STRING *str, const char *append, uint length); static void dynstr_realloc_checked(DYNAMIC_STRING *str, ulong additional_size); + +static int do_start_slave_sql(MYSQL *mysql_con); /* Constant for detection of default value of default_charset. If default_charset is equal to mysql_universal_client_charset, then @@ -1500,6 +1502,8 @@ static void free_resources() static void maybe_exit(int error) { + if (opt_slave_data) + do_start_slave_sql(mysql); if (!first_error) first_error= error; if (ignore_errors) @@ -3655,7 +3659,8 @@ static void dump_table(char *table, char *db) field->type == MYSQL_TYPE_BLOB || field->type == MYSQL_TYPE_LONG_BLOB || field->type == MYSQL_TYPE_MEDIUM_BLOB || - field->type == MYSQL_TYPE_TINY_BLOB)) ? 1 : 0; + field->type == MYSQL_TYPE_TINY_BLOB || + field->type == MYSQL_TYPE_GEOMETRY)) ? 1 : 0; if (extended_insert && !opt_xml) { if (i == 0) @@ -5700,10 +5705,6 @@ int main(int argc, char **argv) dump_databases(argv); } - /* if --dump-slave , start the slave sql thread */ - if (opt_slave_data && do_start_slave_sql(mysql)) - goto err; - /* add 'START SLAVE' to end of dump */ if (opt_slave_apply && add_slave_statements()) goto err; @@ -5719,9 +5720,6 @@ int main(int argc, char **argv) if (opt_delete_master_logs && purge_bin_logs_to(mysql, bin_log_name)) goto err; -#ifdef HAVE_SMEM - my_free(shared_memory_base_name); -#endif /* No reason to explicitely COMMIT the transaction, neither to explicitely UNLOCK TABLES: these will be automatically be done by the server when we @@ -5729,6 +5727,14 @@ int main(int argc, char **argv) server. */ err: + /* if --dump-slave , start the slave sql thread */ + if (opt_slave_data && do_start_slave_sql(mysql)) + goto err; + +#ifdef HAVE_SMEM + my_free(shared_memory_base_name); +#endif + dbDisconnect(current_host); if (!path) write_footer(md_result_file); diff --git a/client/mysqltest.cc b/client/mysqltest.cc index a2e2ad55d66..d6158f471fd 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -528,6 +528,7 @@ struct st_command { char *query, *query_buf,*first_argument,*last_argument,*end; DYNAMIC_STRING content; + DYNAMIC_STRING eval_query; int first_word_len, query_len; my_bool abort_on_error, used_replace; struct st_expected_errors expected_errors; @@ -1399,6 +1400,8 @@ void free_used_memory() { struct st_command **q= dynamic_element(&q_lines, i, struct st_command**); my_free((*q)->query_buf); + if ((*q)->eval_query.str) + dynstr_free(&(*q)->eval_query); if ((*q)->content.str) dynstr_free(&(*q)->content); my_free((*q)); @@ -8342,7 +8345,6 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) DYNAMIC_STRING ds_result; DYNAMIC_STRING ds_sorted; DYNAMIC_STRING ds_warnings; - DYNAMIC_STRING eval_query; char *query; int query_len; my_bool view_created= 0, sp_created= 0; @@ -8365,10 +8367,14 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) if (command->type == Q_EVAL || command->type == Q_SEND_EVAL || command->type == Q_EVALP) { - init_dynamic_string(&eval_query, "", command->query_len+256, 1024); - do_eval(&eval_query, command->query, command->end, FALSE); - query = eval_query.str; - query_len = eval_query.length; + if (!command->eval_query.str) + init_dynamic_string(&command->eval_query, "", command->query_len + 256, + 1024); + else + dynstr_set(&command->eval_query, 0); + do_eval(&command->eval_query, command->query, command->end, FALSE); + query= command->eval_query.str; + query_len= command->eval_query.length; } else { @@ -8536,8 +8542,6 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) dynstr_free(&ds_warnings); ds_warn= 0; - if (command->type == Q_EVAL || command->type == Q_SEND_EVAL) - dynstr_free(&eval_query); if (display_result_sorted) { |