summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2008-06-24 21:15:00 +0500
committerGleb Shchepa <gshchepa@mysql.com>2008-06-24 21:15:00 +0500
commitf3978f77cb0cc752d9d46d186f82c764c00543e5 (patch)
tree860f435cce39e3678c2f89552c50981e6535924f /client
parent12846f416ea649aaeb13d541db7b40cdf7e70e52 (diff)
parent748a9b1a4b0e130afd25df0613f9334a9293e607 (diff)
downloadmariadb-git-f3978f77cb0cc752d9d46d186f82c764c00543e5.tar.gz
auto merge 5.0-bugteam --> 5.1-bugteam
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc42
1 files changed, 9 insertions, 33 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 234180c3c75..73e8973c097 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1821,7 +1821,7 @@ static int read_and_execute(bool interactive)
the very beginning of a text file when
you save the file using "Unicode UTF-8" format.
*/
- if (!line_number &&
+ if (line && !line_number &&
(uchar) line[0] == 0xEF &&
(uchar) line[1] == 0xBB &&
(uchar) line[2] == 0xBF)
@@ -2101,37 +2101,6 @@ 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
@@ -2176,7 +2145,14 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
else if (!*ml_comment && (!*in_string && (inchar == '#' ||
inchar == '-' && pos[1] == '-' &&
- my_isspace(charset_info,pos[2]))))
+ /*
+ The third byte is either whitespace or is the
+ end of the line -- which would occur only
+ because of the user sending newline -- which is
+ itself whitespace and should also match.
+ */
+ (my_isspace(charset_info,pos[2]) ||
+ !pos[2]))))
{
// Flush previously accepted characters
if (out != line)