Commit 54fe4c54 authored by unknown's avatar unknown

mysql should ignore ' " ` symbols inside comments (Bug #539).

parent a1f92f0d
...@@ -1085,7 +1085,7 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -1085,7 +1085,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
out=line; out=line;
} }
} }
else if (*ml_comment && !*in_string && inchar == '*' && *(pos+1) == '/') else if (*ml_comment && inchar == '*' && *(pos + 1) == '/')
{ {
pos++; pos++;
*ml_comment= 0; *ml_comment= 0;
...@@ -1093,11 +1093,13 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -1093,11 +1093,13 @@ static bool add_line(String &buffer,char *line,char *in_string,
else else
{ // Add found char to buffer { // Add found char to buffer
if (inchar == *in_string) if (inchar == *in_string)
*in_string=0; *in_string= 0;
else if (!*in_string && (inchar == '\'' || inchar == '"' || inchar == '`')) else if (!*ml_comment)
*in_string=(char) inchar; {
if (!(*ml_comment)) if (!*in_string && (inchar == '\'' || inchar == '"' || inchar == '`'))
*out++ = (char) inchar; *in_string= (char) inchar;
*out++= (char) inchar;
}
} }
} }
if (out != line || !buffer.is_empty()) if (out != line || !buffer.is_empty())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment