Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory 
sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19503/src/backends/monet5

Modified Files:
        sql.mx sql_result.mx 
Log Message:
fixed load script (mclient options -u / -P are gone)

Fixes of bat* conversion functions, head of bats where missing.
In case the input isn't a void bat, we still create a void but map the
head back in using a view. 


Index: sql_result.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_result.mx,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- sql_result.mx       1 Dec 2009 14:32:36 -0000       1.132
+++ sql_result.mx       30 Dec 2009 15:49:41 -0000      1.133
@@ -306,9 +306,8 @@
                        return NULL;
                s++;
                for( i = 0; *s && i < t->scale; i++, s++) {
-                       if (*s < '0' || *s > '9') {
+                       if (*s < '0' || *s > '9') 
                                return NULL;
-                       }
                        res *= 10;
                        res += (*s-'0');
                }

Index: sql.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql.mx,v
retrieving revision 1.381
retrieving revision 1.382
diff -u -d -r1.381 -r1.382
--- sql.mx      28 Dec 2009 19:56:00 -0000      1.381
+++ sql.mx      30 Dec 2009 15:49:40 -0000      1.382
@@ -3202,7 +3202,8 @@
        if( (b = BATdescriptor(*bid)) == NULL ){
                throw(SQL, "batca...@2_2_@1", "Cannot access descriptor");
        }
-       bn = BATnew(b->htype, ty...@1, BATcount(b));
+       bn = BATnew(TYPE_void, ty...@1, BATcount(b));
+       bn->hsorted = b->hsorted;
        BATseqbase(bn, b->hseqbase);
        o = (@1*) Tloc(bn,BUNfirst(bn));
        p = (@2*) Tloc(b, BUNfirst(b));
@@ -3222,10 +3223,17 @@
        BATsetcount(bn, BATcount(b));
        bn->tsorted = 0;
        BATkey(BATmirror(bn),FALSE);
+
        if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ);
 
-       BBPkeepref( *res = bn->batCacheid);
-       BBPunfix(b->batCacheid);
+       if (b->htype != bn->htype) {
+               BAT *r = VIEWcreate(b,bn);
+
+               BBPreleaseref(bn->batCacheid);
+               bn = r;
+       }
+       BBPkeepref(*res = bn->batCacheid);
+       BBPreleaseref(b->batCacheid);
        return MAL_SUCCEED;
 }
 @c
@@ -3263,8 +3271,9 @@
        if( (b = BATdescriptor(*bid)) == NULL ){
                throw(SQL, "batca...@2_2_@1", "Cannot access descriptor");
        }
-       bn = BATnew(b->htype, ty...@1, BATcount(b));
+       bn = BATnew(TYPE_void, ty...@1, BATcount(b));
        BATseqbase(bn, b->hseqbase);
+       bn->H->nonil = 1;
        o = (@1*) Tloc(bn,BUNfirst(bn));
        p = (@2*) Tloc(b, BUNfirst(b));
        q = (@2*) Tloc(b, BUNlast(b));
@@ -3299,10 +3308,17 @@
        BATsetcount(bn, BATcount(b));
        bn->tsorted = 0;
        BATkey(BATmirror(bn),FALSE);
+
        if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ);
 
-       BBPkeepref( *res = bn->batCacheid);
-       BBPunfix(b->batCacheid);
+       if (b->htype != bn->htype) {
+               BAT *r = VIEWcreate(b,bn);
+
+               BBPreleaseref(bn->batCacheid);
+               bn = r;
+       }
+       BBPkeepref(*res = bn->batCacheid);
+       BBPreleaseref(b->batCacheid);
        return msg;
 }
 @-
@@ -3385,7 +3401,8 @@
        if( (b = BATdescriptor(*bid)) == NULL ){
                throw(SQL, "batca...@2_dec2_@1", "Cannot access descriptor");
        }
-       bn = BATnew(b->htype, ty...@1, BATcount(b));
+       bn = BATnew(TYPE_void, ty...@1, BATcount(b));
+       bn->hsorted = b->hsorted;
        BATseqbase(bn, b->hseqbase);
        o = (@1*) Tloc(bn,BUNfirst(bn));
        p = (@2*) Tloc(b, BUNfirst(b));
@@ -3404,10 +3421,17 @@
        BATsetcount(bn, BATcount(b));
        bn->tsorted = 0;
        BATkey(BATmirror(bn),FALSE);
+
        if (!(bn->batDirty&2)) bn = BATsetaccess(bn, BAT_READ);
 
-       BBPkeepref( *res = bn->batCacheid);
-       BBPunfix(b->batCacheid);
+       if (b->htype != bn->htype) {
+               BAT *r = VIEWcreate(b,bn);
+
+               BBPreleaseref(bn->batCacheid);
+               bn = r;
+       }
+       BBPkeepref(*res = bn->batCacheid);
+       BBPreleaseref(b->batCacheid);
        return msg;
 }
 
@@ -4447,11 +4471,9 @@
        str *tbl = (str *) getArgReference(stk,pci,2);
        sql_schema      *s;
        sql_table       *t;
-       sql_column      *c;
        mvc *m = NULL;
        str msg = getContext(cntxt,mb, &m, NULL);
        sql_trans *tr = m->session->tr;
-       BAT *b;
        node *o;
        char buf[BUFSIZ], *nme= buf;
        int ret;
@@ -4468,14 +4490,30 @@
        /* actually build the hash on the multi-column primary key */
 
        for (o = t->columns.set->h; o; o = o->next) {
-               c = o->data;
+               BAT *b, *e;
+               sql_delta *d;
+               sql_column      *c = o->data;
+
                b = store_funcs.bind_col(tr, c, 0);
                if (b == NULL)
-                       throw(MAL,"sql.cluster","Can not access descriptor");
+                       throw(MAL,"sql.compress","Can not access descriptor");
+               e = BATnew(b->htype, b->ttype, 0);
+               BATsetaccess(e, BAT_READ);
+               d = c->data;
+               d->bid = 0;
+               d->ibase = 0;
+               d->ibid = e->batCacheid; /* use the insert bat */
+               c->base.wtime = c->base.rtime = tr->stime;
                snprintf(buf,BUFSIZ,"%s/%s/%s/0", *sch, *tbl, c->base.name);
                msg = @1;
                BBPreleaseref(b->batCacheid);
+               BBPdecref(b->batCacheid, TRUE);
+               BBPkeepref(e->batCacheid);
        }
+       /* bat was cleared */
+       t->cleared = 1;
+       t->base.wtime = s->base.wtime = tr->wtime = tr->stime;
+       t->base.rtime = s->base.rtime = tr->rtime = tr->stime;
        return MAL_SUCCEED;
 @c
 str SQLcompress(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to