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

The column index is out of range in call to setNull #1684

Closed
1 task
valensch opened this issue Jan 29, 2020 · 1 comment
Closed
1 task

The column index is out of range in call to setNull #1684

valensch opened this issue Jan 29, 2020 · 1 comment

Comments

@valensch
Copy link

I'm submitting a ...

  • [ x] bug report
  • feature request

Describe the issue
"The column index is out of range: 2, number of columns: 1." message was received when trying to execute prepared statement with output parameter.

Driver Version?
42.2.9

Java Version?
openjdk version "1.8.0_232"

OS Version?
Linux 4.19.97-1-MANJARO #1 SMP Sat Jan 18 00:17:24 UTC 2020 x86_64 GNU/Linux

PostgreSQL Version?
PostgreSQL 12.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 9.2.0, 64-bit

To Reproduce
Steps to reproduce the behaviour:

  1. prepare call for "{ ? = call initcap( ? ) }" statement
  2. register output parameter with index 1 as WARCHAR
  3. set parameter with index 2 as null WARCHAR with call to setNull

Expected behaviour
statement executed and null returned

Logs
If possible PostgreSQL logs surrounding the occurrence of the issue
pgjdbc-trace.log

program stacktrace:
org.postgresql.util.PSQLException: The column index is out of range: 2, number of columns: 1.
at org.postgresql.jdbc.PgPreparedStatement.setNull(PgPreparedStatement.java:188)
at jdbctest.App.properCase(App.java:21)
at jdbctest.App.main(App.java:32)

code to reproduce the problem can be taken in https://github.com/valensch/jdbctest/tree/master
maybe the problem is related to https://www.postgresql.org/message-id/pgjdbc/pgjdbc/push/refs/heads/master/ff4a66-6899a4@github.com

@davecramer
Copy link
Member

fixed in #1648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants