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 multi-line comment directives not recognised #640

Closed
daveoflynn opened this issue Nov 7, 2013 · 1 comment
Closed

MySQL multi-line comment directives not recognised #640

daveoflynn opened this issue Nov 7, 2013 · 1 comment
Labels

Comments

@daveoflynn
Copy link
Contributor

@daveoflynn daveoflynn commented Nov 7, 2013

Flyway does handle multi-line comment directives of the form:

/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`user`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `viewname` AS select `t`.`id` AS `someId`,`t`.`name` AS `someName` from `someTable` `t` where `t`.`state` = 0 */;

However, the following is a valid extract from a mysql dump:

-- MySQL dump 10.13  Distrib 5.5.16, for Win32 (x86)
--
-- Host: 127.0.0.1    Database: badgers
-- ------------------------------------------------------
-- Server version   5.1.61

/*!50001 CREATE TABLE `badger` (
  `id` int(11) unsigned,
  `badger_type` int(11) unsigned
) ENGINE=MyISAM */;

It is not recognised as being a comment directive, as the code in SqlScript.java assumes that a comment directive will be contained on one line:

if (!sqlStatementBuilder.isCommentDirective(trimmedLine)) {

This is somewhat related to #558.

daveoflynn added a commit to daveoflynn/flyway that referenced this issue Nov 7, 2013
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Dec 14, 2013

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.