Changeset: 3091b05a5150 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3091b05a5150
Added Files:
sql/test/BugTracker-2013/Tests/crash-from-optimizer.Bug-3241.sql
sql/test/BugTracker-2013/Tests/crash-from-optimizer.Bug-3241.stable.err
sql/test/BugTracker-2013/Tests/crash-from-optimizer.Bug-3241.stable.out
sql/test/BugTracker-2013/Tests/perl-undef-0.Bug-3235.SQL.bat
sql/test/BugTracker-2013/Tests/perl-undef-0.Bug-3235.SQL.sh
sql/test/BugTracker-2013/Tests/perl-undef-0.Bug-3235.pl
sql/test/BugTracker-2013/Tests/perl-undef-0.Bug-3235.stable.err
sql/test/BugTracker-2013/Tests/perl-undef-0.Bug-3235.stable.out
Removed Files:
testing/subprocess26.py
Modified Files:
NT/monetdb_config.h.in
clients/Tests/exports.stable.out
clients/perl/MonetDB-CLI-MapiPP/MonetDB/CLI/MapiPP.pm
clients/python2/monetdb/mapi.py
clients/python3/monetdb/mapi.py
gdk/gdk.h
gdk/gdk_calc.c
gdk/gdk_group.c
gdk/gdk_join.c
monetdb5/mal/mal_dataflow.c
monetdb5/mal/mal_instruction.h
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_resource.c
monetdb5/mal/mal_resource.h
monetdb5/modules/atoms/batxml.c
sql/backends/monet5/sql_scenario.c
sql/jdbc/tests/Tests/Test_Dobjects.stable.out
sql/scripts/75_storagemodel.sql
sql/server/rel_psm.c
sql/storage/bat/bat_storage.c
sql/storage/store.c
sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.err
sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out
sql/test/BugTracker-2013/Tests/All
sql/test/Tests/systemfunctions.stable.out
sql/test/leaks/Tests/check0.stable.out
sql/test/mapi/Tests/php_monetdb.stable.out
sql/test/mapi/Tests/php_monetdb_nogeom.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out
testing/Makefile.ag
testing/Mtest.py.in
tools/merovingian/client/monetdb.1
Branch: rdf
Log Message:
Merge with the default branch
diffs (truncated from 3175 to 300 lines):
diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -611,6 +611,11 @@
/* Define to 1 if the system has the type `_Bool'. */
#define HAVE__BOOL 1
+#ifdef _WIN64
+/* Define to 1 if you have the `_mul128' function. */
+#define HAVE__MUL128 1
+#endif
+
/* Define if you have _sys_siglist */
/* #undef HAVE__SYS_SIGLIST */
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -170,6 +170,7 @@ BAT *BATprev(BAT *b);
int BATprint(BAT *b);
int BATprintf(stream *f, BAT *b);
gdk_return BATprod(void *res, int tp, BAT *b, BAT *s, int skip_nils, int
abort_on_error, int nil_if_empty);
+BAT *BATproject(BAT *l, BAT *r);
BAT *BATrangejoin(BAT *l, BAT *rl, BAT *rh, bit li, bit hi);
BAT *BATreplace(BAT *b, BAT *n, bit force);
BAT *BATrestrict(BAT *b, const void *hl, const void *hh, const void *tl, const
void *th);
@@ -194,6 +195,7 @@ BAT *BATsort(BAT *b);
BAT *BATsort_rev(BAT *b);
BAT *BATssort(BAT *b);
BAT *BATssort_rev(BAT *b);
+gdk_return BATsubjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr,
BUN estimate);
gdk_return BATsubleftjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT
*sr, BUN estimate);
gdk_return BATsubouterjoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT
*sr, BUN estimate);
BAT *BATsubselect(BAT *b, BAT *s, const void *tl, const void *th, int li, int
hi, int anti);
@@ -1526,7 +1528,7 @@ str MALparser(Client c);
str MALpass(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
str MALpipeline(Client c);
str MALreader(Client c);
-void MALresourceFairness(Client cntxt, MalBlkPtr mb, lng usec);
+void MALresourceFairness(lng usec);
str MALstartDataflow(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
str MANUALcompletion(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
str MANUALcreate0(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
diff --git a/clients/perl/MonetDB-CLI-MapiPP/MonetDB/CLI/MapiPP.pm
b/clients/perl/MonetDB-CLI-MapiPP/MonetDB/CLI/MapiPP.pm
--- a/clients/perl/MonetDB-CLI-MapiPP/MonetDB/CLI/MapiPP.pm
+++ b/clients/perl/MonetDB-CLI-MapiPP/MonetDB/CLI/MapiPP.pm
@@ -14,7 +14,7 @@ sub unquote
{
my ($class, $v) = @_;
- return undef if !$v || $v eq 'NULL' || $v eq 'nil';
+ return undef if !defined($v) || $v eq 'NULL' || $v eq 'nil';
if ( $v =~ /^["']/) {
$v =~ s/^["']//;
diff --git a/clients/python2/monetdb/mapi.py b/clients/python2/monetdb/mapi.py
--- a/clients/python2/monetdb/mapi.py
+++ b/clients/python2/monetdb/mapi.py
@@ -229,7 +229,7 @@ class Connection(object):
while count > 0:
recv = self.socket.recv(count)
if len(recv) == 0:
- time.sleep(1)
+ raise OperationalError("Server closed connection")
#logger.debug("II: package size: %i payload: %s" % (len(recv),
recv))
count -= len(recv)
result.write(recv)
diff --git a/clients/python3/monetdb/mapi.py b/clients/python3/monetdb/mapi.py
--- a/clients/python3/monetdb/mapi.py
+++ b/clients/python3/monetdb/mapi.py
@@ -237,7 +237,7 @@ class Connection(object):
while count > 0:
recv = self.socket.recv(count)
if len(recv) == 0:
- time.sleep(1)
+ raise OperationalError("Server closed connection")
#logger.debug("II: package size: %i payload: %s" % (len(recv),
recv))
count -= len(recv)
result.write(recv)
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1861,7 +1861,7 @@ typedef struct {
BAT *cache[2]; /* if loaded: BAT* handle + reverse */
str logical[2]; /* logical name + reverse */
str bak[2]; /* logical name + reverse backups */
- bat next[2]; /* next BBP slot in link list */
+ bat next[2]; /* next BBP slot in linked list */
BATstore *desc; /* the BAT descriptor */
str physical; /* dir + basename for storage */
str options; /* A string list of options */
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -3384,6 +3384,48 @@ mul_##TYPE1##_##TYPE2##_##TYPE3(const TY
return nils; \
}
+#ifdef HAVE__MUL128
+#include <intrin.h>
+#pragma intrinsic(_mul128)
+
+#define MUL_2TYPE_lng(TYPE1, TYPE2) \
+static BUN \
+mul_##TYPE1##_##TYPE2##_lng(const TYPE1 *lft, int incr1, \
+ const TYPE2 *rgt, int incr2, \
+ lng *dst, BUN cnt, BUN start, \
+ BUN end, const oid *cand, \
+ const oid *candend, oid candoff, \
+ int abort_on_error) \
+{ \
+ BUN i, j, k; \
+ BUN nils = 0; \
+ lng clo, chi; \
+ \
+ CANDLOOP(dst, k, lng_nil, 0, start); \
+ for (i = start * incr1, j = start * incr2, k = start; \
+ k < end; i += incr1, j += incr2, k++) { \
+ CHECKCAND(dst, k, candoff, lng_nil); \
+ if (lft[i] == TYPE1##_nil || rgt[j] == TYPE2##_nil) { \
+ dst[k] = lng_nil; \
+ nils++; \
+ } else { \
+ clo = _mul128((lng) lft[i], \
+ (lng) rgt[j], &chi); \
+ if ((chi == 0 && clo >= 0) || \
+ (chi == -1 && clo < 0 && clo != lng_nil)) { \
+ dst[k] = clo; \
+ } else { \
+ if (abort_on_error) \
+ ON_OVERFLOW(TYPE1, TYPE2, "*"); \
+ dst[k] = lng_nil; \
+ nils++; \
+ } \
+ } \
+ } \
+ CANDLOOP(dst, k, lng_nil, end, cnt); \
+ return nils; \
+}
+#else
#define MUL_2TYPE_lng(TYPE1, TYPE2) \
static BUN \
mul_##TYPE1##_##TYPE2##_lng(const TYPE1 *lft, int incr1, \
@@ -3413,6 +3455,7 @@ mul_##TYPE1##_##TYPE2##_lng(const TYPE1
CANDLOOP(dst, k, lng_nil, end, cnt); \
return nils; \
}
+#endif
#define MUL_2TYPE_float(TYPE1, TYPE2, TYPE3) \
static BUN \
diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -64,9 +64,9 @@
*
* Otherwise we build a partial hash table on the fly.
*
- * A decision should be made on the order in which grouping occurs Let
- * |b| have << different values than |g| then the linked lists gets
- * extremely long, leading to a n^2 algorithm.
+ * A decision should be made on the order in which grouping occurs.
+ * Let |b| have << different values than |g| then the linked lists
+ * gets extremely long, leading to a n^2 algorithm.
* At the MAL level, the multigroup function would perform the dynamic
* optimization.
*/
@@ -451,20 +451,17 @@ BATgroup_internal(BAT **groups, BAT **ex
GRPnotfound();
}
} else if (b->T->hash) {
- bit gc = g && (g->tsorted || g->trevsorted);
-
- /* we already have a hash table on b;
- * we also exploit if g is clustered */
+ /* we already have a hash table on b */
ALGODEBUG fprintf(stderr, "#BATgroup(b=%s#" BUNFMT ","
"g=%s#" BUNFMT ","
"e=%s#" BUNFMT ","
"h=%s#" BUNFMT ",subsorted=%d): "
- "use existing hash table%s\n",
+ "use existing hash table\n",
BATgetId(b), BATcount(b),
g ? BATgetId(g) : "NULL", g ? BATcount(g) : 0,
e ? BATgetId(e) : "NULL", e ? BATcount(e) : 0,
h ? BATgetId(h) : "NULL", h ? BATcount(h) : 0,
- subsorted, gc ? " (g clustered)" : "");
+ subsorted);
hs = b->T->hash;
gn->tsorted = 1; /* be optimistic */
for (r = BUNfirst(b), p = r, q = r + BATcount(b); p < q; p++) {
@@ -473,46 +470,13 @@ BATgroup_internal(BAT **groups, BAT **ex
* HASHloop: the difference is that we only
* consider BUNs smaller than the one we're
* looking up (p), and that we also consider
- * the input groups;
- * we also exploit if g is clustered */
- /* skip irrelevant BUNs after the current
- * BUNs; exploit that hash-table links
- * backwards through BAT */
- for (hb = HASHget(hs,HASHprobe(hs, v));
- hb != HASHnil(hs)&& hb >= p;
- hb = HASHgetlink(hs,hb)) {
- assert( HASHgetlink(hs,hb) == HASHnil(hs)
- || HASHgetlink(hs,hb) < hb);
- }
- ;
- if (gc) {
- for (;
- hb != HASHnil(hs) && grps[hb - r] ==
grps[p - r];
- hb = HASHgetlink(hs,hb)) {
- assert( HASHgetlink(hs,hb) ==
HASHnil(hs)
- || HASHgetlink(hs,hb) < hb);
- if (cmp(v, BUNtail(bi, hb)) == 0) {
- oid grp = ngrps[hb - r];
- ngrps[p - r] = grp;
- if (histo)
- cnts[grp]++;
- if (gn->tsorted &&
- grp != ngrp - 1)
- gn->tsorted = 0;
- break;
- }
- }
- if (hb != HASHnil(hs) &&
- grps[hb - r] != grps[p - r]) {
- /* we didn't assign a group
- * yet */
- hb = HASHnil(hs);
- }
- } else if (grps) {
- for (;
+ * the input groups */
+ if (grps) {
+ for (hb = HASHget(hs, HASHprobe(hs, v));
hb != HASHnil(hs);
- hb = HASHgetlink(hs,hb)) {
- if (grps[hb - r] == grps[p - r] &&
+ hb = HASHgetlink(hs, hb)) {
+ if (hb < p &&
+ grps[hb - r] == grps[p - r] &&
cmp(v, BUNtail(bi, hb)) == 0) {
oid grp = ngrps[hb - r];
ngrps[p - r] = grp;
@@ -525,10 +489,11 @@ BATgroup_internal(BAT **groups, BAT **ex
}
}
} else {
- for (;
+ for (hb = HASHget(hs, HASHprobe(hs, v));
hb != HASHnil(hs);
- hb = HASHgetlink(hs,hb)) {
- if (cmp(v, BUNtail(bi, hb)) == 0) {
+ hb = HASHgetlink(hs, hb)) {
+ if (hb < p &&
+ cmp(v, BUNtail(bi, hb)) == 0) {
oid grp = ngrps[hb - r];
ngrps[p - r] = grp;
if (histo)
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -963,7 +963,7 @@ BATsubjoin(BAT **r1p, BAT **r2p, BAT *l,
*r1p = NULL;
*r2p = NULL;
- if (joinparamcheck(l, r, sl, sr, "BATsubleftjoin") == GDK_FAIL)
+ if (joinparamcheck(l, r, sl, sr, "BATsubjoin") == GDK_FAIL)
return GDK_FAIL;
lcount = BATcount(l);
if (sl)
@@ -982,7 +982,7 @@ BATsubjoin(BAT **r1p, BAT **r2p, BAT *l,
*r2p = r2;
return GDK_SUCCEED;
}
- if (joininitresults(&r1, &r2, estimate != BUN_NONE ? estimate : sl ?
BATcount(sl) : BATcount(l), "BATsubleftjoin") == GDK_FAIL)
+ if (joininitresults(&r1, &r2, estimate != BUN_NONE ? estimate : sl ?
BATcount(sl) : BATcount(l), "BATsubjoin") == GDK_FAIL)
return GDK_FAIL;
*r1p = r1;
*r2p = r2;
@@ -1034,7 +1034,7 @@ BATproject(BAT *l, BAT *r)
assert(BAThdense(r));
assert(l->ttype == TYPE_void || l->ttype == TYPE_oid);
- if (BATtdense(l)) {
+ if (BATtdense(l) && BATcount(l) > 0) {
lo = l->tseqbase;
hi = l->tseqbase + BATcount(l);
if (lo < r->hseqbase || hi > r->hseqbase + BATcount(r)) {
@@ -1046,8 +1046,8 @@ BATproject(BAT *l, BAT *r)
return NULL;
return BATseqbase(bn, l->hseqbase + (lo - l->tseqbase));
}
- if (l->ttype == TYPE_void) {
- assert(l->tseqbase == oid_nil);
+ if (l->ttype == TYPE_void || BATcount(l) == 0) {
+ assert(BATcount(l) == 0 || l->tseqbase == oid_nil);
bn = BATconstant(r->ttype, nil, BATcount(l));
if (bn != NULL)
bn = BATseqbase(bn, l->hseqbase);
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list