Loading client/client_priv.h +2 −2 Original line number Diff line number Diff line Loading @@ -49,6 +49,6 @@ enum options_client #ifdef HAVE_NDBCLUSTER_DB OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, #endif OPT_TRIGGERS, OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, OPT_TRIGGER }; client/mysql.cc +1 −1 Original line number Diff line number Diff line Loading @@ -432,7 +432,7 @@ int main(int argc,char *argv[]) put_info((char*) glob_buffer.ptr(),INFO_INFO); #ifdef HAVE_READLINE initialize_readline(my_progname); initialize_readline((char*) my_progname); if (!status.batch && !quick && !opt_html && !opt_xml) { /* read-history from file, default ~/.mysql_history*/ Loading client/mysqldump.c +5 −3 Original line number Diff line number Diff line Loading @@ -372,7 +372,7 @@ static struct my_option my_long_options[] = (gptr*) &path, (gptr*) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"triggers", OPT_TRIGGER, "Dump triggers for each dumped table", {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table", (gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE Loading Loading @@ -424,6 +424,7 @@ void check_io(FILE *file) if (ferror(file)) { fprintf(stderr, "%s: Got errno %d on write\n", my_progname, errno); ignore_errors= 0; /* We can't ignore this error */ safe_exit(EX_EOF); } } Loading Loading @@ -2615,7 +2616,7 @@ static int do_show_master_status(MYSQL *mysql_con) { /* SHOW MASTER STATUS reports nothing and --force is not enabled */ my_printf_error(0, "Error: Binlogging on server not active", MYF(0), mysql_error(mysql_con)); MYF(0)); mysql_free_result(master); return 1; } Loading Loading @@ -2986,11 +2987,12 @@ static my_bool get_view_structure(char *table, char* db) int main(int argc, char **argv) { MY_INIT("mysqldump"); compatible_mode_normal_str[0]= 0; default_charset= (char *)mysql_universal_client_charset; bzero((char*) &ignore_table, sizeof(ignore_table)); MY_INIT("mysqldump"); if (get_options(&argc, &argv)) { my_end(0); Loading client/mysqltest.c +39 −11 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ **********************************************************************/ #define MTEST_VERSION "2.4" #define MTEST_VERSION "2.5" #include <my_global.h> #include <mysql_embed.h> Loading Loading @@ -151,6 +151,7 @@ const char* user = 0, *host = 0, *unix_sock = 0, *opt_basedir="./"; static int port = 0; static my_bool opt_big_test= 0, opt_compress= 0, silent= 0, verbose = 0; static my_bool tty_password= 0, ps_protocol= 0, ps_protocol_enabled= 0; static int parsing_disabled= 0; static uint start_lineno, *lineno; const char* manager_user="root",*manager_host=0; char *manager_pass=0; Loading Loading @@ -308,6 +309,7 @@ Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL, Q_EXIT, Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT, Q_IF, Q_DISABLE_PARSING, Q_ENABLE_PARSING, Q_UNKNOWN, /* Unknown command. */ Q_COMMENT, /* Comments, ignored. */ Loading Loading @@ -399,6 +401,8 @@ const char *command_names[]= "disable_reconnect", "enable_reconnect", "if", "disable_parsing", "enable_parsing", 0 }; Loading Loading @@ -2141,7 +2145,7 @@ int read_line(char* buf, int size) } break; case R_LINE_START: if (c == '#' || c == '-') if (c == '#' || c == '-' || parsing_disabled) { state = R_COMMENT; } Loading Loading @@ -2268,18 +2272,22 @@ int read_query(struct st_query** q_ptr) /* This goto is to avoid losing the "expected error" info. */ goto end; } if (!parsing_disabled) { memcpy((gptr) q->expected_errno, (gptr) global_expected_errno, sizeof(global_expected_errno)); q->expected_errors= global_expected_errors; q->abort_on_error= (global_expected_errors == 0 && abort_on_error); bzero((gptr) global_expected_errno, sizeof(global_expected_errno)); global_expected_errors=0; } if (p[0] == '-' && p[1] == '-') { q->type= Q_COMMENT_WITH_COMMAND; p+= 2; /* To calculate first word */ } else else if (!parsing_disabled) { if (*p == '!') { Loading Loading @@ -3586,20 +3594,29 @@ void get_query_type(struct st_query* q) uint type; DBUG_ENTER("get_query_type"); if (*q->query == '}') if (!parsing_disabled && *q->query == '}') { q->type = Q_END_BLOCK; DBUG_VOID_RETURN; } if (q->type != Q_COMMENT_WITH_COMMAND) q->type = Q_QUERY; q->type= parsing_disabled ? Q_COMMENT : Q_QUERY; save=q->query[q->first_word_len]; q->query[q->first_word_len]=0; type=find_type(q->query, &command_typelib, 1+2); q->query[q->first_word_len]=save; if (type > 0) { q->type=(enum enum_commands) type; /* Found command */ /* If queries are disabled, only recognize --enable-queries and --disable-queries */ if (parsing_disabled && q->type != Q_ENABLE_PARSING && q->type != Q_DISABLE_PARSING) q->type= Q_COMMENT; } DBUG_VOID_RETURN; } Loading Loading @@ -3963,6 +3980,17 @@ int main(int argc, char **argv) case Q_ENABLE_RECONNECT: cur_con->mysql.reconnect= 1; break; case Q_DISABLE_PARSING: parsing_disabled++; break; case Q_ENABLE_PARSING: /* Ensure we don't get parsing_disabled < 0 as this would accidently disable code we don't want to have disabled */ if (parsing_disabled > 0) parsing_disabled--; break; case Q_EXIT: abort_flag= 1; Loading include/my_sys.h +1 −1 Original line number Diff line number Diff line Loading @@ -218,7 +218,7 @@ extern int errno; /* declare errno */ #endif /* #ifndef errno */ extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char *home_dir; /* Home directory for user */ extern char *my_progname; /* program-name (printed in errors) */ extern const char *my_progname; /* program-name (printed in errors) */ extern char NEAR curr_dir[]; /* Current directory for user */ extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); extern int (*fatal_error_handler_hook)(uint my_err, const char *str, Loading Loading
client/client_priv.h +2 −2 Original line number Diff line number Diff line Loading @@ -49,6 +49,6 @@ enum options_client #ifdef HAVE_NDBCLUSTER_DB OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, #endif OPT_TRIGGERS, OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, OPT_TRIGGER };
client/mysql.cc +1 −1 Original line number Diff line number Diff line Loading @@ -432,7 +432,7 @@ int main(int argc,char *argv[]) put_info((char*) glob_buffer.ptr(),INFO_INFO); #ifdef HAVE_READLINE initialize_readline(my_progname); initialize_readline((char*) my_progname); if (!status.batch && !quick && !opt_html && !opt_xml) { /* read-history from file, default ~/.mysql_history*/ Loading
client/mysqldump.c +5 −3 Original line number Diff line number Diff line Loading @@ -372,7 +372,7 @@ static struct my_option my_long_options[] = (gptr*) &path, (gptr*) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"triggers", OPT_TRIGGER, "Dump triggers for each dumped table", {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table", (gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE Loading Loading @@ -424,6 +424,7 @@ void check_io(FILE *file) if (ferror(file)) { fprintf(stderr, "%s: Got errno %d on write\n", my_progname, errno); ignore_errors= 0; /* We can't ignore this error */ safe_exit(EX_EOF); } } Loading Loading @@ -2615,7 +2616,7 @@ static int do_show_master_status(MYSQL *mysql_con) { /* SHOW MASTER STATUS reports nothing and --force is not enabled */ my_printf_error(0, "Error: Binlogging on server not active", MYF(0), mysql_error(mysql_con)); MYF(0)); mysql_free_result(master); return 1; } Loading Loading @@ -2986,11 +2987,12 @@ static my_bool get_view_structure(char *table, char* db) int main(int argc, char **argv) { MY_INIT("mysqldump"); compatible_mode_normal_str[0]= 0; default_charset= (char *)mysql_universal_client_charset; bzero((char*) &ignore_table, sizeof(ignore_table)); MY_INIT("mysqldump"); if (get_options(&argc, &argv)) { my_end(0); Loading
client/mysqltest.c +39 −11 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ **********************************************************************/ #define MTEST_VERSION "2.4" #define MTEST_VERSION "2.5" #include <my_global.h> #include <mysql_embed.h> Loading Loading @@ -151,6 +151,7 @@ const char* user = 0, *host = 0, *unix_sock = 0, *opt_basedir="./"; static int port = 0; static my_bool opt_big_test= 0, opt_compress= 0, silent= 0, verbose = 0; static my_bool tty_password= 0, ps_protocol= 0, ps_protocol_enabled= 0; static int parsing_disabled= 0; static uint start_lineno, *lineno; const char* manager_user="root",*manager_host=0; char *manager_pass=0; Loading Loading @@ -308,6 +309,7 @@ Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL, Q_EXIT, Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT, Q_IF, Q_DISABLE_PARSING, Q_ENABLE_PARSING, Q_UNKNOWN, /* Unknown command. */ Q_COMMENT, /* Comments, ignored. */ Loading Loading @@ -399,6 +401,8 @@ const char *command_names[]= "disable_reconnect", "enable_reconnect", "if", "disable_parsing", "enable_parsing", 0 }; Loading Loading @@ -2141,7 +2145,7 @@ int read_line(char* buf, int size) } break; case R_LINE_START: if (c == '#' || c == '-') if (c == '#' || c == '-' || parsing_disabled) { state = R_COMMENT; } Loading Loading @@ -2268,18 +2272,22 @@ int read_query(struct st_query** q_ptr) /* This goto is to avoid losing the "expected error" info. */ goto end; } if (!parsing_disabled) { memcpy((gptr) q->expected_errno, (gptr) global_expected_errno, sizeof(global_expected_errno)); q->expected_errors= global_expected_errors; q->abort_on_error= (global_expected_errors == 0 && abort_on_error); bzero((gptr) global_expected_errno, sizeof(global_expected_errno)); global_expected_errors=0; } if (p[0] == '-' && p[1] == '-') { q->type= Q_COMMENT_WITH_COMMAND; p+= 2; /* To calculate first word */ } else else if (!parsing_disabled) { if (*p == '!') { Loading Loading @@ -3586,20 +3594,29 @@ void get_query_type(struct st_query* q) uint type; DBUG_ENTER("get_query_type"); if (*q->query == '}') if (!parsing_disabled && *q->query == '}') { q->type = Q_END_BLOCK; DBUG_VOID_RETURN; } if (q->type != Q_COMMENT_WITH_COMMAND) q->type = Q_QUERY; q->type= parsing_disabled ? Q_COMMENT : Q_QUERY; save=q->query[q->first_word_len]; q->query[q->first_word_len]=0; type=find_type(q->query, &command_typelib, 1+2); q->query[q->first_word_len]=save; if (type > 0) { q->type=(enum enum_commands) type; /* Found command */ /* If queries are disabled, only recognize --enable-queries and --disable-queries */ if (parsing_disabled && q->type != Q_ENABLE_PARSING && q->type != Q_DISABLE_PARSING) q->type= Q_COMMENT; } DBUG_VOID_RETURN; } Loading Loading @@ -3963,6 +3980,17 @@ int main(int argc, char **argv) case Q_ENABLE_RECONNECT: cur_con->mysql.reconnect= 1; break; case Q_DISABLE_PARSING: parsing_disabled++; break; case Q_ENABLE_PARSING: /* Ensure we don't get parsing_disabled < 0 as this would accidently disable code we don't want to have disabled */ if (parsing_disabled > 0) parsing_disabled--; break; case Q_EXIT: abort_flag= 1; Loading
include/my_sys.h +1 −1 Original line number Diff line number Diff line Loading @@ -218,7 +218,7 @@ extern int errno; /* declare errno */ #endif /* #ifndef errno */ extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char *home_dir; /* Home directory for user */ extern char *my_progname; /* program-name (printed in errors) */ extern const char *my_progname; /* program-name (printed in errors) */ extern char NEAR curr_dir[]; /* Current directory for user */ extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); extern int (*fatal_error_handler_hook)(uint my_err, const char *str, Loading