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

DB2 Stored procedure scripts which run in 4.1.2 fail to execute in 5.0.2 #1878

Closed
ghost opened this issue Dec 21, 2017 · 7 comments
Closed

Comments

@ghost
Copy link

ghost commented Dec 21, 2017

What version of Flyway are you using? 5.0.2
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks) Command-line
What database are you using (type & version)? DB2 10.5 FP6
What operating system are you using? AIX 7.1
What did you do?

(Please include the content causing the issue, any relevant configuration settings, and the command you ran)

Clean followed by a migrate to recreate the environment.

What did you expect to see?

Successful recreation of the test environment as previously done in 4.1.2.

What did you see instead?

Process abended at first script which created stored procedures with the following error;

ERROR: Unexpected error
org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateSqlException:
Migration V00000279__create_end_of_day_audit_stored_procedures.sql failed

SQL State : 42601
Error Code : -104
Message : DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=END;

This may be related to recent fixes 1690 and 1691.

@ghost
Copy link
Author

ghost commented Dec 21, 2017

Syntax of stored procedure all follow a similar template as below;

CREATE PROCEDURE SP_PROC1(
IN fromTime TIMESTAMP,
IN toTime TIMESTAMP
)
DYNAMIC RESULT SETS 1
BEGIN
DECLARE cursor1 CURSOR WITH RETURN FOR
SELECT .....
FROM ....
WHERE .....
GROUP BY .....;
OPEN cursor1;
END;

@axelfontaine
Copy link
Contributor

The devil is often in the details. Could you post the smallest possible SQL file that causes Flyway to fail? Please include actual SQL as we often need the exact input characters to see what trips up the parser.

@axelfontaine
Copy link
Contributor

Any news?

@ghost
Copy link
Author

ghost commented Jan 4, 2018

Not yet, other than it does seem to be specific to the makeup of the procedures in the failing script. Trying to recreate the problem with anonymous code.

@axelfontaine
Copy link
Contributor

Have you been able to recreate it?

@ghost
Copy link
Author

ghost commented Jan 16, 2018

Yes. It's a bit messy but it's a couple of the original scripts with various names changed.
Flyway.zip

axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Jan 16, 2018
@axelfontaine
Copy link
Contributor

@rob34 Thanks! That was very helpful. 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
Projects
None yet
Development

No branches or pull requests

1 participant