Fix checking for table existence on SQL storage types (#2864)

This commit is contained in:
Federico López 2021-01-29 06:34:55 -03:00 committed by GitHub
parent 8043b84dc4
commit d12be01ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -980,7 +980,7 @@ public class SqlStorage implements StorageImplementation {
} }
private static boolean tableExists(Connection connection, String table) throws SQLException { private static boolean tableExists(Connection connection, String table) throws SQLException {
try (ResultSet rs = connection.getMetaData().getTables(null, null, "%", null)) { try (ResultSet rs = connection.getMetaData().getTables(connection.getCatalog(), null, "%", null)) {
while (rs.next()) { while (rs.next()) {
if (rs.getString(3).equalsIgnoreCase(table)) { if (rs.getString(3).equalsIgnoreCase(table)) {
return true; return true;