summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2008-06-24 19:32:06 +0500
committerGleb Shchepa <gshchepa@mysql.com>2008-06-24 19:32:06 +0500
commit6eb2e76abdbf903d6b3848961f942c7d41d640a0 (patch)
tree2c3627f00a3b2c68aab68c9a06faf55695b2dca7
parent2356d4f54ae3d360ec469be9d5dbc1c7e807a1f3 (diff)
downloadmariadb-git-6eb2e76abdbf903d6b3848961f942c7d41d640a0.tar.gz
Bug #36244: MySQL CLI doesn't recognize standalone --
as a commentary mysql client has been modified to interpret EOL after standalone -- commentary strings like whitespace character (according to http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html) mysql-test/t/mysql_delimiter.sql: Added test case for bug #36244.
-rw-r--r--client/mysql.cc9
-rw-r--r--mysql-test/t/mysql_delimiter.sql7
2 files changed, 15 insertions, 1 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index a4706a1c580..5348941b92f 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2156,7 +2156,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)
diff --git a/mysql-test/t/mysql_delimiter.sql b/mysql-test/t/mysql_delimiter.sql
index db679c3b06b..533ac2ce093 100644
--- a/mysql-test/t/mysql_delimiter.sql
+++ b/mysql-test/t/mysql_delimiter.sql
@@ -59,3 +59,10 @@ source t/mysql_delimiter_19799.sql
use test//
show tables//
delimiter ; # Reset delimiter
+
+#
+# Bug #36244: MySQL CLI doesn't recognize standalone -- as comment
+# before DELIMITER statement
+#
+--
+DELIMITER ;