Row is null wrong translation

Description

Suppose we have the following jpql query:

"select me from MyEntity me where not (me.field1, me.field2) is null"

This is translated to the following sql query (simplified for readability):

"select me.field1, me.field2 from my_entity me where (me.field1, me.field2) is not null"

This is wrong. Consider the following two sql queries:

a)
select count
from (values (null, 1), (null, null), (1, 1)) as tmp(a, b)
where (a, b) is not null; – result is 1

b)
select count
from (values (null, 1), (null, null), (1, 1)) as tmp(a, b)
where not (a, b) is null; – result is 2

The first one counts rows consisting of non-null values only: (1, 1), the second filters out all-null rows: (null, null). The jpql written at the beginning should be translated to smething like b), not like a).

Environment

OpenJDK 11, Linux Manjaro, Postgresql 12

Assignee

Unassigned

Reporter

Jedrzej Biedrzycki

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Priority

Major
Configure