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

Parse error using MySQL 8 since flyway 6.3 #2796

Closed
marc-mabe opened this issue Apr 30, 2020 · 1 comment
Closed

Parse error using MySQL 8 since flyway 6.3 #2796

marc-mabe opened this issue Apr 30, 2020 · 1 comment

Comments

@marc-mabe
Copy link

marc-mabe commented Apr 30, 2020

Which version and edition of Flyway are you using?

Tested with flyway 6.2.4 (works), 6.3.3 (fails) and 6.4.0 (fails)

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)

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

CLI on docker

Which database are you using (type & version)?

MySQL 8

Which operating system are you using?

Linux / Mac

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.)

-- Schedule deletion of expired and otherwise invalid tokens
DELIMITER ;;

CREATE PROCEDURE `rmInvalidTokens` ()
BEGIN
    DELETE OAuth2AccessToken FROM OAuth2AccessToken
    INNER JOIN OAuth2Client ON (OAuth2AccessToken.clientId = OAuth2Client.id)
    WHERE OAuth2Client.revoked = 1
       OR OAuth2AccessToken.expires < NOW();

    DELETE FROM OAuth2RefreshToken WHERE expires < NOW();

    DELETE OAuth2AccessToken FROM User
    INNER JOIN OAuth2AccessToken ON (User.id = OAuth2AccessToken.userId)
    WHERE FIND_IN_SET('deleted', User.flags);
END ;;

CREATE EVENT `rmInvalidTokens` ON SCHEDULE EVERY 1 HOUR STARTS '2019-08-13 00:00:00' ENABLE
DO BEGIN
    CALL rmInvalidTokens();
END ;;

DELIMITER ;
docker run --rm --name "${DB_TMP_FLYWAY}" \
                -v '/Users/marcbennewitz/workspace/auth-server/flyway/conf:/flyway/conf' \
                -v '/Users/marcbennewitz/workspace/auth-server/flyway/sql:/flyway/sql' \
                -v '/Users/marcbennewitz/workspace/auth-server/flyway/fixtures:/flyway/fixtures' \
                --link "${DB_TMP_CONTAINER}:db" \
                'flyway/flyway:6.4' \
                migrate -configFiles=/flyway/conf/dev.conf
What did you expect to see?

Migration should work as expected

What did you see instead?

Unable to parse statement in /flyway/sql/V201908081130__scheduleAndDelInvalidTokens.sql at line 1 col 1: Delimiter changed inside statement at line 1 col 1: -- Schedule deletion of expired and otherwise invalid tokens

The error happens on the comment -- Schedule deletion of expired and otherwise invalid tokens If I remove this comment it's working fine but this would change an already applied migration.

@MikielAgutu
Copy link

MikielAgutu commented Apr 30, 2020

This will be fixed by 6.4.1. Probably resolved along with the fixes for #2782 or #2795

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

2 participants