Update of /cvsroot/monetdb/MonetDB5/src/modules/kernel
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3450/src/modules/kernel
Modified Files:
Tag: MonetDB_5-4
batifthen.mx
Log Message:
fix in handling NULL value results in if then else
Index: batifthen.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/kernel/batifthen.mx,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- batifthen.mx 27 Jan 2008 09:48:22 -0000 1.14
+++ batifthen.mx 28 Feb 2008 17:11:02 -0000 1.14.2.1
@@ -324,7 +324,7 @@
BATiter bi;
BAT *b, *bn;
BUN p,q;
- @1 nilval= (@1) @1_nil;
+ @1 nilval= (@1) @1_nil, *nilptr = &nilval;
bit *t;
@:getBATdescriptor(bid,b,"batcalc.ifThenElse")@
@@ -338,10 +338,11 @@
if (ATOMvarsized([EMAIL PROTECTED])) {
tid = *(@1**)tid;
eid = *(@1**)eid;
+ nilptr = (@1*)nilval;
}
BATloop(b, p, q) {
if (*t == bit_nil)
- BUNfastins(bn, BUNhead(bi,p), (ptr) & nilval);
+ BUNfastins(bn, BUNhead(bi,p), (ptr)nilptr);
else if (*t)
BUNfastins(bn, BUNhead(bi,p), (ptr) tid);
else
@@ -357,7 +358,7 @@
{
BATiter bi, tbi, ebi;
BAT *b, *tb, *eb, *bn;
- @1 nilval= (@1) @1_nil;
+ @1 nilval= (@1) @1_nil, *nilptr = &nilval;
BUN p,q;
bit *t;
@@ -376,9 +377,11 @@
t = (bit*) Tloc(b, BUNfirst(b));
+ if (ATOMvarsized([EMAIL PROTECTED]))
+ nilptr = (@1*)nilval;
BATloop(b, p, q) {
if (*t == bit_nil)
- BUNfastins(bn, BUNhead(bi,p), (ptr) &nilval);
+ BUNfastins(bn, BUNhead(bi,p), (ptr)nilptr);
else if (*t)
BUNfastins(bn, BUNhead(bi,p), BUNtail(tbi, p));
else
@@ -396,7 +399,7 @@
{
BATiter bi, ebi;
BAT *b, *eb, *bn;
- @1 nilval= (@1) @1_nil;
+ @1 nilval= (@1) @1_nil, *nilptr = &nilval;
BUN p,q;
bit *t;
@@ -412,11 +415,13 @@
t = (bit*) Tloc(b,BUNfirst(b));
- if (ATOMvarsized([EMAIL PROTECTED]))
+ if (ATOMvarsized([EMAIL PROTECTED])) {
val = *(@1**)val;
+ nilptr = (@1*)nilval;
+ }
BATloop(b, p, q) {
if (*t == bit_nil)
- BUNfastins(bn, BUNhead(bi,p), (ptr) &nilval);
+ BUNfastins(bn, BUNhead(bi,p), (ptr)nilptr);
else if (*t)
BUNfastins(bn, BUNhead(bi,p), (ptr) val);
else
@@ -433,7 +438,7 @@
{
BATiter bi, tbi;
BAT *b, *tb, *bn;
- @1 nilval= (@1) @1_nil;
+ @1 nilval= (@1) @1_nil, *nilptr = &nilval;
BUN p,q;
bit *t;
@@ -449,11 +454,13 @@
t = (bit*) Tloc(b,BUNfirst(b));
- if (ATOMvarsized([EMAIL PROTECTED]))
+ if (ATOMvarsized([EMAIL PROTECTED])) {
val = *(@1**)val;
+ nilptr = (@1*)nilval;
+ }
BATloop(b, p, q) {
- if (*t == bit_nil)
- BUNfastins(bn, BUNhead(bi,p), (ptr) &nilval);
+ if (*t == bit_nil)
+ BUNfastins(bn, BUNhead(bi,p), (ptr)nilptr);
else if (*t)
BUNfastins(bn, BUNhead(bi,p), BUNtail(tbi, p));
else
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins