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

Call Function with INOUT-Null-Value #1420

Open
nikodemusP opened this issue Mar 3, 2024 · 2 comments
Open

Call Function with INOUT-Null-Value #1420

nikodemusP opened this issue Mar 3, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@nikodemusP
Copy link

nikodemusP commented Mar 3, 2024

Version:

Vert-X: 4.5.4
Oracle-JDBC: 19.18.0.0

Issue:

In case of database-procedure and the parameter is defined as an INOUT and the input-value is NULL, the wrong type is passed to JDBC-Driver. It makes no different if the tuble-parameter is set to

Tuple.of(SqlOutParam.INOUT(NullValue.Integer,JDBCType.INTEGER)
Tuple.of(SqlOutParam.INOUT(NullValue.Double,JDBCType.INTEGER)
Tuple.of(SqlOutParam.INOUT(NullValue.Double,JDBCType.DOUBLE)
Tuple.of(SqlOutParam.INOUT(null,JDBCType.INTEGER)

The JDBC-Driver everytime response with Parameter type conflict. The Input-Part is set to VARCHAR, the Output to TINYINT, regardless, what is defined within the Tuble-Parameter.

HTTP server started on port 8888
java.sql.SQLException: ORA-17012: Parameter type conflict (input type=9 output type=6)
https://docs.oracle.com/error-help/db/ora-17012/
        at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2486)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3739)
        at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4202)
        at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4206)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1015)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
        at com.zaxxer.hikari.pool.HikariProxyCallableStatement.execute(HikariProxyCallableStatement.java)
        at io.vertx.jdbcclient.impl.actions.JDBCPreparedQuery.execute(JDBCPreparedQuery.java:64)
        at io.vertx.jdbcclient.impl.actions.JDBCPreparedQuery.execute(JDBCPreparedQuery.java:44)
        at io.vertx.ext.jdbc.impl.JDBCConnectionImpl.lambda$schedule$3(JDBCConnectionImpl.java:226)
        at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:190)
        at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:276)
        at io.vertx.core.impl.ContextImpl.lambda$internalExecuteBlocking$2(ContextImpl.java:209)
        at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:833)
In: NVARCHAR
Out: TINYINT
java.sql.SQLException: ORA-17012: Parameter type conflict (input type=9 output type=6)
https://docs.oracle.com/error-help/db/ora-17012/
        at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:2486)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3739)
        at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4202)
        at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4206)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1015)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
        at com.zaxxer.hikari.pool.HikariProxyCallableStatement.execute(HikariProxyCallableStatement.java)
        at io.vertx.jdbcclient.impl.actions.JDBCPreparedQuery.execute(JDBCPreparedQuery.java:64)
        at io.vertx.jdbcclient.impl.actions.JDBCPreparedQuery.execute(JDBCPreparedQuery.java:44)
        at io.vertx.ext.jdbc.impl.JDBCConnectionImpl.lambda$schedule$3(JDBCConnectionImpl.java:226)
        at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:190)
        at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:276)
        at io.vertx.core.impl.ContextImpl.lambda$internalExecuteBlocking$2(ContextImpl.java:209)
        at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:833)

Do you have a reproducer?

I pushed a rep-case to Github:

Rep-Case-NullValue

The test.sql contains the package, just with one INOUT-Parameter.

@nikodemusP nikodemusP added the bug label Mar 3, 2024
@nikodemusP
Copy link
Author

Additional information, the issue can be workaround, with

.execute(Tuple.of(SqlOutParam.INOUT(NullValue.String,JDBCType.NVARCHAR)))

@tsegismont tsegismont self-assigned this Mar 18, 2024
@tsegismont tsegismont modified the milestones: 5.0.0, 4.5.6 Mar 18, 2024
@tsegismont
Copy link
Contributor

Possibly related to #1246

@vietj vietj modified the milestones: 4.5.6, 4.5.7, 4.5.8 Mar 21, 2024
@vietj vietj modified the milestones: 4.5.8, 4.5.9 May 24, 2024
@vietj vietj modified the milestones: 4.5.9, 4.5.10 Jul 17, 2024
@vietj vietj modified the milestones: 4.5.10, 4.5.11 Sep 4, 2024
@vietj vietj modified the milestones: 4.5.11, 4.5.12 Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants