MySQL转储注释指令和简单注释 [英] Mysql dump comments directives and simple comments

查看:109
本文介绍了MySQL转储注释指令和简单注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们计划使用Flyway来管理我们的迁移,因为它似乎是一个非常适合我们需求的好工具.今天我们拥有的是用于开发的MySQL数据库和用于生产周期的mysql-oracle DB.

We are planing to use Flyway to manage our migrations because it seams to be a great tool that could perfectly suit our needs. What we have today is MySQL databases for development, and mysql - oracle DB for production cycle.

如今,将Flyway与ant集成在一起似乎无法处理mysqldump注释指令中的简单注释.看起来像这样:

It seems impossible today with Flyway integrated with ant to deal with simple comments that are into mysqldump comments directives. It looks like this :

/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `lockObject`(
    IN parTypeId INTEGER,
    IN parObjectId INTEGER,
    IN parUserId INTEGER,
    IN parLockTime INTEGER,
    OUT parSuccess BOOLEAN,
    OUT parLockedOn INTEGER, /* time is elapsing from the beginning */
    OUT parErrUserId INTEGER)
BEGIN

    #proc declaration

END */;;

Flyway迁移返回以下错误

A Flyway migration return the following error

com.googlecode.flyway.core.api.FlywayException: Error executing statement at line 10807:    OUT parErrUserId INTEGER)
BEGIN
    DECLARE locTableName CHAR(50)
Caused by com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'OUT parErrUserId INTEGER)

是否有我想念的地方可以解决这个评论"嵌入问题?

Is there somewhere something I missed that could permit to deal with this "comment" imbrication issue ?

致谢

推荐答案

将注释放在新的一行上,您应该会很好.目前,Flyway的解析器在处理行尾注释和每行多个语句时遇到麻烦.

Put the comments on a new line and you should be good to go. Flyway's parser currently has trouble dealing with end of line comments and multiple statements per line.

我计划在2.2之前及时解决此问题.在此之前,请使用此替代方法.

I am plan on addressing this in time for 2.2. Until then, please use this workaround.

这篇关于MySQL转储注释指令和简单注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆