Commit 7f91ddcd authored by msvensson@neptunus.(none)'s avatar msvensson@neptunus.(none)

Merge bk-internal.mysql.com:/home/bk/mysql-4.1

into  neptunus.(none):/home/msvensson/mysql/mysql-4.1
parents 6a5f0070 4cfd08d1
...@@ -2169,8 +2169,10 @@ int read_line(char *buf, int size) ...@@ -2169,8 +2169,10 @@ int read_line(char *buf, int size)
if (feof(cur_file->file)) if (feof(cur_file->file))
{ {
found_eof: found_eof:
if (cur_file->file != stdin) if (cur_file->file != stdin){
my_fclose(cur_file->file, MYF(0)); my_fclose(cur_file->file, MYF(0));
cur_file->file= 0;
}
my_free((gptr)cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR)); my_free((gptr)cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
cur_file->file_name= 0; cur_file->file_name= 0;
lineno--; lineno--;
...@@ -2556,10 +2558,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -2556,10 +2558,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
argument= buff; argument= buff;
} }
fn_format(buff, argument, "", "", 4); fn_format(buff, argument, "", "", 4);
DBUG_ASSERT(cur_file->file == 0); DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
if (!(cur_file->file= if (!(cur_file->file=
my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME)))) my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME))))
die("Could not open %s: errno = %d", argument, errno); die("Could not open %s: errno = %d", buff, errno);
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
break; break;
} }
case 'm': case 'm':
...@@ -3746,9 +3749,8 @@ int main(int argc, char **argv) ...@@ -3746,9 +3749,8 @@ int main(int argc, char **argv)
embedded_server_args, embedded_server_args,
(char**) embedded_server_groups)) (char**) embedded_server_groups))
die("Can't initialize MySQL server"); die("Can't initialize MySQL server");
if (cur_file == file_stack) if (cur_file == file_stack && cur_file->file == 0)
{ {
DBUG_ASSERT(cur_file->file == 0);
cur_file->file= stdin; cur_file->file= stdin;
cur_file->file_name= my_strdup("<stdin>", MYF(MY_WME)); cur_file->file_name= my_strdup("<stdin>", MYF(MY_WME));
} }
......
echo Output from mysqltest-x.inc;
...@@ -179,7 +179,6 @@ source database ...@@ -179,7 +179,6 @@ source database
echo message echo message echo message echo message
mysqltest: At line 1: Empty variable mysqltest: At line 1: Empty variable
mysqltest: At line 1: command "';' 2> /dev/null" failed
mysqltest: At line 1: Missing argument in exec mysqltest: At line 1: Missing argument in exec
MySQL MySQL
"MySQL" "MySQL"
...@@ -301,7 +300,6 @@ mysqltest: At line 1: First argument to dec must be a variable (start with $) ...@@ -301,7 +300,6 @@ mysqltest: At line 1: First argument to dec must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: End of line junk detected: "1000"
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: system command 'NonExistsinfComamdn 2> /dev/null' failed
test test
test2 test2
test3 test3
......
...@@ -358,8 +358,11 @@ select 3 from t1 ; ...@@ -358,8 +358,11 @@ select 3 from t1 ;
# Missing delimiter # Missing delimiter
# The comment will be "sucked into" the sleep command since # The comment will be "sucked into" the sleep command since
# delimiter is missing until after "show status" # delimiter is missing until after "show status"
--system echo "sleep 4" > var/log/mysqltest.sql
--system echo "# A comment" >> var/log/mysqltest.sql
--system echo "show status;" >> var/log/mysqltest.sql
--error 1 --error 1
--exec echo -e "sleep 4\n # A comment\nshow status;" | $MYSQL_TEST 2>&1 --exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1
# #
# Extra delimiter # Extra delimiter
...@@ -423,8 +426,9 @@ echo ; ...@@ -423,8 +426,9 @@ echo ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Illegal use of exec # Illegal use of exec
--error 1 # Disabled, some shells prints the failed command regardless of pipes
--exec echo "--exec ';' 2> /dev/null" | $MYSQL_TEST 2>&1 #--error 1
#--exec echo "--exec ';' 2> /dev/null" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "--exec " | $MYSQL_TEST 2>&1 --exec echo "--exec " | $MYSQL_TEST 2>&1
...@@ -671,8 +675,9 @@ system echo "hej" > /dev/null; ...@@ -671,8 +675,9 @@ system echo "hej" > /dev/null;
--exec echo "system;" | $MYSQL_TEST 2>&1 --exec echo "system;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1 --exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
--error 1 # Disabled, some shells prints the failed command regardless of pipes
--exec echo "system NonExistsinfComamdn 2> /dev/null;" | $MYSQL_TEST 2>&1 #--error 1
#--exec echo "system NonExistsinfComamdn 2> /dev/null;" | $MYSQL_TEST 2>&1
--disable_abort_on_error --disable_abort_on_error
system NonExistsinfComamdn; system NonExistsinfComamdn;
...@@ -722,12 +727,21 @@ while ($i) ...@@ -722,12 +727,21 @@ while ($i)
--exec echo "end;" | $MYSQL_TEST 2>&1 --exec echo "end;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "{;" | $MYSQL_TEST 2>&1 --exec echo "{;" | $MYSQL_TEST 2>&1
--system echo "while (0)" > var/log/mysqltest.sql
--system echo "echo hej;" >> var/log/mysqltest.sql
--error 1 --error 1
--exec echo -e "while (0)\necho hej;" | $MYSQL_TEST 2>&1 --exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1
--system echo "while (0)" > var/log/mysqltest.sql
--system echo "{echo hej;" >> var/log/mysqltest.sql
--error 1 --error 1
--exec echo -e "while (0)\n{echo hej;" | $MYSQL_TEST 2>&1 --exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1
--system echo "while (0){" > var/log/mysqltest.sql
--system echo "echo hej;" >> var/log/mysqltest.sql
--error 1 --error 1
--exec echo -e "while (0){\n echo hej;" | $MYSQL_TEST 2>&1 --exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test error messages returned from comments starting with a command # Test error messages returned from comments starting with a command
...@@ -792,6 +806,19 @@ select "a" as col1, "c" as col2; ...@@ -792,6 +806,19 @@ select "a" as col1, "c" as col2;
--error 1 --error 1
--exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1 --exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test mysqltest arguments
# ----------------------------------------------------------------------------
# -x <file_name>, use the file specified after -x as the test file
#--exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
#--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
#--exec $MYSQL_TEST --result_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
#--error 1
#--exec $MYSQL_TEST -x non_existing_file.inc 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# TODO Test queries, especially their errormessages... so it's easy to debug # TODO Test queries, especially their errormessages... so it's easy to debug
# new scripts and diagnose errors # new scripts and diagnose errors
......
...@@ -20,22 +20,22 @@ connect (con4,localhost,ssl_user4,,); ...@@ -20,22 +20,22 @@ connect (con4,localhost,ssl_user4,,);
connection con1; connection con1;
select * from t1; select * from t1;
--error 1044; --error 1044
delete from t1; delete from t1;
connection con2; connection con2;
select * from t1; select * from t1;
--error 1044; --error 1044
delete from t1; delete from t1;
connection con3; connection con3;
select * from t1; select * from t1;
--error 1044; --error 1044
delete from t1; delete from t1;
connection con4; connection con4;
select * from t1; select * from t1;
--error 1044; --error 1044
delete from t1; delete from t1;
connection default; connection default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment