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

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

Closed
spring-issuemaster opened this issue Mar 27, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Mar 27, 2017

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:

  • #18159 Spring JDBC not correctly processing Postgresql ?-contained operator
  • #19896 GenericCallMetaDataProvider should not treat 'NULLABLE' column as boolean (for compatibility with latest Postgres driver)
  • #21054 Spring JDBC not correctly processing Postgresql ? operator
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 27, 2017

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.* ?

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 27, 2017

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.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 27, 2017

Artur Geraschenko commented

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.