Skip to content

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

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions