Bugs item #1960373, was opened at 2008-05-08 18:08
Message generated for change (Comment added) made by boncz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1960373&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core
Group: MonetDB Common "stable"
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Sjoerd Mullender (sjoerd)
>Assigned to: Sjoerd Mullender (sjoerd)
Summary: kunion and nil

Initial Comment:
mil>var a := new(void,oid).append(oid(nil)).append(1...@0).tunique();
mil>a.info().find("hkey").print();
[ "1" ]
mil>var b := kunion(a,a);
mil>b.info().find("hkey").print();
[ "1" ]
mil>b.print();
#-----------------#
# h     t         # name
# oid   void      # type
#-----------------#
[ nil,    nil     ]
[ 1...@0,    nil     ]
[ nil,    nil     ]

If run with debugmask 10, BATpropcheck complains about b having hkey set.

The questions are:
- is tunique right in setting hkey, even in the presence of a nil?
- is kunion right in producing three values (since nil != nil)?
- is kunion right in setting hkey (again since nil != nil)?
- is BATpropcheck right in complaining that hkey is set (since nil = nil, or 
perhaps because hkey should never be set in the presence of nils)?

----------------------------------------------------------------------

>Comment By: Peter Boncz (boncz)
Date: 2009-04-07 10:40

Message:
I have been overruled before in nil matters (the in my eyes very confusing
distinction between nil and void), I think it is not used consistently
anyway now. So answering logical questions about nils has become impossible
regrettably.

Maybe you can ask niels?

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2008-09-10 11:17

Message:
See also

[ 2103348 ] unique problem with nulls
http://sourceforge.net/tracker/index.php?func=detail&aid=2103348&group_id=56967&atid=482468

[ 2075241 ] When the NULL is in a column,it shouldn't add primary key
http://sourceforge.net/tracker/index.php?func=detail&aid=2075241&group_id=56967&atid=482468

[ 2075180 ] the unique column can't insert more than 1 row with null
http://sourceforge.net/tracker/index.php?func=detail&aid=2075180&group_id=56967&atid=482468


----------------------------------------------------------------------

Comment By: Niels Nes (nielsnes)
Date: 2008-08-29 09:05

Message:
Logged In: YES 
user_id=43556
Originator: NO

one more interesting problem which is related. select (x, nil, val), ie
less than handling breaks when val is nil. x < nil should return nothing
but now it returns the full x (well except for nils). This case happens in
sql were we get a nil when no value is returned from a sub query (see bug
2080168 for example).
 
Probably we need to add wrappers for the range and equality selects.

----------------------------------------------------------------------

Comment By: Niels Nes (nielsnes)
Date: 2008-08-26 15:59

Message:
Logged In: YES 
user_id=43556
Originator: NO

For SQL it would be best to support the 'ignore' nil option. Ie keyedness
is n't affected by the nils in the column.

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2008-08-26 09:51

Message:
Logged In: YES 
user_id=572415
Originator: NO

so, the semantics of NIL is

- in case of select and join (I guess/hope):
  NIL is not compareable to NIL; hence the result of comparing NIL to NIL
is never TRUE (but actually not FALSE either)

- in case of [tk]unique:
  NIL is comparable to NIL and the result of comparing NIL to NIL is TRUE

?

Shouldn't try to find a single consistent semantic for NILs?


----------------------------------------------------------------------

Comment By: Peter Boncz (boncz)
Date: 2008-08-26 09:35

Message:
Logged In: YES 
user_id=591107
Originator: NO

tunion is right in setting hkey

Kunion is wrong in producing three results and in setting hkey. 

Batpropcheck is right in complaining about it. 


My answer is based on the historical situation where nil is just another
value; that is before giving nil special treatment in select and join.

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2008-08-26 09:20

Message:
Logged In: YES 
user_id=572415
Originator: NO

See also
[ 2075180 ] the unique column can't insert more than 1 row with null 
http://sourceforge.net/tracker/index.php?func=detail&aid=2075180&group_id=56967&atid=482468


----------------------------------------------------------------------

Comment By: Sjoerd Mullender (sjoerd)
Date: 2008-06-05 16:22

Message:
Logged In: YES 
user_id=43607
Originator: YES

Peter, I'd like you to give your opinion on this issue.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1960373&group_id=56967

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to