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

Modified Files:
        bat5.mx 
Log Message:
A few more defensive lines to deal with different BAT descriptor returns.


Index: bat5.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/kernel/bat5.mx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- bat5.mx     26 May 2007 13:47:52 -0000      1.18
+++ bat5.mx     26 May 2007 14:08:22 -0000      1.19
@@ -1696,53 +1696,56 @@
 str
 BKCrevert(int *ret, int *bid)
 {
-       BAT *b;
+       BAT *b, *bn;
 
        if ((b = BATdescriptor(*bid)) == NULL) {
                throw(MAL, "bat.revert", "Cannot access descriptor");
        }
-       if (BATrevert(b) != NULL) {
-               *ret = b->batCacheid;
-               BBPkeepref(b->batCacheid);
-               return MAL_SUCCEED;
-       }
-       BBPreleaseref(b->batCacheid);
-       throw(MAL, "bat.revert", "GDKerror");
+       bn= BATrevert(b);
+       if(bn==NULL )
+               BBPkeepref(*ret= b->batCacheid);
+       else
+               BBPkeepref(*ret= bn->batCacheid);
+       if(bn && bn->batCacheid != b->batCacheid)
+               throw(MAL, "bat.revert", "GDKerror, different BAT returned");
+       return MAL_SUCCEED;
 }
 
 str
 BKCorder(int *ret, int *bid)
 {
-       BAT *b;
+       BAT *b,*bn;
 
        if ((b = BATdescriptor(*bid)) == NULL) {
                throw(MAL, "bat.order", "Cannot access descriptor");
        }
-       if (BATorder(b) != NULL) {
-               *ret = b->batCacheid;
-               BBPkeepref(b->batCacheid);
-               return MAL_SUCCEED;
-       }
-       BBPreleaseref(b->batCacheid);
-       throw(MAL, "bat.order", "GDKerror");
+       bn= BATorder(b);
+       if(bn==NULL )
+               BBPkeepref(*ret= b->batCacheid);
+       else
+               BBPkeepref(*ret= bn->batCacheid);
+       if(bn && bn->batCacheid != b->batCacheid)
+               throw(MAL, "bat.revert", "GDKerror, different BAT returned");
+       return MAL_SUCCEED;
 }
 
 str
 BKCorder_rev(int *ret, int *bid)
 {
-       BAT *b;
+       BAT *b,*bn;
 
        (void) ret;
        if ((b = BATdescriptor(*bid)) == NULL) {
                throw(MAL, "bat.order_rev", "Cannot access descriptor");
        }
-       if (BATorder_rev(b) != NULL) {
-               *ret = b->batCacheid;
-               BBPkeepref(b->batCacheid);
-               return MAL_SUCCEED;
-       }
-       BBPreleaseref(b->batCacheid);
-       throw(MAL, "bat.order", "GDKerror");
+       bn= BATorder_rev(b);
+       if(bn==NULL )
+               BBPkeepref(*ret= b->batCacheid);
+       else
+               BBPkeepref(*ret= bn->batCacheid);
+       if(bn && bn->batCacheid != b->batCacheid)
+               throw(MAL, "bat.revert", "GDKerror, different BAT returned");
+       return MAL_SUCCEED;
 }
 
 @-


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to