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

flyway fails recognizing sql server delimiter while parsing sql migration #678

Closed
lrozek opened this issue Jan 16, 2014 · 3 comments
Closed

Comments

@lrozek
Copy link
Contributor

lrozek commented Jan 16, 2014

I will submit a repro project in a minute

@lrozek
Copy link
Contributor Author

lrozek commented Jan 16, 2014

repro project: https://github.com/lrozek/flyway-678
tested with SQL Server 2012

The problem is in 4th line of 2nd migration script. Problematic part is {ts '3099-01-01 00:00:00'}, which causes SqlStatementBuilder.extractStringLiteralDelimitingTokens() to incorrectly parse 4th line. As result internal state of SQLServerSqlStatementBuilder indicates that it is in "insideQuoteStringLiteral", which in the end fails at recognizing 'GO' delimiter.

2nd migration script is executed as single JDBC statement. But it should correctly recognize delimiter and run "CREATE TRIGGER" sql statements in two separate JDBC statements

@jonbom
Copy link

jonbom commented Mar 10, 2014

Have same problem with following script:
CREATE Procedure myProcedure
As
SELECT myTableID+'.jpg' url
from myTable
return 0
go
grant execute on myProcedure to public
go

Need to include plus(+)-sign in the tokenizer...

@axelfontaine axelfontaine added this to the Flyway 3.0 milestone Mar 11, 2014
@axelfontaine
Copy link
Contributor

Thank you for submitting this and isolating it in the repro project. It was immensely helpful in fixing it.

Cheers
Axel

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

3 participants