Skip to content

Spring JDBC not correctly processing Postgresql ?| and ?& operator [SPR-15382] #19945

Closed

Description

@spring-projects-issues

Artur Geraschenko opened SPR-15382 and commented

Postgresql has many functional operators such as ?| and ?& (for example https://www.postgresql.org/docs/9.5/static/functions-json.html).

Spring JDBC processing for this case is not correct. When running the following SQL:

select '["3", "11"]'::jsonb ?| '{1,3,11,12,17}'::text[]

... I see exceptions like this:

class org.springframework.dao.InvalidDataAccessApiUsageException
SQL [select '["3", "11"]'::jsonb ?| '{1,3,11,12,17}'::text[]]: given 1 parameters but expected 0

If I use placeholders I see:

class org.springframework.dao.InvalidDataAccessApiUsageException
Not allowed to mix named and traditional ? placeholders. You have 1 named parameter(s) and 1 traditional placeholder(s) in statement:  ...

Affects: 4.3.7

Reference URL: #1366

Issue Links:

Activity

  1. spring-projects-issues commented on Mar 27, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Artur Geraschenko commented

    Hi, Juergen!

    Here is the related task, which was solved earlier in the same place in the code.: #18159
    Here is the solution to the current task: #1366

    Can I hope for the soonest inclusion of the code in version 4.3.* ?

  2. spring-projects-issues commented on Mar 27, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    Thanks for raising this - and for the PR which is now in master. I'll backport it to 4.3.8 which is scheduled for release on April 11th.

  3. spring-projects-issues commented on Mar 27, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Artur Geraschenko commented

    Thanks a lot!

  4. added
    in: data
    type: enhancement
    on Jan 11, 2019
  5. added this to the 4.3.8 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: datatype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions