Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.5.0, 4.0.0
Description
If there is an error executing statement.executeQuery(), it's possible that another error in one of the finally statements makes us not see the main error.
def getQueryOutputSchema( query: String, options: JDBCOptions, dialect: JdbcDialect): StructType = { val conn: Connection = dialect.createConnectionFactory(options)(-1) try { val statement = conn.prepareStatement(query) try { statement.setQueryTimeout(options.queryTimeout) val rs = statement.executeQuery() try { JdbcUtils.getSchema(rs, dialect, alwaysNullable = true, isTimestampNTZ = options.preferTimestampNTZ) } finally { rs.close() } } finally { statement.close() } } finally { conn.close() } }
Attachments
Issue Links
- links to