summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorGeorgi Kodinov <kgeorge@mysql.com>2008-07-18 15:00:45 +0300
committerGeorgi Kodinov <kgeorge@mysql.com>2008-07-18 15:00:45 +0300
commit5f5a3cf1aa6738a68ecde36dc25f696b0f25c827 (patch)
treea42a867611895fc20c8b0c1573e95ade5239651a /client
parent516312dda6fedb268e28bcc233f62da5591c9fed (diff)
parent88d66418c8fb2fbd6b60968d1ad8962b2af56232 (diff)
downloadmariadb-git-5f5a3cf1aa6738a68ecde36dc25f696b0f25c827.tar.gz
merge of 38158 to 5.1-bugteam
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 73e8973c097..024194d81f6 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2101,6 +2101,37 @@ static bool add_line(String &buffer,char *line,char *in_string,
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))
{
// Found a statement. Continue parsing after the delimiter