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

Open
kongslund opened this Issue Jul 21, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@kongslund

kongslund commented Jul 21, 2013

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

This comment has been minimized.

Contributor

axelfontaine commented Jul 25, 2013

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

This comment has been minimized.

Contributor

axelfontaine commented Apr 15, 2014

I will document a limitation and revisit this for 3.1

@axelfontaine

This comment has been minimized.

Contributor

axelfontaine commented Oct 28, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment