summaryrefslogtreecommitdiff
path: root/client/mysql.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-02-28 18:42:49 +0100
committerSergei Golubchik <sergii@pisem.net>2013-02-28 18:42:49 +0100
commit8161c6772d144d6a4f08fc924ff6e6e403d1371d (patch)
tree3f1fe5f8048a163da4eadf0f86c1fd2a3007955d /client/mysql.cc
parent154aac8eb002f5d167153e09f1d13570989521e0 (diff)
parent31c06437c970d4d0f4ec0301acac9c56e0ed29b5 (diff)
downloadmariadb-git-8161c6772d144d6a4f08fc924ff6e6e403d1371d.tar.gz
merge with mysql-5.5.30 minus few incorrect or not applicable changesets
Diffstat (limited to 'client/mysql.cc')
-rw-r--r--client/mysql.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 70c0815ea76..ad792abc23f 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2312,17 +2312,19 @@ static bool add_line(String &buffer,char *line,char *in_string,
{
uint length=(uint) (out-line);
- if (!truncated &&
- (length < 9 ||
- my_strnncoll (charset_info,
- (uchar *)line, 9, (const uchar *) "delimiter", 9)))
+ if (!truncated && (length < 9 ||
+ my_strnncoll (charset_info, (uchar *)line, 9,
+ (const uchar *) "delimiter", 9) ||
+ (*in_string || *ml_comment)))
{
/*
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.
+ entered with an empty glob buffer. However, if the delimiter is
+ part of a string or a comment, the new line should be added. (e.g.
+ SELECT '\ndelimiter\n';\n)
*/
*out++='\n';
length++;