I have a series of scripts for creating a schema, with a comment like the following before each instruction:
--------------------------------------------------------
-- Table TABLE_NAME
--------------------------------------------------------
When I execute the script from mysql on the command line, I get a bunch of errors like the following:
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
(actually, I get one error for each comment, in spite of the message always referring to line 1).
To quickly solve my problem I simply removed the comments and the script ran without problems, but I was surprised to see such a behaviour and to be unable to find a relevant question here on stackoverflow. Does anyone have an explanation? Did anyone ever observe such an odd behaviour?
I am running mysql 5.6.30, the default for 5.6 on ubuntu at this time.