Changeset: d4e591cbc5d0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d4e591cbc5d0
Modified Files:
        gdk/gdk_aggr.c
        gdk/gdk_group.c
        gdk/gdk_join.c
        gdk/gdk_select.c
        gdk/gdk_unique.c
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_upgrades.c
        sql/include/sql_catalog.h
        sql/server/rel_updates.c
        sql/server/sql_parser.y
        sql/server/sql_scan.c
        sql/storage/store.c
Branch: unlock
Log Message:

Merge with default branch.


diffs (truncated from 1586 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1315,7 +1315,7 @@ describe_table(Mapi mid, const char *sch
                /* the table is a real table */
                mnstr_printf(toConsole, "CREATE %sTABLE ",
                            type == 3 ? "MERGE " :
-                           type == 4 ? "STREAM " :
+                           /*type == 4 ? "STREAM " : */
                            type == 5 ? "REMOTE " :
                            type == 6 ? "REPLICA " :
                            "");
diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -208,11 +208,6 @@ SQLhelp sqlhelp1[] = {
         "[MINVALUE intval | NO MINVALUE] [MAXVALUE intval | NO MAXVALUE] 
[CACHE intval] [[NO] CYCLE]",
         "seq_int_datatype,intval",
         "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/SerialTypes"},
-       {"CREATE STREAM TABLE",
-        "Temporary table, locked during updates/ continues query processing",
-        "CREATE STREAM TABLE [ IF NOT EXISTS ] qname table_source\n",
-        "table_source",
-        NULL},
        {"CREATE TABLE",
         "Create a new table",
         "CREATE TABLE [ IF NOT EXISTS ] qname table_source [STORAGE ident 
string]\n"
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -3575,6 +3575,7 @@ BATmin_skipnil(BAT *b, void *aggr, bit s
                        const oid *ords = (const oid *) (pb ? 
pb->torderidx->base : b->torderidx->base) + ORDERIDXOFF;
                        BUN r;
                        if (!b->tnonil) {
+                               MT_thread_setalgorithm(pb ? "binsearch on 
parent oidx" : "binsearch on oids");
                                r = binsearch(ords, 0, b->ttype, Tloc(b, 0),
                                              b->tvheap ? b->tvheap->base : 
NULL,
                                              b->twidth, 0, BATcount(b),
@@ -3590,6 +3591,7 @@ BATmin_skipnil(BAT *b, void *aggr, bit s
                                /* no non-nil values */
                                pos = oid_nil;
                        } else {
+                               MT_thread_setalgorithm(pb ? "using parent oidx" 
: "using oids");
                                pos = ords[r];
                        }
                } else if ((VIEWtparent(b) == 0 ||
@@ -3599,6 +3601,8 @@ BATmin_skipnil(BAT *b, void *aggr, bit s
                        Imprints *imprints = VIEWtparent(b) ? 
BBPdescriptor(VIEWtparent(b))->timprints : b->timprints;
                        int i;
 
+
+                       MT_thread_setalgorithm(VIEWtparent(b) ? "using parent 
imprints" : "using imprints");
                        pos = oid_nil;
                        /* find first non-empty bin */
                        for (i = 0; i < imprints->bits; i++) {
@@ -3681,6 +3685,7 @@ BATmax_skipnil(BAT *b, void *aggr, bit s
                     BATcheckorderidx(pb))) {
                        const oid *ords = (const oid *) (pb ? 
pb->torderidx->base : b->torderidx->base) + ORDERIDXOFF;
 
+                       MT_thread_setalgorithm(pb ? "using parent oidx" : 
"using oids");
                        pos = ords[BATcount(b) - 1];
                        /* nils are first, ie !skipnil, check for nils */
                        if (!skipnil) {
@@ -3699,6 +3704,7 @@ BATmax_skipnil(BAT *b, void *aggr, bit s
                        Imprints *imprints = VIEWtparent(b) ? 
BBPdescriptor(VIEWtparent(b))->timprints : b->timprints;
                        int i;
 
+                       MT_thread_setalgorithm(VIEWtparent(b) ? "using parent 
imprints" : "using imprints");
                        pos = oid_nil;
                        /* find last non-empty bin */
                        for (i = imprints->bits - 1; i >= 0; i--) {
@@ -3981,6 +3987,7 @@ doBATgroupquantile(BAT *b, BAT *g, BAT *
                     BATcount(pb) == BATcount(b) &&
                     pb->hseqbase == b->hseqbase &&
                     BATcheckorderidx(pb))) {
+                       MT_thread_setalgorithm(pb ? "using parent oidx" : 
"using oids");
                        ords = (const oid *) (pb ? pb->torderidx->base : 
b->torderidx->base) + ORDERIDXOFF;
                } else {
                        if (BATsort(NULL, &t1, NULL, b, NULL, g, false, false, 
false) != GDK_SUCCEED)
diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -322,7 +322,7 @@
                INIT_0;                                                 \
                assert(grps == NULL);                                   \
                if (ci.tpe == cand_dense) {                             \
-                       MT_thread_setalgorithm("GRP_use_existing_hash_table, 
dense"); \
+                       MT_thread_setalgorithm(phash ? 
"GRP_use_existing_hash_table, dense, parent hash" : 
"GRP_use_existing_hash_table, dense"); \
                        for (r = 0; r < cnt; r++) {                     \
                                oid o = canditer_next_dense(&ci);       \
                                p = o - hseqb + lo;                     \
@@ -356,7 +356,7 @@
                                }                                       \
                        }                                               \
                } else {                                                \
-                       MT_thread_setalgorithm("GRP_use_existing_hash_table, 
!dense"); \
+                       MT_thread_setalgorithm(phash ? 
"GRP_use_existing_hash_table, !dense, parent hash" : 
"GRP_use_existing_hash_table, !dense"); \
                        for (r = 0; r < cnt; r++) {                     \
                                oid o = canditer_next(&ci);             \
                                p = o - hseqb + lo;                     \
@@ -991,6 +991,7 @@ BATgroup_internal(BAT **groups, BAT **ex
                 * since we may have to go through long lists of
                 * duplicates in the hash table to find an old
                 * group */
+               bool phash = false;
                algomsg = "existing hash -- ";
                if (b->thash == NULL &&
                    /* DISABLES CODE */ (0) &&
@@ -1002,6 +1003,8 @@ BATgroup_internal(BAT **groups, BAT **ex
                        lo = b->tbaseoff - b2->tbaseoff;
                        b = b2;
                        bi = bat_iterator(b);
+                       algomsg = "existing parent hash -- ";
+                       phash = true;
                }
                hs = b->thash;
                gn->tsorted = true; /* be optimistic */
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2526,7 +2526,6 @@ hashjoin(BAT **r1p, BAT **r2p, BAT *l, B
        assert(!BATtvoid(r));
        assert(ATOMtype(l->ttype) == ATOMtype(r->ttype));
 
-       MT_thread_setalgorithm(__func__);
        int t = ATOMbasetype(r->ttype);
        if (r->ttype == TYPE_void || l->ttype == TYPE_void)
                t = TYPE_void;
@@ -2561,6 +2560,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT *l, B
        rh = canditer_last(rci) + 1 - r->hseqbase;
        if (phash) {
                /* there is a hash on the parent which we should use */
+               MT_thread_setalgorithm(swapped ? "hashjoin using parent hash 
(swapped)" : "hashjoin using parent hash");
                BAT *b = BBPdescriptor(VIEWtparent(r));
                TRC_DEBUG(ALGO, "%s(%s): using "
                          "parent(" ALGOBATFMT ") for hash%s\n",
@@ -2574,6 +2574,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT *l, B
                r = b;
        } else if (hash) {
                /* there is a hash on r which we should use */
+               MT_thread_setalgorithm(swapped ? "hashjoin using existing hash 
(swapped)" : "hashjoin using existing hash");
                hsh = r->thash;
                TRC_DEBUG(ALGO, ALGOBATFMT ": using "
                          "existing hash%s\n",
@@ -2584,6 +2585,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT *l, B
                 * candidate list */
                char ext[32];
                assert(rci->s);
+               MT_thread_setalgorithm(swapped ? "hashjoin using candidate hash 
(swapped)" : "hashjoin using candidate hash");
                TRC_DEBUG(ALGO, ALGOBATFMT ": creating "
                          "hash for candidate list " ALGOBATFMT "%s%s\n",
                          ALGOBATPAR(r), ALGOBATPAR(rci->s),
@@ -2598,6 +2600,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT *l, B
                hash_cand = true;
        } else {
                /* we need to create a hash on r */
+               MT_thread_setalgorithm(swapped ? "hashjoin using new hash 
(swapped)" : "hashjoin using new hash");
                TRC_DEBUG(ALGO, ALGOBATFMT ": creating hash%s\n",
                          ALGOBATPAR(r),
                          swapped ? " (swapped)" : "");
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -347,7 +347,7 @@ hashselect(BAT *b, struct canditer *rest
 #define bitswitch(ISDENSE, TEST, TYPE)                                 \
        do {                                                            \
                assert(imprints);                                       \
-               *algo = "imprints select " #TEST " (canditer_next" #ISDENSE 
")"; \
+               *algo = parent ? "parent imprints select " #TEST " 
(canditer_next" #ISDENSE ")" : "imprints select " #TEST " (canditer_next" 
#ISDENSE ")"; \
                switch (imprints->bits) {                               \
                case 8:  checkMINMAX(8, TYPE); impsmask(ISDENSE,TEST,8); break; 
\
                case 16: checkMINMAX(16, TYPE); impsmask(ISDENSE,TEST,16); 
break; \
@@ -467,6 +467,7 @@ NAME##_##TYPE(BAT *b, struct canditer *r
        BUN p;                                                          \
        BUN pr_off = 0;                                                 \
        Imprints *imprints;                                             \
+       bat parent = 0;                                                 \
        (void) li;                                                      \
        (void) hi;                                                      \
        (void) lval;                                                    \
@@ -475,11 +476,11 @@ NAME##_##TYPE(BAT *b, struct canditer *r
        assert(hi == !anti);                                            \
        assert(lval);                                                   \
        assert(hval);                                                   \
-       if (use_imprints && /* DISABLES CODE */ (0) && VIEWtparent(b)) { \
-               BAT *parent = BBPdescriptor(VIEWtparent(b));            \
-               assert(parent);                                         \
-               basesrc = (const TYPE *) Tloc(parent, 0);               \
-               imprints = parent->timprints;                           \
+       if (use_imprints && /* DISABLES CODE */ (0) && (parent = 
VIEWtparent(b))) {             \
+               BAT *pbat = BBPdescriptor(parent);                      \
+               assert(pbat);                                           \
+               basesrc = (const TYPE *) Tloc(pbat, 0);                 \
+               imprints = pbat->timprints;                             \
                pr_off = (BUN) (src - basesrc);                         \
        } else {                                                        \
                imprints = b->timprints;                                \
@@ -1357,6 +1358,7 @@ BATselect(BAT *b, BAT *s, const void *tl
         * trevstorted then use the order index.  And there is no cand
         * list or if there is one, it is dense.
         * TODO: we do not support anti-select with order index */
+       bool poidx = false;
        if (!anti &&
            !(hash && (phash || b->thash)) &&
            !(b->tsorted || b->trevsorted) &&
@@ -1376,6 +1378,7 @@ BATselect(BAT *b, BAT *s, const void *tl
                if ((ORDERfnd(b, th) - ORDERfnd(b, tl)) < b->batCount/3) {
                        use_orderidx = true;
                        if (view) {
+                               poidx = true; /* using parent oidx */
                                vwo = (lng) (view->tbaseoff - b->tbaseoff);
                                vwl = b->hseqbase + (oid) vwo + ci.seq - 
view->hseqbase;
                                vwh = vwl + canditer_last(&ci) - ci.seq;
@@ -1459,7 +1462,7 @@ BATselect(BAT *b, BAT *s, const void *tl
                        }
                } else {
                        assert(use_orderidx);
-                       algo = "select: orderidx";
+                       algo = poidx ? "select: parent orderidx" : "select: 
orderidx";
                        if (lval) {
                                if (li)
                                        low = ORDERfndfirst(b, tl);
diff --git a/gdk/gdk_unique.c b/gdk/gdk_unique.c
--- a/gdk/gdk_unique.c
+++ b/gdk/gdk_unique.c
@@ -38,7 +38,7 @@ BATunique(BAT *b, BAT *s)
        BUN hb;
        BATiter bi;
        int (*cmp)(const void *, const void *);
-       bat parent;
+       bat parent = 0;
        struct canditer ci;
        PROPrec *prop;
        const char *algomsg = "";
@@ -171,6 +171,7 @@ BATunique(BAT *b, BAT *s)
                        lo = b->tbaseoff - b2->tbaseoff;
                        b = b2;
                        bi = bat_iterator(b);
+                       algomsg = "unique: existing parent hash";
                } else {
                        lo = 0;
                }
diff --git a/sql/ChangeLog b/sql/ChangeLog
--- a/sql/ChangeLog
+++ b/sql/ChangeLog
@@ -1,3 +1,7 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
+* Fri Oct 30 2020 Pedro Ferreira <[email protected]>
+- Leftover STREAM table definition from Datacell extension was removed
+  from the parser. They had no effect anymore.
+
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -2176,11 +2176,11 @@ split_join_exps(sql_rel *rel, list *join
                                                        left_reference = 
right_reference = 1;
                                                }
                                        } else {
-                                               if (l->card != CARD_ATOM) {
+                                               if (l->card != CARD_ATOM || 
!exp_is_atom(l)) {
                                                        left_reference += 
rel_find_exp(rel->l, l) != NULL;
                                                        right_reference += 
rel_find_exp(rel->r, l) != NULL;
                                                }
-                                               if (r->card != CARD_ATOM) {
+                                               if (r->card != CARD_ATOM || 
!exp_is_atom(r)) {
                                                        left_reference += 
rel_find_exp(rel->l, r) != NULL;
                                                        right_reference += 
rel_find_exp(rel->r, r) != NULL;
                                                }
@@ -2191,7 +2191,7 @@ split_join_exps(sql_rel *rel, list *join
                                        for (node *n = l->h ; n ; n = n->next) {
                                                sql_exp *ee = n->data;
 
-                                               if (ee->card != CARD_ATOM) {
+                                               if (ee->card != CARD_ATOM || 
!exp_is_atom(ee)) {
                                                        left_reference += 
rel_find_exp(rel->l, ee) != NULL;
                                                        right_reference += 
rel_find_exp(rel->r, ee) != NULL;
                                                }
@@ -2199,7 +2199,7 @@ split_join_exps(sql_rel *rel, list *join
                                        for (node *n = r->h ; n ; n = n->next) {
                                                sql_exp *ee = n->data;
 
-                                               if (ee->card != CARD_ATOM) {
+                                               if (ee->card != CARD_ATOM || 
!exp_is_atom(ee)) {
                                                        left_reference += 
rel_find_exp(rel->l, ee) != NULL;
                                                        right_reference += 
rel_find_exp(rel->r, ee) != NULL;
                                                }
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -1412,16 +1412,8 @@ mvc_delta_values(Client cntxt, MalBlkPtr
        if (tname) {
                if (!(t = mvc_bind_table(m, s, tname)))
                        throw(SQL, "sql.delta", SQLSTATE(3F000) "No such table 
'%s' in schema '%s'", tname, s->base.name);
-               if (isView(t))
-                       throw(SQL, "sql.delta", SQLSTATE(42000) "Views don't 
have delta values");
-               if (isMergeTable(t))
-                       throw(SQL, "sql.delta", SQLSTATE(42000) "Merge tables 
don't have delta values");
-               if (isStream(t))
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to