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

Clean fix #664 breaks DB2 clean in some cases #691

Closed
vuorse opened this issue Feb 5, 2014 · 5 comments
Closed

Clean fix #664 breaks DB2 clean in some cases #691

vuorse opened this issue Feb 5, 2014 · 5 comments
Labels
Milestone

Comments

@vuorse
Copy link

@vuorse vuorse commented Feb 5, 2014

It seems the fixes introduced in #664 do not work in all cases. We use Flyway and DB2 to maintain a fairly complex schema and it used to work up until 2.2.1 just fine. 2.3 and 2.3.1 do not clean the database any more.

Clean fails with DB2 SQLCODE: -206 and SQLSTATE: 42703 which seems to refer to temporal types.
#664 is the most likely culprit, but more analysis would be needed to isolate exact issue.

@axelfontaine axelfontaine added the DB2 label Feb 12, 2014
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Feb 12, 2014

Thanks for reporting this. Please provide a small test case that triggers the problem. Without that it's almost impossible for me to reproduce.

Cheers
Axel

@rakus
Copy link

@rakus rakus commented Apr 24, 2014

I can confirm this bug for DB2 Version 9.7. It does not occure on DB2 Version 10.1.

The problem is line 184 in org.flywaydb.core.internal.dbsupport.db2.DB2Schema

Table[] versioningTables = findTables("select rtrim(TABNAME) from SYSCAT.TABLES where TEMPORALTYPE <> 'N' and TABSCHEMA = ?", name);

In DB2 9.7 the column "TEMPORALTYPE" does not exist.

As far as I can see, this was introduced with #664.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Apr 24, 2014

@rakus Thanks for investigating! I guess all there is to do is to surround the offending statement with a >= 10 version check.

Would you like to provide a pull request?

@axelfontaine axelfontaine added the bug label Apr 24, 2014
@axelfontaine axelfontaine added this to the Flyway 3.1 milestone Apr 24, 2014
@rakus
Copy link

@rakus rakus commented Apr 25, 2014

Axel, I'm not not sure what will be the right solution. Just removing TEMPORALTYPE from the query for DB2 Versions below 10 might not be enough. Someone with more DB2 knowledge than me should look into this.

Note that Flyway 2.2.1 does work with DB2 9.7.

BTW: Our server is updated to DB2 V 10.1 next week.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Apr 26, 2014

I checked and it was the only change since 2.2.1. Fixed as described in previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.