You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Michael Watzek <mw...@spree.de> on 2005/11/07 16:43:42 UTC
Assertion A14.6.9-7
Hi Craig,
assertion A14.6.9-7 specifies:
"A14.6.9-7 [If the returned value from a query specifying a result is
null, this indicates that the expression specified as the result was
null.] Note that the semantics of this result are different from the
returned value where no instances satisfied the filter."
Is my understanding right that the assertion checks if the result
expression evaluates to null? Does it make sense to test 3 queries, one
unique query and two non-unique queries, e.g.:
1) SELECT UNIQUE manager FROM Employee WHERE lastname == 'emp2Last'
expected result: null
2) SELECT manager FROM Employee WHERE lastname == 'emp2Last'
expected result: {null}
3) SELECT DISTINCT manager FROM Employee
expected result: {"emp2", null}
Regards,
Michael
--
-------------------------------------------------------------------
Michael Watzek Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de Buelowstr. 66
Tel.: ++49/30/235 520 36 10783 Berlin - Germany
Fax.: ++49/30/217 520 12 http://www.spree.de/
-------------------------------------------------------------------
Re: Assertion A14.6.9-7
Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Michael,
On Nov 7, 2005, at 7:43 AM, Michael Watzek wrote:
> Hi Craig,
>
> assertion A14.6.9-7 specifies:
>
> "A14.6.9-7 [If the returned value from a query specifying a result
> is null, this indicates that the expression specified as the result
> was null.] Note that the semantics of this result are different
> from the returned value where no instances satisfied the filter."
>
> Is my understanding right that the assertion checks if the result
> expression evaluates to null? Does it make sense to test 3 queries,
> one unique query and two non-unique queries, e.g.:
>
The test data:
emp1.manager is emp2.
emp2.manager is null.
emp3.manager is emp2.
emp4.manager is emp2.
emp5.manager is emp2.
> 1) SELECT UNIQUE manager FROM Employee WHERE lastname == 'emp2Last'
>
> expected result: null
Right.
>
> 2) SELECT manager FROM Employee WHERE lastname == 'emp2Last'
>
> expected result: {null}
Right.
>
> 3) SELECT DISTINCT manager FROM Employee
>
> expected result: {"emp2", null}
I think the expected result is {emp2, null} or {null, emp2} That is,
a reference to emp2 not the string "emp2" and the order is not
important.
I think the tests make sense. Thanks.
Craig
>
> Regards,
> Michael
> --
> -------------------------------------------------------------------
> Michael Watzek Tech@Spree Engineering GmbH
> mailto:mwa.tech@spree.de Buelowstr. 66
> Tel.: ++49/30/235 520 36 10783 Berlin - Germany
> Fax.: ++49/30/217 520 12 http://www.spree.de/
> -------------------------------------------------------------------
>