Changeset: 012b4d6cb8ce for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=012b4d6cb8ce Removed Files: monetdb5/tests/BugReports/Tests/no.037.patch monetdb5/tests/BugReports/Tests/no.050.patch monetdb5/tests/BugReports/Tests/no.062.patch monetdb5/tests/BugReports/Tests/no.125.patch monetdb5/tests/suite_01/Tests/test_00.patch monetdb5/tests/suite_01/Tests/test_15.patch monetdb5/tests/suite_01/Tests/test_30.patch monetdb5/tests/suite_01/Tests/test_60.patch Modified Files: clients/python/monetdb/sql/connections.py gdk/gdk.h gdk/gdk_bat.c gdk/gdk_batop.mx gdk/gdk_posix.c gdk/gdk_posix.h gdk/gdk_utils.c monetdb5/extras/jaql/jaqlgencode.c monetdb5/mal/Tests/saveload.mal monetdb5/mal/Tests/saveload.stable.out monetdb5/mal/Tests/tst007.mal monetdb5/mal/Tests/tst007.stable.out monetdb5/mal/Tests/tst1200.mal monetdb5/mal/Tests/tst1200.stable.out monetdb5/mal/Tests/tst274.stable.out monetdb5/mal/Tests/tst610.mal monetdb5/mal/Tests/tst610.stable.out monetdb5/modules/atoms/mtime.c monetdb5/modules/kernel/bat5.mx monetdb5/modules/kernel/batcalc.mal monetdb5/modules/kernel/batcalc.mal.sh monetdb5/modules/mal/Tests/iterator03.stable.out monetdb5/modules/mal/Tests/qgram.stable.out monetdb5/modules/mal/Tests/tokenizer00.mal monetdb5/modules/mal/Tests/tokenizer00.stable.out monetdb5/modules/mal/bbp.c monetdb5/modules/mal/bbp.h monetdb5/modules/mal/bbp.mal monetdb5/modules/mal/inspect.mal monetdb5/modules/mal/iterator.c monetdb5/modules/mal/mal_init.mal monetdb5/modules/mal/mal_io.mal monetdb5/modules/mal/mat.mal monetdb5/modules/mal/remote.mal monetdb5/modules/mal/tokenizer.mal monetdb5/modules/mal/txtsim.c monetdb5/optimizer/Tests/mat00.stable.out monetdb5/optimizer/Tests/mat01.stable.out monetdb5/optimizer/opt_mergetable.c sql/server/rel_select.c sql/test/bugs/Tests/zero_or_one_bug.stable.out testing/Mtest.py.in Branch: default Log Message:
merged with head diffs (truncated from 4869 to 300 lines): diff --git a/clients/python/monetdb/sql/connections.py b/clients/python/monetdb/sql/connections.py --- a/clients/python/monetdb/sql/connections.py +++ b/clients/python/monetdb/sql/connections.py @@ -132,7 +132,6 @@ class Connection(object): #return self.execute('ROLLBACK') - def cursor(self): """ Return a new Cursor Object using the connection. If the @@ -161,6 +160,16 @@ class Connection(object): return True + def settimeout(self,timeout): + """ set the amount of time before a connection times out """ + self.mapi.socket.settimeout(timeout) + + + def gettimeout(self): + """ get the amount of time before a connection times out """ + return self.mapi.socket.gettimeout() + + # these are required by the python DBAPI Warning = Warning Error = Error diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -2199,7 +2199,7 @@ gdk_export BAT *BAThashjoin(BAT *l, BAT #define GDK_HISTO_MAX_BIT ((int) (sizeof(size_t)<<3)) /* we prefer to use vm_alloc routines on size > GDKmmap */ -gdk_export void *GDKmmap(char *path, int mode, off_t off, size_t len); +gdk_export void *GDKmmap(const char *path, int mode, off_t off, size_t len); gdk_export size_t GDK_mem_bigsize; /* size after which we use anonymous VM rather than malloc */ gdk_export size_t GDK_mem_maxsize; /* max allowed size of committed memory */ diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -1585,6 +1585,14 @@ BUNinplace(BAT *b, BUN p, const void *h, BUN prv, nxt; ALIGNinp(b, "BUNreplace", force); /* zap alignment info */ + if (b->T->nil && + atom_CMP(BUNtail(bi, p), ATOMnilptr(b->ttype), b->ttype) == 0 && + atom_CMP(t, ATOMnilptr(b->ttype), b->ttype) != 0) { + /* if old value is nil and new value isn't, + * we're not sure anymore about the nil + * property, so we must clear it */ + b->T->nil = 0; + } tacc_update(del,tail,p,pit); Treplacevalue(b, BUNtloc(bi, p), t); tacc_update(ins,tail,p,pit); @@ -2157,6 +2165,7 @@ BAT * BATseqbase(BAT *b, oid o) { BATcheck(b, "BATseqbase"); + assert(o <= oid_nil); if (ATOMtype(b->htype) == TYPE_oid) { if (b->hseqbase != o) { b->batDirtydesc = TRUE; diff --git a/gdk/gdk_batop.mx b/gdk/gdk_batop.mx --- a/gdk/gdk_batop.mx +++ b/gdk/gdk_batop.mx @@ -51,17 +51,16 @@ All Rights Reserved. #include "gdk_private.h" #include "gdk_scanselect.h" -@= updateloop -{ - BATiter bi = bat_iterator(@2); - BUN p1, p2; +#define updateloop(bn, b, func) \ + do { \ + BATiter bi = bat_iterator(b); \ + BUN p1, p2; \ + \ + BATloop(b, p1, p2) { \ + func(bn, BUNhead(bi, p1), BUNtail(bi, p1)); \ + } \ + } while (0) - BATloop(@2, p1, p2) { - @3(@1, BUNhead(bi, p1), BUNtail(bi, p1)); - } -} -@ -@c /* * @+ BAT insert/delete/replace * The content of a BAT can be appended to (removed from) another using @@ -436,7 +435,7 @@ BATins(BAT *b, BAT *n, bit force) b->H->nonil &= n->H->nonil; b->T->nonil &= n->T->nonil; } else { - @:updateloop(b,n,bunins)@ + updateloop(b, n, bunins); } res = b; bunins_failed: @@ -709,7 +708,7 @@ BATdel(BAT *b, BAT *n, bit force) ALIGNdel(b, "BATdel", force); TYPEcheck(b->htype, n->htype); TYPEcheck(b->ttype, n->ttype); - @:updateloop(b,n,bundel)@ + updateloop(b, n, bundel); return b; } @@ -724,12 +723,11 @@ BATdelHead(BAT *b, BAT *n, bit force) } ALIGNdel(b, "BATdelHead", force); TYPEcheck(b->htype, n->htype); - @:updateloop(b,n,bundelhead)@ + updateloop(b, n, bundelhead); return b; } /* - * @- * The last in this series is a BATreplace, which replaces all the * buns mentioned. */ @@ -741,7 +739,7 @@ BATreplace(BAT *b, BAT *n, bit force) return b; } BATcompatible(b, n); - @:updateloop(b,n,BUNreplace_force)@ + updateloop(b, n, BUNreplace_force); return b; } @@ -792,7 +790,6 @@ BATslice(BAT *b, BUN l, BUN h) } /* - * @- * If the source BAT is readonly, then we can obtain a VIEW * that just reuses the memory of the source. */ @@ -807,7 +804,6 @@ BATslice(BAT *b, BUN l, BUN h) BATsetcount(bn, cnt); BATsetcapacity(bn, cnt); /* - * @- * We have to do it: create a new BAT and put everything into it. */ } else { @@ -1079,7 +1075,6 @@ BAT_select_(BAT *b, const void *tl, cons BATcheck(b, "BATselect"); BATcheck(tl, "BATselect: tl value required"); /* - * @- * Examine type, and values for lower- and higher-bound. */ batcnt = BATcount(b); @@ -1238,7 +1233,6 @@ BAT_select_(BAT *b, const void *tl, cons return bn; } /* - * @- * Use sampling to determine a good result size, when the bat is large. */ if (BATtkey(b)) { @@ -1266,7 +1260,6 @@ BAT_select_(BAT *b, const void *tl, cons estimate = MAX(estimate, BATguess(b)); } /* - * @- * Create the result BAT and execute the select algorithm. */ if (ht == TYPE_void && tt == TYPE_void) { @@ -1301,7 +1294,6 @@ BAT_select_(BAT *b, const void *tl, cons return NULL; /* error occurred */ } /* - * @- * Propagate alignment info. Key properties are inherited from the parent. * Hash changes the order; IDX yields ordered tail; scan respects original order. */ @@ -1414,7 +1406,6 @@ BATtopN(BAT *b, BUN topN) } /* - * @- * The baseline algorithm for fragment location is a two-phase process. * First we search on the 1st * dimension and collect the qualifying BUNs in a marking on the @@ -2062,7 +2053,7 @@ BATrevert(BAT *b) * @+ BAT partitioning * For distributed processing we support hash and range * partitioning operators: BATsplithash and BATsplitrange. - * @- + * * The part_bat function creates a partition BAT. */ static BAT * @@ -2140,7 +2131,7 @@ BAThashsplit(BAT *b, BUN n, int unary) goto bunins_failed; } metabati = bat_iterator(metabat); - @:updateloop(metabat,b,BUNhash)@ + updateloop(metabat, b, BUNhash); BATloop(metabat, p, q) { bat bt = *(bat *) BUNtail(metabati, p); @@ -2154,7 +2145,6 @@ BAThashsplit(BAT *b, BUN n, int unary) } /* - * @- * Range partitioning ensures that identical values appear in one * partition only. The routine also tries to deliver partitions of * uniform size. @@ -2190,7 +2180,6 @@ BATrangesplit(BAT *b, BUN n, int unary) nilval = ATOMnilptr(BATttype(b)); /* - * @- * We use sampling to determine bucket sizes. * Uniform bucket sizes are the ideal to be achieved. * If necessary though, we deliver less than n buckets. @@ -2205,7 +2194,6 @@ BATrangesplit(BAT *b, BUN n, int unary) if ((seps = (ptr *) GDKmalloc(2 * n * sizeof(ptr))) == NULL) goto bunins_failed; /* - * @- * Use the histogram to determine good split boundaries on b. */ BATorder(histo); @@ -2243,7 +2231,6 @@ BATrangesplit(BAT *b, BUN n, int unary) n = yy + 1; } /* - * @- * CASE 1: just one bucket. * This is done without copying b. */ @@ -2252,7 +2239,6 @@ BATrangesplit(BAT *b, BUN n, int unary) goto bunins_failed; /* - * @- * CASE 2: sorted on fragmentation column. * We can again avoid copying, by giving slices (views) on the source BAT. * Virtual oids (void) is a special subcase with positional lookup instead @@ -2278,7 +2264,6 @@ BATrangesplit(BAT *b, BUN n, int unary) } /* - * @- * CASE 3: full scan. * If it ain't sorted then we gotta scan the whole thing and split. * This is heavy stuff so we optimize execution according to datatype. @@ -2431,7 +2416,7 @@ BATnumber(BAT *b) if (bn == NULL) return NULL; r = BUNfirst(bn); - @:updateloop(bn,b,BUNnumber)@ + updateloop(bn, b, BUNnumber); ALIGNsetH(bn, b); BATsetprop_wrd(bn, GDK_AGGR_CARD, i); /* 64bit: no (wrd) cast to remind us */ bn->hsorted = BAThordered(b); @@ -2489,97 +2474,91 @@ BATgroup(BAT *b, int start, int incr, in return NULL; } -@= mark_grp_init - BUN w; +#define mark_grp_init(BUNfnd) \ + do { \ + BUN w; \ + \ + BUNfnd(w, gi, &v); \ + if (w != BUN_NONE) { \ + n = * (oid *) BUNtloc(gi, w); \ + } else { \ + n = oid_nil; \ + } \ + } while (0) - BUNfnd@1(w, gi, &v); - if (w != BUN_NONE) { - n = * (oid *) BUNtloc(gi, w); - } else { - n = oid_nil; - } -@ -@= mark_grp_loop4 - oid u = oid_nil; - oid n = oid_nil; +#define mark_grp_loop4(BUNhead, buninsert, BUNtail, init_n) \ + do { \ + oid u = oid_nil; \ + oid n = oid_nil; \ _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list