You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling JdbcExecutor::queryForObject(SqlStatement sql, Class requiredType) with a RawParameterizedSqlStatement fails on Oracle databases with an error about an "invalid index".
Rewriting the query into it's equivalent with a RawSqlStatement works as expected.
Believe this is due to parameters being incorrectly set on the PreparedStatement.
PreparedStatement's documentation hints that the parameterIndex starts at 1; an index of 0 is used for the first parameter.
Parameters are retrieved with parameters.get(0) and parameters.get(i); the first looks wrong to me.
Steps To Reproduce
Build a Liquibase extension or an executable project using liquibase-core.
Call JdbcExecutor::queryForObject(SqlStatement sql, Class requiredType) with a RawParameterizedSqlStatement.
Catch and view the exception.
Expected/Desired Behavior
Calling JdbcExecutor::queryForObject(SqlStatement sql, Class requiredType) with a RawParameterizedSqlStatement should return the query's result.
Search first
Description
Calling JdbcExecutor::queryForObject(SqlStatement sql, Class requiredType) with a RawParameterizedSqlStatement fails on Oracle databases with an error about an "invalid index".
Rewriting the query into it's equivalent with a RawSqlStatement works as expected.
Believe this is due to parameters being incorrectly set on the PreparedStatement.
parameters.get(0)
andparameters.get(i)
; the first looks wrong to me.Steps To Reproduce
Expected/Desired Behavior
Calling JdbcExecutor::queryForObject(SqlStatement sql, Class requiredType) with a RawParameterizedSqlStatement should return the query's result.
Liquibase Version
4.23.0
Database Vendor & Version
Oracle 18c
Liquibase Integration
CLI
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
macOS 13.4
Additional Context
No response
Are you willing to submit a PR?
See #4589 for PR.
The text was updated successfully, but these errors were encountered: