mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
Bug#33812: mysql client incorrectly parsing DELIMITER
Revert fix for this bug as it introduced a regression reported in Bug#38158.
This commit is contained in:
parent
16a961d026
commit
5da0c9ae6a
3 changed files with 31 additions and 8 deletions
|
@ -2081,6 +2081,37 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!*ml_comment && !*in_string &&
|
||||||
|
(end_of_line - pos) >= 10 &&
|
||||||
|
!my_strnncoll(charset_info, (uchar*) pos, 10,
|
||||||
|
(const uchar*) "delimiter ", 10))
|
||||||
|
{
|
||||||
|
// Flush previously accepted characters
|
||||||
|
if (out != line)
|
||||||
|
{
|
||||||
|
buffer.append(line, (uint32) (out - line));
|
||||||
|
out= line;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Flush possible comments in the buffer
|
||||||
|
if (!buffer.is_empty())
|
||||||
|
{
|
||||||
|
if (com_go(&buffer, 0) > 0) // < 0 is not fatal
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
buffer.length(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Delimiter wants the get rest of the given line as argument to
|
||||||
|
allow one to change ';' to ';;' and back
|
||||||
|
*/
|
||||||
|
buffer.append(pos);
|
||||||
|
if (com_delimiter(&buffer, pos) > 0)
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
|
||||||
|
buffer.length(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
|
else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
|
||||||
{
|
{
|
||||||
// Found a statement. Continue parsing after the delimiter
|
// Found a statement. Continue parsing after the delimiter
|
||||||
|
|
|
@ -38,8 +38,6 @@ t2
|
||||||
t3
|
t3
|
||||||
Tables_in_test
|
Tables_in_test
|
||||||
t1
|
t1
|
||||||
delimiter
|
|
||||||
1
|
|
||||||
_
|
_
|
||||||
Test delimiter : from command line
|
Test delimiter : from command line
|
||||||
a
|
a
|
||||||
|
|
|
@ -60,12 +60,6 @@ use test//
|
||||||
show tables//
|
show tables//
|
||||||
delimiter ; # Reset delimiter
|
delimiter ; # Reset delimiter
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #33812: mysql client incorrectly parsing DELIMITER
|
|
||||||
#
|
|
||||||
select a as delimiter from t1
|
|
||||||
delimiter ; # Reset delimiter
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug #36244: MySQL CLI doesn't recognize standalone -- as comment
|
# Bug #36244: MySQL CLI doesn't recognize standalone -- as comment
|
||||||
# before DELIMITER statement
|
# before DELIMITER statement
|
||||||
|
|
Loading…
Reference in a new issue