Changeset: 678f54b892fd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=678f54b892fd
Added Files:
        gdk/gdk_join_legacy.c
Modified Files:
        clients/ChangeLog.Feb2013
        gdk/ChangeLog.Feb2013
        gdk/Makefile.ag
        gdk/gdk_batop.c
        gdk/gdk_heap.c
        gdk/gdk_join.c
        monetdb5/ChangeLog.Feb2013
        monetdb5/modules/atoms/json_atom.c
        monetdb5/optimizer/opt_cluster.c
        monetdb5/optimizer/opt_octopus.c
        sql/ChangeLog.Feb2013
        sql/backends/monet5/sql.mx
        sql/common/sql_mem.c
        sql/test/json/Tests/pgexample.stable.out
        sql/test/json/Tests/spaceissue.stable.out
Branch: int128
Log Message:

Merge with default branch (changeset 026d2c8bc8ee).


diffs (truncated from 892 to 300 lines):

diff --git a/clients/ChangeLog.Feb2013 b/clients/ChangeLog.Feb2013
--- a/clients/ChangeLog.Feb2013
+++ b/clients/ChangeLog.Feb2013
@@ -1,6 +1,11 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Tue Nov 19 2013 Sjoerd Mullender <[email protected]>
+- mclient: Fixed a bug where the -H option only worked if the readline
+  history file already existed.  Now we properly create and use the
+  history file.
+
 * Wed Nov  6 2013 Sjoerd Mullender <[email protected]>
 - ODBC: Fixed interpretation SQL_C_SLONG/SQL_C_ULONG/SQL_C_LONG to
   refer to a 32 bit integer always (i.e. "int" on 64 bit architectures
diff --git a/gdk/ChangeLog.Feb2013 b/gdk/ChangeLog.Feb2013
--- a/gdk/ChangeLog.Feb2013
+++ b/gdk/ChangeLog.Feb2013
@@ -1,3 +1,11 @@
 # ChangeLog file for MonetDB
 # This file is updated with Maddlog
 
+* Tue Nov 19 2013 Sjoerd Mullender <[email protected]>
+- Stopped using the deprecated sbrk() system call.
+- Fixed a problem when reverse sorting a sorted column.
+- Fixed bugs that deal with problems that could possibly occur when
+  transactions are aborted and the server is restarted.  See bug #3243.
+- A bug was fixed in the handling of grouped aggregates when all values
+  in a group are null.  See bug #3388.
+
diff --git a/gdk/Makefile.ag b/gdk/Makefile.ag
--- a/gdk/Makefile.ag
+++ b/gdk/Makefile.ag
@@ -37,7 +37,7 @@ lib_gdk = {
                gdk_calc.c gdk_calc.h gdk_calc_compare.h gdk_calc_private.h \
                gdk_aggr.c gdk_group.c gdk_mapreduce.c gdk_mapreduce.h \
                gdk_imprints.c gdk_imprints.h \
-               gdk_join.c \
+               gdk_join.c gdk_join_legacy.c \
                bat.feps bat1.feps bat2.feps \
                libbat.rc
        LIBS = ../common/options/libmoptions \
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1253,7 +1253,7 @@ BATorder_internal(BAT *b, int stable, in
                 * column needs to be key) */
                return BATrevert(b);
        }
-       if ((!(reverse && b->hrevsorted) && !(!reverse && b->hsorted)) &&
+       if (!(reverse ? b->hrevsorted : b->hsorted) &&
            do_sort(Hloc(b, BUNfirst(b)), Tloc(b, BUNfirst(b)),
                    b->H->vheap ? b->H->vheap->base : NULL,
                    BATcount(b), Hsize(b), Tsize(b), b->htype,
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -418,6 +418,7 @@ GDKupgradevarheap(COLrec *c, var_t v, in
        size_t i, n;
        size_t savefree;
        const char *filename;
+       bat bid;
 
        assert(c->heap.parentid == 0);
        assert(width != 0);
@@ -449,7 +450,10 @@ GDKupgradevarheap(COLrec *c, var_t v, in
                filename = c->heap.filename;
        else
                filename++;
-       if (c->heap.storage == STORE_MMAP && !file_exists(BAKDIR, filename, 
NULL)) {
+       bid = strtol(filename, NULL, 8);
+       if (c->heap.storage == STORE_MMAP &&
+           (BBP_status(bid) & (BBPEXISTING|BBPDELETED)) &&
+           !file_exists(BAKDIR, filename, NULL)) {
                int fd;
                ssize_t ret = 0;
                size_t size = n << c->shift;
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -3153,294 +3153,3 @@ BATproject(BAT *l, BAT *r)
        BBPreclaim(bn);
        return NULL;
 }
-
-/* backward compatible interfaces */
-
-/* Return a subset of l where head elements occur as head element in r. */
-BAT *
-BATsemijoin(BAT *l, BAT *r)
-{
-       BAT *lmap;
-       BAT *res1, *res2;
-       BAT *bn;
-
-       if (BATcount(l) == 0)
-               return BATcopy(l, l->htype, l->ttype, 0);
-       if (BATcount(r) == 0) {
-               bn = BATnew(l->htype, l->ttype, 0);
-               if (BAThdense(l))
-                       BATseqbase(bn, l->hseqbase);
-               if (BATtdense(l))
-                       BATseqbase(BATmirror(bn), l->tseqbase);
-               return bn;
-       }
-
-       if (BAThdense(l) && BAThdense(r)) {
-               oid lo = l->hseqbase, hi = lo + BATcount(l);
-
-               if (lo < r->hseqbase)
-                       lo = r->hseqbase;
-               if (hi > r->hseqbase + BATcount(r))
-                       hi = r->hseqbase + BATcount(r);
-               if (hi < lo)
-                       hi = lo;
-               return BATslice(l, lo - l->hseqbase, hi - l->hseqbase);
-       }
-
-       /* l is [any_1,any_2]; r is [any_1,any_3] */
-       l = BATmirror(l);
-       r = BATmirror(r);
-       /* now: l is [any_2,any_1], r is [any_3,any_1] */
-       if (!BAThdense(l) || !BAThdense(r)) {
-               /* l is [any_2,any_1] */
-               lmap = BATmirror(BATmark(l, 0));
-               /* lmap is [dense1,any_2] */
-               l = BATmirror(BATmark(BATmirror(l), 0));
-               /* l is [dense1,any_1] */
-               /* r is [any_3,any_1] */
-               r = BATmirror(BATmark(BATmirror(r), 0));
-               /* r is [dense2,any_1] */
-       } else {
-               /* l is [dense1,any_1] (i.e. any_2==dense1) */
-               lmap = NULL;
-               BBPfix(l->batCacheid);
-               /* r is [dense2,any_1] */
-               BBPfix(r->batCacheid);
-       }
-       if (BATsubsemijoin(&res1, &res2, l, r, NULL, NULL, 0, BATcount(l)) == 
GDK_FAIL) {
-               if (lmap)
-                       BBPunfix(lmap->batCacheid);
-               BBPunfix(l->batCacheid);
-               BBPunfix(r->batCacheid);
-               return NULL;
-       }
-       BBPunfix(res2->batCacheid);
-       BBPunfix(r->batCacheid);
-       if (lmap) {
-               /* res1 is [dense,sub(dense1)] */
-               bn = BATproject(res1, lmap);
-               BBPunfix(lmap->batCacheid);
-               lmap = NULL;
-               /* bn is [dense,any_2] */
-               res2 = BATproject(res1, l);
-               /* res2 is [dense,any_1] */
-               BBPunfix(res1->batCacheid);
-               res1 = bn;
-               /* res1 is [dense,any_2] */
-       } else {
-               /* res1 is [dense,sub(dense1)] */
-               res2 = BATproject(res1, l);
-               /* res2 is [dense,any_1] */
-       }
-       BBPunfix(l->batCacheid);
-       res2 = BATmirror(res2);
-       /* res2 is [any_1,dense] */
-       bn = VIEWcreate(res2, res1);
-       /* bn is [any_1,any_2] */
-       BBPunfix(res1->batCacheid);
-       BBPunfix(res2->batCacheid);
-       return bn;
-}
-
-static BAT *
-do_batjoin(BAT *l, BAT *r, BAT *r2, int op,
-          const void *c1, const void *c2, int li, int hi, BUN estimate,
-          gdk_return (*joinfunc)(BAT **, BAT **, BAT *, BAT *, BAT *, BAT *,
-                                 int, BUN),
-          gdk_return (*thetajoin)(BAT **, BAT **, BAT *, BAT *, BAT *, BAT *,
-                                  int, int, BUN),
-          gdk_return (*bandjoin)(BAT **, BAT **, BAT *, BAT *, BAT *, BAT *,
-                                 const void *, const void *, int, int, BUN),
-          gdk_return (*rangejoin)(BAT **, BAT **, BAT *, BAT *, BAT *,
-                                  BAT *, BAT *, int, int, BUN),
-
-          const char *name)
-{
-       BAT *lmap, *rmap;
-       BAT *res1, *res2;
-       BAT *bn;
-       gdk_return ret;
-
-       ALGODEBUG {
-               if (r2)
-                       fprintf(stderr, "#Legacy %s(l=%s#"BUNFMT"[%s,%s]%s%s%s,"
-                               "rl=%s#" BUNFMT "[%s,%s]%s%s%s,"
-                               "rh=%s#" BUNFMT "[%s,%s]%s%s%s)\n", name,
-                               BATgetId(l), BATcount(l),
-                               ATOMname(l->htype), ATOMname(l->ttype),
-                               BAThdense(l) ? "-hdense" : "",
-                               l->tsorted ? "-sorted" : "",
-                               l->trevsorted ? "-revsorted" : "",
-                               BATgetId(r), BATcount(r),
-                               ATOMname(r->htype), ATOMname(r->ttype),
-                               BAThdense(r) ? "-hdense" : "",
-                               r->tsorted ? "-sorted" : "",
-                               r->trevsorted ? "-revsorted" : "",
-                               BATgetId(r2), BATcount(r2),
-                               ATOMname(r2->htype), ATOMname(r2->ttype),
-                               BAThdense(r2) ? "-hdense" : "",
-                               r2->tsorted ? "-sorted" : "",
-                               r2->trevsorted ? "-revsorted" : "");
-               else
-                       fprintf(stderr, "#Legacy %s(l=%s#"BUNFMT"[%s,%s]%s%s%s,"
-                               "r=%s#" BUNFMT "[%s,%s]%s%s%s)\n", name,
-                               BATgetId(l), BATcount(l),
-                               ATOMname(l->htype), ATOMname(l->ttype),
-                               BAThdense(l) ? "-hdense" : "",
-                               l->tsorted ? "-sorted" : "",
-                               l->trevsorted ? "-revsorted" : "",
-                               BATgetId(r), BATcount(r),
-                               ATOMname(r->htype), ATOMname(r->ttype),
-                               BAThdense(r) ? "-hdense" : "",
-                               r->tsorted ? "-sorted" : "",
-                               r->trevsorted ? "-revsorted" : "");
-       }
-       /* note that in BATrangejoin, we join on the *tail* of r and r2 */
-       if (r2 == NULL)
-               r = BATmirror(r);
-       /* r is [any_3,any_2] */
-       if (!BAThdense(l) || !BAThdense(r)) {
-               /* l is [any_1,any_2] */
-               lmap = BATmirror(BATmark(l, 0));
-               /* lmap is [dense1,any_1] */
-               l = BATmirror(BATmark(BATmirror(l), 0));
-               /* l is [dense1,any_2] */
-               /* r is [any_3,any_2] */
-               rmap = BATmirror(BATmark(r, 0));
-               /* rmap is [dense2,any_3] */
-               r = BATmirror(BATmark(BATmirror(r), 0));
-               /* r is [dense2,any_2] */
-       } else {
-               /* l is [dense1,any_2] */
-               lmap = NULL;
-               BBPfix(l->batCacheid);
-               /* r is [dense2,any_2] */
-               rmap = NULL;
-               BBPfix(r->batCacheid);
-       }
-       if (joinfunc) {
-               assert(thetajoin == NULL);
-               assert(bandjoin == NULL);
-               assert(rangejoin == NULL);
-               assert(r2 == NULL);
-               assert(c1 == NULL);
-               assert(c2 == NULL);
-               ret = (*joinfunc)(&res1, &res2, l, r, NULL, NULL, 0, estimate);
-       } else if (thetajoin) {
-               assert(bandjoin == NULL);
-               assert(rangejoin == NULL);
-               assert(r2 == NULL);
-               assert(c1 == NULL);
-               assert(c2 == NULL);
-               ret = (*thetajoin)(&res1, &res2, l, r, NULL, NULL, op, 0, 
estimate);
-       } else if (bandjoin) {
-               assert(rangejoin == NULL);
-               assert(r2 == NULL);
-               ret = (*bandjoin)(&res1, &res2, l, r, NULL, NULL, c1, c2, li, 
hi, estimate);
-       } else {
-               assert(rangejoin != NULL);
-               assert(r2 != NULL);
-               assert(c1 == NULL);
-               assert(c2 == NULL);
-               ret = (*rangejoin)(&res1, &res2, l, r, r2, NULL, NULL, li, hi, 
estimate);
-       }
-       if (ret == GDK_FAIL) {
-               BBPunfix(l->batCacheid);
-               BBPunfix(r->batCacheid);
-               if (lmap)
-                       BBPunfix(lmap->batCacheid);
-               if (rmap)
-                       BBPunfix(rmap->batCacheid);
-               return NULL;
-       }
-       if (lmap) {
-               bn = BATproject(res1, lmap);
-               BBPunfix(res1->batCacheid);
-               BBPunfix(lmap->batCacheid);
-               res1 = bn;
-               /* res1 is [dense,any_1] */
-               lmap = NULL;
-               bn = BATproject(res2, rmap);
-               BBPunfix(res2->batCacheid);
-               BBPunfix(rmap->batCacheid);
-               res2 = bn;
-               /* res2 is [dense,any_3] */
-               rmap = NULL;
-       }
-       bn = VIEWcreate(BATmirror(res1), res2);
-       /* bn is [any_1,any_3] */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to