Description:
The SOURCE command cannot be placed inside a version-specific comment. I can't find any other command that can't be put there. When I (incorrectly) follow the filename with a semicolon inside the comment, I get an extra error.
How to repeat:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.2.3-falcon-alpha MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql > /*!5000 SELECT VERSION() */;
+--------------------+
| VERSION() |
+--------------------+
| 5.2.3-falcon-alpha |
+--------------------+
1 row in set (0.00 sec)
mysql > /*!5000 SOURCE filename.sql */;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE filename.sql */' at line 1
mysql > /*!5000 SOURCE filename.sql; */;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE filename.sql' at line 1
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*/' at line 1
Suggested fix:
It seems to be a problem with the parser not knowing where the end of the filename is. Maybe something in sql_yacc.yy? I am not a yacc expert :)