[
https://issues.apache.org/jira/browse/OPENJPA-3050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maxim Solodovnik resolved OPENJPA-3050.
---------------------------------------
Fix Version/s: 4.2.0
Assignee: Richard Zowalla
Resolution: Fixed
> In-memory arithmetic treats NULL as 0
> -------------------------------------
>
> Key: OPENJPA-3050
> URL: https://issues.apache.org/jira/browse/OPENJPA-3050
> Project: OpenJPA
> Issue Type: Bug
> Reporter: Richard Zowalla
> Assignee: Richard Zowalla
> Priority: Major
> Fix For: 4.2.0
>
>
> When a query is evaluated in memory (for example over a candidate
> collection), arithmetic with a NULL operand returns a number instead of NULL.
> {{Filters.op}} treats null as 0, so {{-n.intB}} or {{0 - n.intB}} with {{intB
> = null}} gives 0 in memory, while the database returns NULL. The same applies
> to {{+}}, {{*}} and {{/}}, and to the in-memory bulk update path in
> {{JDBCStoreQuery}}, which also calls {{Filters.op}}.
> Found while working on OPENJPA-3044.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)