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

Corrected determination of the DB2 version for the support of BOOLEAN columns. (patch for #4723) #4754

Merged
merged 3 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public boolean supportsBooleanDataType() {
throw new DatabaseException("Error getting fix pack number");

return getDatabaseMajorVersion() > 11
|| getDatabaseMajorVersion() == 11 && getDatabaseMinorVersion() >= 1 && fixPack.intValue() >= 1;
|| getDatabaseMajorVersion() == 11 && ( getDatabaseMinorVersion() == 1 && fixPack.intValue() >= 1 || getDatabaseMinorVersion() > 1 );

} catch (final DatabaseException e) {
return false; // assume not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ public void init() throws DatabaseException {
database.commit();
}

handleOldChangelogTableFormat(executor);
if(!(executor instanceof LoggingExecutor)) {
handleOldChangelogTableFormat(executor);
}
break;
} catch (Exception e) {
if (i == maxIterations - 1) {
Expand All @@ -163,7 +165,7 @@ public void init() throws DatabaseException {

private void handleOldChangelogTableFormat(Executor executor) throws DatabaseException {
if (executor.updatesDatabase() && (database instanceof DerbyDatabase) && ((DerbyDatabase) database)
.supportsBooleanDataType() || database.getClass().isAssignableFrom(DB2Database.class) && ((DB2Database) database)
.supportsBooleanDataType() || DB2Database.class.isAssignableFrom( database.getClass() ) && ((DB2Database) database)
.supportsBooleanDataType()) {
//check if the changelog table is of an old smallint vs. boolean format
String lockTable = database.escapeTableName(
Expand Down