Skip to content

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

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

Spring JDBC not correctly processing Postgresql ?| and ?& operator#1366
jhoeller merged 2 commits intospring-projects:masterfrom
arturgspb:master

Conversation

@arturgspb
Copy link

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

@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

@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