On Tue, Sep 02, 2014 at 04:57:25PM +0000, Scott Mathieson wrote:
Hi,
I’ve come across something that is either a bug or is just my misunderstanding of how MonetDB deals with NULL results from boolean expressions.
The issue I’m having is the OR and AND expressions behave differently in when evaluating a bollean expression where one of the variable is NULL (This is using version 11.15.19)
If I run a query:
SELECT ([some expression that evaluates to NULL] OR [some expression that evaluates to True] ) as “Result” – the returned value is <null>
If I try
SELECT ([some expression that evaluates to NULL] AND [some expression that evaluates to True] ) as “Result” – the returned value is True
This would seem to suggest the AND evaluation is ignoring NULL or Treating NULL as meaning True whereas OR is propagating it. Which is correct and is this a bug?
Thanks,
Scott Mathieson
Scott Do you have an example sql>select cast( NULL as bool) and TRUE; +--------------------+ | and_=_single_value | +====================+ | null | +--------------------+ 1 tuple (1.200ms) sql>select cast( NULL as bool) OR TRUE; +-------------------+ | or_=_single_value | +===================+ | true | +-------------------+ 1 tuple (1.215ms) Seems correct Niels
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
_______________________________________________ developers-list mailing list developers-list@monetdb.org https://www.monetdb.org/mailman/listinfo/developers-list
-- Niels Nes, Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands room L3.14, phone ++31 20 592-4098 sip:4098@sip.cwi.nl url: http://www.cwi.nl/~niels e-mail: Niels.Nes@cwi.nl