summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <ram@mysql.r18.ru>2003-07-15 14:38:48 +0500
committerunknown <ram@mysql.r18.ru>2003-07-15 14:38:48 +0500
commitf97f8b1d05de11a8db282e7976ccf9d329288d4c (patch)
tree56648217a55376404fcc5fb0d784b544f3b53ea1 /client
parent22a77b1443b48ff2375f999378f5df97b5b0e58d (diff)
downloadmariadb-git-f97f8b1d05de11a8db282e7976ccf9d329288d4c.tar.gz
mysql should ignore ' " ` symbols inside comments (Bug #539).
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 45b0e4bf2ea..4c07c1bbab7 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1085,7 +1085,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
out=line;
}
}
- else if (*ml_comment && !*in_string && inchar == '*' && *(pos+1) == '/')
+ else if (*ml_comment && inchar == '*' && *(pos + 1) == '/')
{
pos++;
*ml_comment= 0;
@@ -1093,11 +1093,13 @@ static bool add_line(String &buffer,char *line,char *in_string,
else
{ // Add found char to buffer
if (inchar == *in_string)
- *in_string=0;
- else if (!*in_string && (inchar == '\'' || inchar == '"' || inchar == '`'))
- *in_string=(char) inchar;
- if (!(*ml_comment))
- *out++ = (char) inchar;
+ *in_string= 0;
+ else if (!*ml_comment)
+ {
+ if (!*in_string && (inchar == '\'' || inchar == '"' || inchar == '`'))
+ *in_string= (char) inchar;
+ *out++= (char) inchar;
+ }
}
}
if (out != line || !buffer.is_empty())