List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 21 2003 5:34pm
Subject:Re: Suggested Addition to MySQL Reference Manual
View as plain text  
At 18:12 +0100 3/21/03, Stefan Hinz wrote:
>David,
>
>>  I would like to suggest that a third condition be included in this list. It
>>  seems that either of the other 2 comment characters, *  --  * or 
>>*  #  *  are
>>  also recognized by the parser within /*  ...  */.
>
>"-- " means "comment to the end of the line". So,
>
>SELECT "Hello" /* This is a comment -- This one, too */, "World";
>
>Will _not_ output "HelloWorld", but rather "Hello". In the mysql
>client program, you will also have to enter a semicolon on the next
>line, because the semicolon at the end of the line is part of the
>"-- " comment:
>
>mysql> SELECT "Hello" /* This is a comment -- This one, too */, "World";
>     -> ;
>+-------+
>| Hello |
>+-------+
>| Hello |
>+-------+
>1 row in set (0.00 sec)
>
>This is a lengthy answer for saying "It's documented behaviour" :)

Note that in MySQL 4.1 the mysql parser has been fixed so that
weird characters or comment sequences within /* ... */ are (properly)
treated as part of the comment.

>
>Regards,
>--
>   Stefan Hinz <hinz@stripped>
>   iConnect GmbH <http://iConnect.de>
>   Heesestr. 6, 12169 Berlin (Germany)
>   Telefon: +49 30 7970948-0  Fax: +49 30 7970948-3
>
>[filter fodder: sql, mysql, query]


-- 
Paul DuBois
http://www.kitebird.com/
sql, query
Thread
Suggested Addition to MySQL Reference Manualdpgirago21 Mar
  • Re: Suggested Addition to MySQL Reference ManualStefan Hinz21 Mar
    • Re: Suggested Addition to MySQL Reference ManualPaul DuBois21 Mar