Update of /cvsroot/monetdb/MonetDB5/src/modules/kernel
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15718

Modified Files:
        bat5.mx 
Log Message:
The BAT bulk operations were not (heavily) used in the test scripts.
They are crucial for DataCell and it should also be guaranteed that
the destination BAT remains stable. This is a step towards further
getting the DataCell working correctly.


Index: bat5.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/kernel/bat5.mx,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- bat5.mx     11 Sep 2007 21:30:51 -0000      1.22
+++ bat5.mx     12 Sep 2007 06:13:46 -0000      1.23
@@ -1864,9 +1864,10 @@
        BBPreleaseref(s->batCacheid);
        if(bn == NULL) {
                BBPreleaseref(b->batCacheid);
-               throw(MAL, "bat.insert", "Failed");
+               throw(MAL, "bat.insert", "GDKerror, different BAT returned");
        }
-       BBPkeepref(*r=b->batCacheid);
+       assert(b->batCacheid==bn->batCacheid);
+       BBPkeepref(*r=bn->batCacheid);
        return MAL_SUCCEED;
 }
 
@@ -1887,9 +1888,10 @@
        BBPreleaseref(s->batCacheid);
        if(bn == NULL) {
                BBPreleaseref(b->batCacheid);
-               throw(MAL, "bat.insert", "Failed");
+               throw(MAL, "bat.insert", "GDKerror, different BAT returned");
        }
-       BBPkeepref(*r=b->batCacheid);
+       assert(b->batCacheid==bn->batCacheid);
+       BBPkeepref(*r=bn->batCacheid);
        return MAL_SUCCEED;
 }
 
@@ -1928,12 +1930,12 @@
        }
        bn=BATreplace(b, s, 0);
        BBPreleaseref(s->batCacheid);
-       if(bn==NULL )
+       if(bn==NULL){
                BBPreleaseref(b->batCacheid);
-       else
-               BBPreleaseref(bn->batCacheid);
-       if(bn && bn->batCacheid != b->batCacheid)
                throw(MAL, "bat.replace", "GDKerror, different BAT returned");
+       }
+       assert(b->batCacheid==bn->batCacheid);
+       BBPkeepref(*r=bn->batCacheid);
        return MAL_SUCCEED;
 }
 
@@ -1973,12 +1975,12 @@
        }
        bn= BATreplace(b, s, *force);
        BBPreleaseref(s->batCacheid);
-       if(bn==NULL )
+       if(bn==NULL ){
                BBPreleaseref(b->batCacheid);
-       else
-               BBPreleaseref(bn->batCacheid);
-       if(bn && bn->batCacheid != b->batCacheid)
                throw(MAL, "bat.replace_bat", "GDKerror, different BAT 
returned");
+       }
+       assert(b->batCacheid==bn->batCacheid);
+       BBPkeepref(*r=bn->batCacheid);
        return MAL_SUCCEED;
 }
 
@@ -2064,6 +2066,7 @@
                BBPreleaseref(b->batCacheid);
                throw(MAL, "bat.delete_bat_buns", "GDKerror, different BAT 
returned");
        }
+       assert(b->batCacheid==bn->batCacheid);
        BBPkeepref(*r= bn->batCacheid);
        return MAL_SUCCEED;
 }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to