Bug #15015 -- Comments doen't work in a stored procedure (syntax error)
Submitted: 17 Nov 2005 13:01 Modified: 17 Nov 2005 17:08
Reporter: Arnold Greving Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.15 OS:Linux (Debian sid)
Assigned to: CPU Architecture:Any

[17 Nov 2005 13:01] Arnold Greving
Description:
When you type "-- A comment" in your client it is conciderd a comment. Do the same thing in a stored procedure and you get a syntax error.

How to repeat:
-- A comment

drop procedure if exists foo;
delimiter //
create procedure foo()
begin
    -- A comment
end
//
delimiter ;
[17 Nov 2005 17:08] Valeriy Kravchuk
Thank you for a problem report. Sorry, but I was not able to repeat it neither on 5.0.15-nt, nor on newer 5.0.17-BK on Linux:

mysql> use test;
Database changed
mysql> drop procedure if exists foo;
Query OK, 0 rows affected, 1 warning (0.11 sec)

mysql> delimiter //
mysql> create procedure foo()
    -> begin
    ->     -- A comment
    -> end
    -> //
Query OK, 0 rows affected (0.06 sec)

mysql> delimiter ;
mysql> call foo();
Query OK, 0 rows affected (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.0.15-nt |
+-----------+
1 row in set (0.02 sec)

Now on Linux:

mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> drop procedure if exists foo;
Query OK, 0 rows affected, 1 warning (0,00 sec)

mysql> delimiter //
mysql> create procedure foo()
    -> begin
    ->     -- A comment
    -> end
    -> //
Query OK, 0 rows affected (0,02 sec)

mysql> delimiter ;
mysql> call foo();
Query OK, 0 rows affected (0,00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.0.17    |
+-----------+
1 row in set (0,00 sec)