Changeset: bf0aa048190e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bf0aa048190e
Branch: default
Log Message:

Merge with Oct2020 branch.


diffs (50 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -2361,18 +2361,18 @@ JSONjsonaggr(BAT **bnp, BAT *b, BAT *g, 
                freeg = 1;
                if (t2->ttype == TYPE_void) {
                        map = NULL;
-                       mapoff = t2->tseqbase;
                } else {
                        map = (const oid *) Tloc(t2, 0);
+                       mapoff = t2->tseqbase;
                }
                if (g && BATtdense(g)) {
                        for (p = 0, q = BATcount(g); p < q; p++) {
                                switch (b->ttype) {
                                case TYPE_str:
-                                       v = (const char *) BUNtvar(bi, (map ? 
(BUN) map[p] : p + mapoff));
+                                       v = (const char *) BUNtvar(bi, (map ? 
(BUN) map[p] - mapoff : p));
                                        break;
                                case TYPE_dbl:
-                                       val = (const double *) BUNtloc(bi, (map 
? (BUN) map[p] : p + mapoff));
+                                       val = (const double *) BUNtloc(bi, (map 
? (BUN) map[p] - mapoff : p));
                                        if (!is_dbl_nil(*val)) {
                                                snprintf(temp, sizeof(temp), 
"%f", *val);
                                                v = (const char *) temp;
diff --git a/sql/backends/monet5/sql_subquery.c 
b/sql/backends/monet5/sql_subquery.c
--- a/sql/backends/monet5/sql_subquery.c
+++ b/sql/backends/monet5/sql_subquery.c
@@ -205,12 +205,15 @@ SQLall(ptr ret, const bat *bid)
                                }
                        }
                        s = ATOMlen(ATOMtype(b->ttype), p);
-                       *(ptr *) ret = GDKmalloc(s);
-                       if (*(ptr *) ret == NULL) {
-                               BBPunfix(b->batCacheid);
-                               throw(SQL, "sql.all", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
-                       }
-                       memcpy(*(ptr *)ret, p, s);
+                       if (ATOMextern(b->ttype)) {
+                               *(ptr *) ret = GDKmalloc(s);
+                               if (*(ptr *) ret == NULL) {
+                                       BBPunfix(b->batCacheid);
+                                       throw(SQL, "sql.all", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
+                               }
+                               memcpy(*(ptr *)ret, p, s);
+                       } else
+                               memcpy(ret, p, s);
                }
                }
        }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to