diff --git a/exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/sql/statements/jdbc/JdbcDatabaseMetadataImpl.kt b/exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/sql/statements/jdbc/JdbcDatabaseMetadataImpl.kt index 632cb6d09d..e7d3114bd9 100644 --- a/exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/sql/statements/jdbc/JdbcDatabaseMetadataImpl.kt +++ b/exposed-jdbc/src/main/kotlin/org/jetbrains/exposed/sql/statements/jdbc/JdbcDatabaseMetadataImpl.kt @@ -151,13 +151,6 @@ class JdbcDatabaseMetadataImpl(database: String, val metadata: DatabaseMetaData) override fun columns(vararg tables: Table): Map> { val databases = mutableListOf(databaseName) - // For MySQL, table names that contain schema are considered to be in their own DB - // For example, if you connect to testdb, but your table is my_schema.test_table, - // the metadata you need to query is for my_schema, not testdb - if (currentDialect is MysqlDialect) { - databases.addAll(extractSchemas(tables)) - } - val result = mutableMapOf>() for (database in databases) { val columnsMetadata = metadata.getColumns(database, null, "%", "%") @@ -320,15 +313,6 @@ class JdbcDatabaseMetadataImpl(database: String, val metadata: DatabaseMetaData) } } -/** - * Returns the set of schemas the tables are defined in - */ -internal fun extractSchemas(tables: Array): Set { - return tables.map { table -> - table.schema - }.toSet() -} - private fun ResultSet.iterate(body: ResultSet.() -> T): List { val result = arrayListOf() while (next()) {