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

Invalid SQL type computed for Java array prepared statement parameters #478

Closed
pgentile opened this issue Aug 16, 2022 · 0 comments
Closed

Comments

@pgentile
Copy link

Anorm Version

2.6.x

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

Mac OS 12.5

JDK

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

Library Dependencies

  • Server: PostgreSQL 11.13
  • Driver: "org.postgresql" % "postgresql" % "42.4.1"

Expected Behavior

When Java arrays are used as prepared statement parameters:

        val operatorIds = List(1L, 2L, 3L)
        val operatorIdArray = operatorIds.toArray.map(long2Long)

        SQL"""
        SELECT o.*
        FROM "operators" AS o
        WHERE "operatorId" = any($operatorIdArray)
        """

The computed SQL type of array elements should be a BIGINT (like in PostgreSQL documentation).

Actual Behavior

The computed SQL type of array elements is NUMERIC.

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

Successfully merging a pull request may close this issue.

2 participants