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

Merge neptunus.(none):/home/msvensson/mysql/same_tools/my41-same_tools

into  neptunus.(none):/home/msvensson/mysql/same_tools/my50-same_tools
parents bb688c08 bf120e18
......@@ -3578,17 +3578,15 @@ void scan_command_for_warnings(struct st_command *command)
/*
Check for unexpected "junk" after the end of query
This is normally caused by missing delimiters
This is normally caused by missing delimiters or when
switching between different delimiters
*/
void check_eol_junk(const char *eol)
void check_eol_junk_line(const char *line)
{
const char *p= eol;
DBUG_ENTER("check_eol_junk");
DBUG_PRINT("enter", ("eol: %s", eol));
/* Remove all spacing chars except new line */
while (*p && my_isspace(charset_info, *p) && (*p != '\n'))
p++;
const char *p= line;
DBUG_ENTER("check_eol_junk_line");
DBUG_PRINT("enter", ("line: %s", line));
/* Check for extra delimiter */
if (*p && !strncmp(p, delimiter, delimiter_length))
......@@ -3604,6 +3602,36 @@ void check_eol_junk(const char *eol)
DBUG_VOID_RETURN;
}
void check_eol_junk(const char *eol)
{
const char *p= eol;
DBUG_ENTER("check_eol_junk");
DBUG_PRINT("enter", ("eol: %s", eol));
/* Skip past all spacing chars and comments */
while (*p && (my_isspace(charset_info, *p) || *p == '#' || *p == '\n'))
{
/* Skip past comments started with # and ended with newline */
if (*p && *p == '#')
{
p++;
while (*p && *p != '\n')
p++;
}
/* Check this line */
if (*p && *p == '\n')
check_eol_junk_line(p);
if (*p)
p++;
}
check_eol_junk_line(p);
DBUG_VOID_RETURN;
}
/*
......
......@@ -2665,6 +2665,19 @@ sub do_before_run_mysqltest($)
{
mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
}
if ( $mysql_version_id < 50000 )
{
# Set envirnoment variable NDB_STATUS_OK to 1
# if script decided to run mysqltest cluster _is_ installed ok
$ENV{'NDB_STATUS_OK'} = "1";
}
elsif ( $mysql_version_id < 50100 )
{
# Set envirnoment variable NDB_STATUS_OK to YES
# if script decided to run mysqltest cluster _is_ installed ok
$ENV{'NDB_STATUS_OK'} = "YES";
}
}
sub do_after_run_mysqltest($)
......
......@@ -152,6 +152,23 @@ mysqltest: At line 1: Missing delimiter
mysqltest: At line 1: End of line junk detected: "sleep 7
# Another comment
"
mysqltest: At line 1: Missing delimiter
mysqltest: At line 1: Missing delimiter
mysqltest: At line 1: End of line junk detected: "disconnect default
#
# comment
# comment2
# comment 3
--disable_query_log
"
mysqltest: At line 1: End of line junk detected: "disconnect default # comment
# comment part2
# comment 3
--disable_query_log
"
mysqltest: At line 1: Extra delimiter ";" found
mysqltest: At line 1: Extra delimiter ";" found
mysqltest: At line 1: Missing argument(s) to 'error'
......
......@@ -359,18 +359,80 @@ select 3 from t1 ;
# Missing delimiter
# The comment will be "sucked into" the sleep command since
# delimiter is missing until after "show status"
--system echo "sleep 4" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "# A comment" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "show status;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
sleep 4
# A comment
show status;
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
#
# Missing delimiter until eof
# The comment will be "sucked into" the sleep command since
# delimiter is missing
--system echo "sleep 7" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
--system echo "# Another comment" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
# delimiter is missing
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
sleep 7
# Another comment
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
#
# Missing delimiter until "disable_query_log"
#
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
disconnect default
#
# comment
# comment 3
disable_query_log;
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
#
# Missing delimiter until "disable_query_log"
#
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
disconnect default
#
# comment
# comment 3
disable_query_log;
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
#
# Missing delimiter until eof
#
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
disconnect default
#
# comment
# comment2
# comment 3
--disable_query_log
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
#
# Missing delimiter until eof
#
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
disconnect default # comment
# comment part2
# comment 3
--disable_query_log
EOF
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
......
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