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

Modified Files:
      Tag: MonetDB_5-0
        batcast.mx 
Log Message:
fixed bug in batcast, ie now also handle void void input bats


Index: batcast.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/kernel/batcast.mx,v
retrieving revision 1.14.4.1
retrieving revision 1.14.4.2
diff -u -d -r1.14.4.1 -r1.14.4.2
--- batcast.mx  5 Jun 2007 12:29:33 -0000       1.14.4.1
+++ batcast.mx  7 Jun 2007 09:42:06 -0000       1.14.4.2
@@ -150,12 +150,21 @@
 
        if( b->htype == TYPE_void){
                @2 *o = (@2*)BUNtail(bn,BUNfirst(bn));
-               @1 *p= (@1*) BUNtail(b, BUNfirst(b));
-               @1 *q= (@1*) BUNtail(b, BUNlast(b));
 
-               while(p<q) {
-                       *o = *p== @1_nil ?  @2_nil: (@2) *p;
-                       p= (@1 *) (((char*)p)+xx); o++;
+               if (b->ttype == TYPE_void) {
+                       oid t = b->tseqbase;
+                       size_t i, cnt = BATcount(b);
+
+                       for(i=0; i<cnt; i++) 
+                               *o++ = (@2)t++;
+               } else {
+                       @1 *p= (@1*) BUNtail(b, BUNfirst(b));
+                       @1 *q= (@1*) BUNtail(b, BUNlast(b));
+       
+                       while(p<q) {
+                               *o++ = *p== @1_nil ?  @2_nil: (@2) *p;
+                               p= (@1 *) (((char*)p)+xx); 
+                       }
                }
                (bn)->batBuns->free += BATcount(b)*sizeof(@2);
                BATsetcount(bn, BATcount(b));


-------------------------------------------------------------------------
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