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

UTF-8 BOM stripping no longer works in 6.0.0-beta2 #2413

rglidden opened this issue Jun 17, 2019 · 1 comment

UTF-8 BOM stripping no longer works in 6.0.0-beta2 #2413

rglidden opened this issue Jun 17, 2019 · 1 comment


Copy link

@rglidden rglidden commented Jun 17, 2019

Which version and edition of Flyway are you using?

Flyway Community Edition 6.0.0-beta2 by Boxfuse

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)

Issue occurs on 6.0.0-beta2. Does not occur in Flyway 5.2.4

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)


Which database are you using (type & version)?

Microsoft SQL Server 2017 Developer Edition
Version: 14.0.3037.1

Which operating system are you using?

Windows 10, 1903

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)

Create a simple migration with valid SQL Server syntax. Save the migration in "UTF-8 with BOM" encoding. Run "flyway migrate"

What did you expect to see?

Migrations succesfully applied.

What did you see instead?

On a clean database, applying the migrations via Flyway 6.0.0-beta2, I get:

ERROR: Migration of schema [dbo] to version - FlywayTest failed! Changes successfully rolled back.                                                                       
Migration V0.0.0_3__FlywayTest.sql failed                                                                                                                                        
SQL State  : S0001                                                                                                                                                               
Error Code : 102                                                                                                                                                                 
Message    : Incorrect syntax near '?'.                                                                                                                                          
Location   : Operational\baseline\10.10.0\Framework\V0.0.0_3__FlywayTest.sql (C:\git\SmartSuite\Database\Flyway\Operational\baseline\10.10.0\Framework\V0.0.0_3__FlywayTest.sql) 
Line       : 1                                                                                                                                                                   
Statement  : ?CREATE OR ALTER PROCEDURE [dbo].[Test]                                                                                                                             
        SELECT GETUTCDATE();                                                                                                                                                     

On an existing database that has been previously migrated with Flyway 5.2.4, I get the following, even though the migration scripts themselves have not changed:

ERROR: Validate failed: Migration checksum mismatch for migration version
-> Applied to database : -328909794
-> Resolved locally    : 942418599

It looks like the BOM stripping is not working properly in 6.0.0-beta2

@axelfontaine axelfontaine added this to the Flyway 6.0.0 milestone Jun 18, 2019
axelfontaine pushed a commit to flyway/ that referenced this issue Jun 18, 2019
Copy link

@axelfontaine axelfontaine commented Jun 18, 2019

Thanks for the detailed report and analysis. This indeed broke when we moved to the new parser. Fixed.


dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants