Commit 40eb77b7 authored by unknown's avatar unknown

Bug#6925

  Comment/*COMMENT*/is not a separator
  Ensure that whitespace is inserted after C-style comment if required.


client/mysql.cc:
  Ensure that whitespace is inserted after C-style comment if required.
parent 1e871729
...@@ -1100,6 +1100,7 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -1100,6 +1100,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
uchar inchar; uchar inchar;
char buff[80], *pos, *out; char buff[80], *pos, *out;
COMMANDS *com; COMMANDS *com;
bool need_space= 0;
if (!line[0] && buffer.is_empty()) if (!line[0] && buffer.is_empty())
return 0; return 0;
...@@ -1208,6 +1209,7 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -1208,6 +1209,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
{ {
pos++; pos++;
*ml_comment= 0; *ml_comment= 0;
need_space= 1;
} }
else else
{ // Add found char to buffer { // Add found char to buffer
...@@ -1217,7 +1219,14 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -1217,7 +1219,14 @@ static bool add_line(String &buffer,char *line,char *in_string,
(inchar == '\'' || inchar == '"' || inchar == '`')) (inchar == '\'' || inchar == '"' || inchar == '`'))
*in_string= (char) inchar; *in_string= (char) inchar;
if (!*ml_comment) if (!*ml_comment)
{
if (need_space && !my_isspace(charset_info, (char)inchar))
{
*out++= ' ';
need_space= 0;
}
*out++= (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