cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-1903) In-memory matching using Expressions with nulls
Date Sat, 01 Mar 2014 08:37:19 GMT

     [ https://issues.apache.org/jira/browse/CAY-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-1903.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.2.M2

Fixed on trunk. Let us know if anything is still broken.

> In-memory matching using Expressions with nulls
> -----------------------------------------------
>
>                 Key: CAY-1903
>                 URL: https://issues.apache.org/jira/browse/CAY-1903
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.2.M2
>            Reporter: David Feshbach
>             Fix For: 3.2.M2
>
>
> When a NULL is encountered in a WHERE clause in SQL, it stays NULL (not true or false)
unless it is part of an IS NULL, IS NOT NULL, AND (false), or OR (true). If the entire expression
is NULL, the row is not matched.
> Cayenne Expressions behave differently in memory. Additionally there is a breaking change
in CAY-1860. Expressions that used to work, (and matched database behavior,) now throw an
exception. For example:
> Expression expr = Artist.DATE_OF_DEATH.gt(new Date(0));
> This expression used to match all artists that died after 1970 and exclude all living
artists. Now it throws an exception if it tries to match a living artist.
> before CAY-1860:
> (null) > 0              -> false
> NOT ((null) > 0)   -> true
> 0 > (null)              -> false
> 0 < (null)              -> false
> after CAY-1860:
> (null) > 0              -> ExpressionException
> NOT ((null) > 0)   -> ExpressionException
> 0 > (null)              -> true
> 0 < (null)              -> false
> In SQL:
> (null) > 0              -> null (no match)
> NOT ((null) > 0)   -> null
> 0 > (null)              -> null
> 0 < (null)              -> null
> NOT (null)            -> null
> (null) AND (true)  -> null
> (null) OR (false)   -> null
> (null) OR (true)    -> true
> (null) AND (false) -> false



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message