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

null string exception when executing Flyway command on Spanner database after upgrading from 8.0.0 to 10.1.0 #3876

Open
DuanHen opened this issue Apr 15, 2024 · 0 comments

Comments

@DuanHen
Copy link

DuanHen commented Apr 15, 2024

Which version and edition of Flyway are you using?

Flyway 10.1.0 Community Edition

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)

This issue occurs in the latest version

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

Gradle plugin

Which database are you using? (Type & version)

Google Cloud Spanner

Which operating system are you using?

windows

What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)

After upgrading Flyway from version 8.0.0 to 10.1.0, executing the Flyway command against a Google Cloud Spanner database results in a null string exception.

Execution failed for task ':flywayInfo'.
> Error occurred while executing flywayInfo
  null string
What did you expect to see?

I expected the Flyway commands to execute normally without any errors, just as they did with version 8.0.0.

What did you see instead?

A null string exception occurred. This seems to be due to a change in the handling of the 'installed_on' column in the 'flyway_schema_history' table. In versions prior to 8.1.0, this column was allowed to be null. In version 10.1.0, the refreshCache method was updated with the following logic:

https://github.com/flyway/flyway/blob/flyway-10.1.0/flyway-core/src/main/java/org/flywaydb/core/internal/schemahistory/JdbcTableSchemaHistory.java#L224C1-L227C18

Timestamp installedOn = rs.getTimestamp(columnOrdinalMap.get("installed_on"));
if (installedOn == null) {
    installedOn = Timestamp.valueOf(rs.getString(columnOrdinalMap.get("installed_on")));
}

When installedOn is null, the Timestamp.valueOf(rs.getString(columnOrdinalMap.get("installed_on"))); conversion fails.

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

No branches or pull requests

1 participant