mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge neptunus.(none):/home/msvensson/mysql/same_tools/my41-same_tools
into neptunus.(none):/home/msvensson/mysql/same_tools/my50-same_tools client/mysqltest.c: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/mysqltest.result: Auto merged
This commit is contained in:
@@ -3578,17 +3578,15 @@ void scan_command_for_warnings(struct st_command *command)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Check for unexpected "junk" after the end of query
|
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;
|
const char *p= line;
|
||||||
DBUG_ENTER("check_eol_junk");
|
DBUG_ENTER("check_eol_junk_line");
|
||||||
DBUG_PRINT("enter", ("eol: %s", eol));
|
DBUG_PRINT("enter", ("line: %s", line));
|
||||||
/* Remove all spacing chars except new line */
|
|
||||||
while (*p && my_isspace(charset_info, *p) && (*p != '\n'))
|
|
||||||
p++;
|
|
||||||
|
|
||||||
/* Check for extra delimiter */
|
/* Check for extra delimiter */
|
||||||
if (*p && !strncmp(p, delimiter, delimiter_length))
|
if (*p && !strncmp(p, delimiter, delimiter_length))
|
||||||
@@ -3604,6 +3602,36 @@ void check_eol_junk(const char *eol)
|
|||||||
DBUG_VOID_RETURN;
|
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");
|
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($)
|
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
|
mysqltest: At line 1: End of line junk detected: "sleep 7
|
||||||
# Another comment
|
# 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: Extra delimiter ";" found
|
mysqltest: At line 1: Extra delimiter ";" found
|
||||||
mysqltest: At line 1: Missing argument(s) to 'error'
|
mysqltest: At line 1: Missing argument(s) to 'error'
|
||||||
|
@@ -359,18 +359,80 @@ 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" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
|
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
|
||||||
--system echo "# A comment" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
|
sleep 4
|
||||||
--system echo "show status;" >> $MYSQLTEST_VARDIR/tmp/mysqltest.sql
|
# A comment
|
||||||
|
show status;
|
||||||
|
EOF
|
||||||
--error 1
|
--error 1
|
||||||
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
|
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
|
||||||
|
|
||||||
#
|
#
|
||||||
# Missing delimiter until eof
|
# Missing delimiter until eof
|
||||||
# The comment will be "sucked into" the sleep command since
|
# The comment will be "sucked into" the sleep command since
|
||||||
# delimiter is missing
|
# delimiter is missing
|
||||||
--system echo "sleep 7" > $MYSQLTEST_VARDIR/tmp/mysqltest.sql
|
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
|
||||||
--system echo "# Another comment" >> $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
|
--error 1
|
||||||
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
|
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user