Loading client/mysqlbinlog.cc +17 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ static int port= 0; static const char* sock= 0; static const char* user = 0; static char* pass = 0; static char *charset= 0; static ulonglong start_position, stop_position; #define start_position_mot ((my_off_t)start_position) Loading Loading @@ -733,6 +734,9 @@ static struct my_option my_long_options[] = "Extract only binlog entries created by the server having the given id.", (gptr*) &server_id, (gptr*) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"set-charset", OPT_SET_CHARSET, "Add 'SET NAMES character_set' to the output.", (gptr*) &charset, (gptr*) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"short-form", 's', "Just show the queries, no extra info.", (gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, Loading Loading @@ -1457,6 +1461,13 @@ int main(int argc, char** argv) "/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE," "COMPLETION_TYPE=0*/;\n"); if (charset) fprintf(result_file, "\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;" "\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;" "\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;" "\n/*!40101 SET NAMES %s */;\n", charset); for (save_stop_position= stop_position, stop_position= ~(my_off_t)0 ; (--argc >= 0) && !stop_passed ; ) { Loading @@ -1481,6 +1492,12 @@ int main(int argc, char** argv) if (disable_log_bin) fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n"); if (charset) fprintf(result_file, "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n" "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); if (tmpdir.list) free_tmpdir(&tmpdir); if (result_file != stdout) Loading client/mysqldump.c +24 −39 Original line number Diff line number Diff line Loading @@ -3063,14 +3063,13 @@ static my_bool dump_all_views_in_db(char *database) different case (e.g. T1 vs t1) RETURN int - 0 if a tablename was retrieved. 1 if not pointer to the table name 0 if error */ static int get_actual_table_name(const char *old_table_name, char *new_table_name, int buf_size) static char *get_actual_table_name(const char *old_table_name, MEM_ROOT *root) { int retval; char *name= 0; MYSQL_RES *table_res; MYSQL_ROW row; char query[50 + 2*NAME_LEN]; Loading @@ -3087,66 +3086,55 @@ static int get_actual_table_name(const char *old_table_name, safe_exit(EX_MYSQLERR); } retval = 1; if ((table_res= mysql_store_result(sock))) { my_ulonglong num_rows= mysql_num_rows(table_res); if (num_rows > 0) { ulong *lengths; /* Return first row TODO: Return all matching rows */ row= mysql_fetch_row(table_res); strmake(new_table_name, row[0], buf_size-1); retval= 0; lengths= mysql_fetch_lengths(table_res); name= strmake_root(root, row[0], lengths[0]); } mysql_free_result(table_res); } DBUG_RETURN(retval); DBUG_PRINT("exit", ("new_table_name: %s", name)); DBUG_RETURN(name); } static int dump_selected_tables(char *db, char **table_names, int tables) { uint i; char table_buff[NAME_LEN*+3]; char new_table_name[NAME_LEN]; DYNAMIC_STRING lock_tables_query; HASH dump_tables; char *table_name; MEM_ROOT root; char **dump_tables, **pos, **end; DBUG_ENTER("dump_selected_tables"); if (init_dumping(db)) DBUG_RETURN(1); /* Init hash table for storing the actual name of tables to dump */ if (hash_init(&dump_tables, charset_info, 16, 0, 0, (hash_get_key) get_table_key, (hash_free_key) free_table_ent, 0)) init_alloc_root(&root, 8192, 0); if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *)))) exit(EX_EOM); init_dynamic_string(&lock_tables_query, "LOCK TABLES ", 256, 1024); for (; tables > 0 ; tables-- , table_names++) { /* the table name passed on commandline may be wrong case */ if (!get_actual_table_name(*table_names, new_table_name, sizeof(new_table_name))) if ((*pos= get_actual_table_name(*table_names, &root))) { /* Add found table name to lock_tables_query */ if (lock_tables) { dynstr_append(&lock_tables_query, quote_name(new_table_name, table_buff, 1)); dynstr_append(&lock_tables_query, quote_name(*pos, table_buff, 1)); dynstr_append(&lock_tables_query, " READ /*!32311 LOCAL */,"); } /* Add found table name to dump_tables list */ if (my_hash_insert(&dump_tables, (byte*)my_strdup(new_table_name, MYF(0)))) exit(EX_EOM); pos++; } else { Loading @@ -3156,6 +3144,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) /* We shall countinue here, if --force was given */ } } end= pos; if (lock_tables) { Loading @@ -3175,24 +3164,20 @@ static int dump_selected_tables(char *db, char **table_names, int tables) print_xml_tag1(md_result_file, "", "database name=", db, "\n"); /* Dump each selected table */ for (i= 0; i < dump_tables.records; i++) for (pos= dump_tables; pos < end; pos++) { table_name= hash_element(&dump_tables, i); DBUG_PRINT("info",("Dumping table %s", table_name)); dump_table(table_name,db); DBUG_PRINT("info",("Dumping table %s", *pos)); dump_table(*pos, db); if (opt_dump_triggers && mysql_get_server_version(sock) >= 50009) dump_triggers_for_table(table_name, db); dump_triggers_for_table(*pos, db); } /* Dump each selected view */ if (was_views) { for(i=0; i < dump_tables.records; i++) { table_name= hash_element(&dump_tables, i); get_view_structure(table_name, db); } for (pos= dump_tables; pos < end; pos++) get_view_structure(*pos, db); } if (opt_events && !opt_xml && mysql_get_server_version(sock) >= 50106) Loading @@ -3207,7 +3192,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) DBUG_PRINT("info", ("Dumping routines for database %s", db)); dump_routines_for_db(db); } hash_free(&dump_tables); free_root(&root, MYF(0)); my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); order_by= 0; if (opt_xml) Loading extra/yassl/include/yassl_error.hpp +2 −2 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ #ifndef yaSSL_ERROR_HPP #define yaSSL_ERROR_HPP #include "stdexcept.hpp" namespace yaSSL { Loading Loading @@ -63,7 +62,7 @@ enum { MAX_ERROR_SZ = 80 }; void SetErrorString(YasslError, char*); /* remove for now, if go back to exceptions use this wrapper // Base class for all yaSSL exceptions class Error : public mySTL::runtime_error { YasslError error_; Loading @@ -75,6 +74,7 @@ public: YasslError get_number() const; Library get_lib() const; }; */ } // naemspace Loading extra/yassl/mySTL/stdexcept.hpp +0 −2 Original line number Diff line number Diff line Loading @@ -46,10 +46,8 @@ public: // for compiler generated call, never used static void operator delete(void*) { assert(0); } private: #if defined(__hpux) // don't allow dynamic creation of exceptions static void* operator new(size_t); #endif }; Loading extra/yassl/src/yassl_error.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -27,10 +27,12 @@ #include "yassl_error.hpp" #include "error.hpp" // TaoCrypt error numbers #include "openssl/ssl.h" // SSL_ERROR_WANT_READ #include <string.h> // strncpy namespace yaSSL { /* may bring back in future Error::Error(const char* s, YasslError e, Library l) : mySTL::runtime_error(s), error_(e), lib_(l) { Loading @@ -48,6 +50,7 @@ Library Error::get_lib() const return lib_; } */ void SetErrorString(YasslError error, char* buffer) Loading Loading
client/mysqlbinlog.cc +17 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ static int port= 0; static const char* sock= 0; static const char* user = 0; static char* pass = 0; static char *charset= 0; static ulonglong start_position, stop_position; #define start_position_mot ((my_off_t)start_position) Loading Loading @@ -733,6 +734,9 @@ static struct my_option my_long_options[] = "Extract only binlog entries created by the server having the given id.", (gptr*) &server_id, (gptr*) &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"set-charset", OPT_SET_CHARSET, "Add 'SET NAMES character_set' to the output.", (gptr*) &charset, (gptr*) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"short-form", 's', "Just show the queries, no extra info.", (gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, Loading Loading @@ -1457,6 +1461,13 @@ int main(int argc, char** argv) "/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE," "COMPLETION_TYPE=0*/;\n"); if (charset) fprintf(result_file, "\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;" "\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;" "\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;" "\n/*!40101 SET NAMES %s */;\n", charset); for (save_stop_position= stop_position, stop_position= ~(my_off_t)0 ; (--argc >= 0) && !stop_passed ; ) { Loading @@ -1481,6 +1492,12 @@ int main(int argc, char** argv) if (disable_log_bin) fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n"); if (charset) fprintf(result_file, "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n" "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); if (tmpdir.list) free_tmpdir(&tmpdir); if (result_file != stdout) Loading
client/mysqldump.c +24 −39 Original line number Diff line number Diff line Loading @@ -3063,14 +3063,13 @@ static my_bool dump_all_views_in_db(char *database) different case (e.g. T1 vs t1) RETURN int - 0 if a tablename was retrieved. 1 if not pointer to the table name 0 if error */ static int get_actual_table_name(const char *old_table_name, char *new_table_name, int buf_size) static char *get_actual_table_name(const char *old_table_name, MEM_ROOT *root) { int retval; char *name= 0; MYSQL_RES *table_res; MYSQL_ROW row; char query[50 + 2*NAME_LEN]; Loading @@ -3087,66 +3086,55 @@ static int get_actual_table_name(const char *old_table_name, safe_exit(EX_MYSQLERR); } retval = 1; if ((table_res= mysql_store_result(sock))) { my_ulonglong num_rows= mysql_num_rows(table_res); if (num_rows > 0) { ulong *lengths; /* Return first row TODO: Return all matching rows */ row= mysql_fetch_row(table_res); strmake(new_table_name, row[0], buf_size-1); retval= 0; lengths= mysql_fetch_lengths(table_res); name= strmake_root(root, row[0], lengths[0]); } mysql_free_result(table_res); } DBUG_RETURN(retval); DBUG_PRINT("exit", ("new_table_name: %s", name)); DBUG_RETURN(name); } static int dump_selected_tables(char *db, char **table_names, int tables) { uint i; char table_buff[NAME_LEN*+3]; char new_table_name[NAME_LEN]; DYNAMIC_STRING lock_tables_query; HASH dump_tables; char *table_name; MEM_ROOT root; char **dump_tables, **pos, **end; DBUG_ENTER("dump_selected_tables"); if (init_dumping(db)) DBUG_RETURN(1); /* Init hash table for storing the actual name of tables to dump */ if (hash_init(&dump_tables, charset_info, 16, 0, 0, (hash_get_key) get_table_key, (hash_free_key) free_table_ent, 0)) init_alloc_root(&root, 8192, 0); if (!(dump_tables= pos= (char**) alloc_root(&root, tables * sizeof(char *)))) exit(EX_EOM); init_dynamic_string(&lock_tables_query, "LOCK TABLES ", 256, 1024); for (; tables > 0 ; tables-- , table_names++) { /* the table name passed on commandline may be wrong case */ if (!get_actual_table_name(*table_names, new_table_name, sizeof(new_table_name))) if ((*pos= get_actual_table_name(*table_names, &root))) { /* Add found table name to lock_tables_query */ if (lock_tables) { dynstr_append(&lock_tables_query, quote_name(new_table_name, table_buff, 1)); dynstr_append(&lock_tables_query, quote_name(*pos, table_buff, 1)); dynstr_append(&lock_tables_query, " READ /*!32311 LOCAL */,"); } /* Add found table name to dump_tables list */ if (my_hash_insert(&dump_tables, (byte*)my_strdup(new_table_name, MYF(0)))) exit(EX_EOM); pos++; } else { Loading @@ -3156,6 +3144,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) /* We shall countinue here, if --force was given */ } } end= pos; if (lock_tables) { Loading @@ -3175,24 +3164,20 @@ static int dump_selected_tables(char *db, char **table_names, int tables) print_xml_tag1(md_result_file, "", "database name=", db, "\n"); /* Dump each selected table */ for (i= 0; i < dump_tables.records; i++) for (pos= dump_tables; pos < end; pos++) { table_name= hash_element(&dump_tables, i); DBUG_PRINT("info",("Dumping table %s", table_name)); dump_table(table_name,db); DBUG_PRINT("info",("Dumping table %s", *pos)); dump_table(*pos, db); if (opt_dump_triggers && mysql_get_server_version(sock) >= 50009) dump_triggers_for_table(table_name, db); dump_triggers_for_table(*pos, db); } /* Dump each selected view */ if (was_views) { for(i=0; i < dump_tables.records; i++) { table_name= hash_element(&dump_tables, i); get_view_structure(table_name, db); } for (pos= dump_tables; pos < end; pos++) get_view_structure(*pos, db); } if (opt_events && !opt_xml && mysql_get_server_version(sock) >= 50106) Loading @@ -3207,7 +3192,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) DBUG_PRINT("info", ("Dumping routines for database %s", db)); dump_routines_for_db(db); } hash_free(&dump_tables); free_root(&root, MYF(0)); my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); order_by= 0; if (opt_xml) Loading
extra/yassl/include/yassl_error.hpp +2 −2 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ #ifndef yaSSL_ERROR_HPP #define yaSSL_ERROR_HPP #include "stdexcept.hpp" namespace yaSSL { Loading Loading @@ -63,7 +62,7 @@ enum { MAX_ERROR_SZ = 80 }; void SetErrorString(YasslError, char*); /* remove for now, if go back to exceptions use this wrapper // Base class for all yaSSL exceptions class Error : public mySTL::runtime_error { YasslError error_; Loading @@ -75,6 +74,7 @@ public: YasslError get_number() const; Library get_lib() const; }; */ } // naemspace Loading
extra/yassl/mySTL/stdexcept.hpp +0 −2 Original line number Diff line number Diff line Loading @@ -46,10 +46,8 @@ public: // for compiler generated call, never used static void operator delete(void*) { assert(0); } private: #if defined(__hpux) // don't allow dynamic creation of exceptions static void* operator new(size_t); #endif }; Loading
extra/yassl/src/yassl_error.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -27,10 +27,12 @@ #include "yassl_error.hpp" #include "error.hpp" // TaoCrypt error numbers #include "openssl/ssl.h" // SSL_ERROR_WANT_READ #include <string.h> // strncpy namespace yaSSL { /* may bring back in future Error::Error(const char* s, YasslError e, Library l) : mySTL::runtime_error(s), error_(e), lib_(l) { Loading @@ -48,6 +50,7 @@ Library Error::get_lib() const return lib_; } */ void SetErrorString(YasslError error, char* buffer) Loading