Skip to content

Spring JDBC not correctly processing Postgresql ?| and ?& operator - #1366

Merged
jhoeller merged 2 commits into
spring-projects:masterfrom
arturgspb:master
Mar 27, 2017
Merged

jhoeller merged 2 commits into
spring-projects:masterfrom
arturgspb:master

Conversation

@arturgspb

Copy link
Copy Markdown

JIRA link https://jira.spring.io/browse/SPR-15382

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:  ...

@pivotal-issuemaster

Copy link
Copy Markdown

@arturgspb Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster

Copy link
Copy Markdown

@arturgspb Thank you for signing the Contributor License Agreement!

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 this pull request may close these issues.

3 participants