Loading client/mysql.cc +8 −8 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ static int com_nopager(String *str, char*), com_pager(String *str, char*), com_edit(String *str,char*), com_shell(String *str, char *); #endif static int read_lines(bool execute_commands); static int read_and_execute(bool interactive); static int sql_connect(char *host,char *database,char *user,char *password, uint silent); static int put_info(const char *str,INFO_TYPE info,uint error=0, Loading Loading @@ -468,7 +468,7 @@ int main(int argc,char *argv[]) "Type 'help [[%]function name[%]]' to get help on usage of function.\n"); #endif put_info(buff,INFO_INFO); status.exit_status=read_lines(1); // read lines and execute them status.exit_status= read_and_execute(!status.batch); if (opt_outfile) end_tee(); mysql_end(0); Loading Loading @@ -957,7 +957,7 @@ static int get_options(int argc, char **argv) return(0); } static int read_lines(bool execute_commands) static int read_and_execute(bool interactive) { #if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) char linebuffer[254]; Loading @@ -972,7 +972,7 @@ static int read_lines(bool execute_commands) for (;;) { if (status.batch || !execute_commands) if (!interactive) { line=batch_readline(status.line_buff); line_number++; Loading Loading @@ -1050,7 +1050,7 @@ static int read_lines(bool execute_commands) Check if line is a mysql command line (We want to allow help, print and clear anywhere at line start */ if (execute_commands && (named_cmds || glob_buffer.is_empty()) if ((named_cmds || glob_buffer.is_empty()) && !in_string && (com=find_command(line,0))) { if ((*com->func)(&glob_buffer,line) > 0) Loading @@ -1058,7 +1058,7 @@ static int read_lines(bool execute_commands) if (glob_buffer.is_empty()) // If buffer was emptied in_string=0; #ifdef HAVE_READLINE if (status.add_to_history && not_in_history(line)) if (interactive && status.add_to_history && not_in_history(line)) add_history(line); #endif continue; Loading @@ -1068,7 +1068,7 @@ static int read_lines(bool execute_commands) } /* if in batch mode, send last query even if it doesn't end with \g or go */ if ((status.batch || !execute_commands) && !status.exit_status) if (!interactive && !status.exit_status) { remove_cntrl(glob_buffer); if (!glob_buffer.is_empty()) Loading Loading @@ -2783,7 +2783,7 @@ static int com_source(String *buffer, char *line) status.line_buff=line_buff; status.file_name=source_name; glob_buffer.length(0); // Empty command buffer error=read_lines(0); // Read lines from file error= read_and_execute(false); status=old_status; // Continue as before my_fclose(sql_file,MYF(0)); batch_readline_end(line_buff); Loading mysql-test/r/alter_table.result +4 −0 Original line number Diff line number Diff line Loading @@ -523,6 +523,10 @@ alter table t1 drop key no_such_key; ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists alter table t1 drop key a; drop table t1; CREATE TABLE T12207(a int) ENGINE=MYISAM; ALTER TABLE T12207 DISCARD TABLESPACE; ERROR HY000: Table storage engine for 'T12207' doesn't have this option DROP TABLE T12207; create table t1 (a text) character set koi8r; insert into t1 values (_koi8r''); select hex(a) from t1; Loading mysql-test/r/mysql.result +4 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,10 @@ a Test delimiter delimiter a 1 Tables_in_test t1 t2 t3 Test delimiter : from command line a Loading mysql-test/r/select.result +10 −0 Original line number Diff line number Diff line Loading @@ -2875,6 +2875,16 @@ b a t1_val t2_val 1 1 1 1 1 2 2 1 drop table t1, t2, t3; DO IFNULL(NULL, NULL); SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); CAST(IFNULL(NULL, NULL) AS DECIMAL) NULL SELECT ABS(IFNULL(NULL, NULL)); ABS(IFNULL(NULL, NULL)) NULL SELECT IFNULL(NULL, NULL); IFNULL(NULL, NULL) NULL create table t1 (a char(1)); create table t2 (a char(1)); insert into t1 values ('a'),('b'),('c'); Loading mysql-test/r/sp-error.result +8 −0 Original line number Diff line number Diff line Loading @@ -748,6 +748,14 @@ end| call bug11394(2, 1)| ERROR HY000: Recursive stored routines are not allowed. drop procedure bug11394| CREATE PROCEDURE BUG_12490() HELP CONTENTS; ERROR 0A000: HELP is not allowed in stored procedures CREATE FUNCTION BUG_12490() RETURNS INT HELP CONTENTS; ERROR 0A000: HELP is not allowed in stored procedures CREATE TABLE t_bug_12490(a int); CREATE TRIGGER BUG_12490 BEFORE UPDATE ON t_bug_12490 FOR EACH ROW HELP CONTENTS; ERROR 0A000: HELP is not allowed in stored procedures DROP TABLE t_bug_12490; drop function if exists bug11834_1; drop function if exists bug11834_2; create function bug11834_1() returns int return 10; Loading Loading
client/mysql.cc +8 −8 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ static int com_nopager(String *str, char*), com_pager(String *str, char*), com_edit(String *str,char*), com_shell(String *str, char *); #endif static int read_lines(bool execute_commands); static int read_and_execute(bool interactive); static int sql_connect(char *host,char *database,char *user,char *password, uint silent); static int put_info(const char *str,INFO_TYPE info,uint error=0, Loading Loading @@ -468,7 +468,7 @@ int main(int argc,char *argv[]) "Type 'help [[%]function name[%]]' to get help on usage of function.\n"); #endif put_info(buff,INFO_INFO); status.exit_status=read_lines(1); // read lines and execute them status.exit_status= read_and_execute(!status.batch); if (opt_outfile) end_tee(); mysql_end(0); Loading Loading @@ -957,7 +957,7 @@ static int get_options(int argc, char **argv) return(0); } static int read_lines(bool execute_commands) static int read_and_execute(bool interactive) { #if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) char linebuffer[254]; Loading @@ -972,7 +972,7 @@ static int read_lines(bool execute_commands) for (;;) { if (status.batch || !execute_commands) if (!interactive) { line=batch_readline(status.line_buff); line_number++; Loading Loading @@ -1050,7 +1050,7 @@ static int read_lines(bool execute_commands) Check if line is a mysql command line (We want to allow help, print and clear anywhere at line start */ if (execute_commands && (named_cmds || glob_buffer.is_empty()) if ((named_cmds || glob_buffer.is_empty()) && !in_string && (com=find_command(line,0))) { if ((*com->func)(&glob_buffer,line) > 0) Loading @@ -1058,7 +1058,7 @@ static int read_lines(bool execute_commands) if (glob_buffer.is_empty()) // If buffer was emptied in_string=0; #ifdef HAVE_READLINE if (status.add_to_history && not_in_history(line)) if (interactive && status.add_to_history && not_in_history(line)) add_history(line); #endif continue; Loading @@ -1068,7 +1068,7 @@ static int read_lines(bool execute_commands) } /* if in batch mode, send last query even if it doesn't end with \g or go */ if ((status.batch || !execute_commands) && !status.exit_status) if (!interactive && !status.exit_status) { remove_cntrl(glob_buffer); if (!glob_buffer.is_empty()) Loading Loading @@ -2783,7 +2783,7 @@ static int com_source(String *buffer, char *line) status.line_buff=line_buff; status.file_name=source_name; glob_buffer.length(0); // Empty command buffer error=read_lines(0); // Read lines from file error= read_and_execute(false); status=old_status; // Continue as before my_fclose(sql_file,MYF(0)); batch_readline_end(line_buff); Loading
mysql-test/r/alter_table.result +4 −0 Original line number Diff line number Diff line Loading @@ -523,6 +523,10 @@ alter table t1 drop key no_such_key; ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists alter table t1 drop key a; drop table t1; CREATE TABLE T12207(a int) ENGINE=MYISAM; ALTER TABLE T12207 DISCARD TABLESPACE; ERROR HY000: Table storage engine for 'T12207' doesn't have this option DROP TABLE T12207; create table t1 (a text) character set koi8r; insert into t1 values (_koi8r''); select hex(a) from t1; Loading
mysql-test/r/mysql.result +4 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,10 @@ a Test delimiter delimiter a 1 Tables_in_test t1 t2 t3 Test delimiter : from command line a Loading
mysql-test/r/select.result +10 −0 Original line number Diff line number Diff line Loading @@ -2875,6 +2875,16 @@ b a t1_val t2_val 1 1 1 1 1 2 2 1 drop table t1, t2, t3; DO IFNULL(NULL, NULL); SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); CAST(IFNULL(NULL, NULL) AS DECIMAL) NULL SELECT ABS(IFNULL(NULL, NULL)); ABS(IFNULL(NULL, NULL)) NULL SELECT IFNULL(NULL, NULL); IFNULL(NULL, NULL) NULL create table t1 (a char(1)); create table t2 (a char(1)); insert into t1 values ('a'),('b'),('c'); Loading
mysql-test/r/sp-error.result +8 −0 Original line number Diff line number Diff line Loading @@ -748,6 +748,14 @@ end| call bug11394(2, 1)| ERROR HY000: Recursive stored routines are not allowed. drop procedure bug11394| CREATE PROCEDURE BUG_12490() HELP CONTENTS; ERROR 0A000: HELP is not allowed in stored procedures CREATE FUNCTION BUG_12490() RETURNS INT HELP CONTENTS; ERROR 0A000: HELP is not allowed in stored procedures CREATE TABLE t_bug_12490(a int); CREATE TRIGGER BUG_12490 BEFORE UPDATE ON t_bug_12490 FOR EACH ROW HELP CONTENTS; ERROR 0A000: HELP is not allowed in stored procedures DROP TABLE t_bug_12490; drop function if exists bug11834_1; drop function if exists bug11834_2; create function bug11834_1() returns int return 10; Loading