Commit 9671d8ce authored by Georgi Kodinov's avatar Georgi Kodinov

merged bug 31060 to 5.1-bugteam

parents 3d31b8ee 71c6be54
......@@ -2245,8 +2245,22 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
if (out != line || !buffer.is_empty())
{
*out++='\n';
uint length=(uint) (out-line);
if (length < 9 ||
my_strnncoll (charset_info,
(uchar *)line, 9, (const uchar *) "delimiter", 9))
{
/*
Don't add a new line in case there's a DELIMITER command to be
added to the glob buffer (e.g. on processing a line like
"<command>;DELIMITER <non-eof>") : similar to how a new line is
not added in the case when the DELIMITER is the first command
entered with an empty glob buffer.
*/
*out++='\n';
length++;
}
if (buffer.length() + length >= buffer.alloced_length())
buffer.realloc(buffer.length()+length+IO_SIZE);
if ((!*ml_comment || preserve_comments) && buffer.append(line, length))
......
......@@ -188,6 +188,10 @@ delimiter
2
@z:='1' @z=database()
1 NULL
1
1
1
1
End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
Warning (Code 1286): Unknown table engine 'nonexistent'
......
......@@ -315,6 +315,23 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug38158.sql;
#
--exec $MYSQL -e "select @z:='1',@z=database()"
#
# Bug #31060: MySQL CLI parser bug 2
#
--write_file $MYSQLTEST_VARDIR/tmp/bug31060.sql
;DELIMITER DELIMITER
;
SELECT 1DELIMITER
DELIMITER ;
SELECT 1;
EOF
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug31060.sql 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/bug31060.sql;
--echo End of 5.0 tests
#
......
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