Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL statement not recognized due to multiple comment directives on a single line #558

Closed
kongslund opened this issue Jul 21, 2013 · 4 comments

Comments

@kongslund
Copy link

Using Flyway version 2.2 I discovered an issue with merging an initial MySQL dump of an existing database schema.

Flyway does not recognize the following as a statement:

/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER EntityBeforeInsert BEFORE INSERT 
ON Entity FOR EACH ROW 
BEGIN
    ...
END */;;

If I separate the comment directives by a newline such as in the following example then Flyway recognizes the statement:

/*!50003 CREATE*/
/*!50017 DEFINER=`root`@`localhost`*/
/*!50003 TRIGGER EntityBeforeInsert BEFORE INSERT 
ON Entity FOR EACH ROW 
BEGIN
    ...
END */;;

The troublesome SQL snippet was added by the mysqldump tool.

@axelfontaine
Copy link
Contributor

Thanks for reporting this. This is partly due to the parser not being able to deal with multiple statements per line at this point. I plan on revisiting it at some point in the near future to address this.

@axelfontaine
Copy link
Contributor

I will document a limitation and revisit this for 3.1

@axelfontaine
Copy link
Contributor

Limitation is in the docs: http://flywaydb.org/documentation/database/mysql.html

@axelfontaine axelfontaine modified the milestones: Flyway 5.0, Flyway 4.1 Feb 6, 2017
@axelfontaine
Copy link
Contributor

Fixed. At last!

axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants