Changeset: 9bf754dd4951 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9bf754dd4951
Modified Files:
        clients/Tests/MAL-signatures-hge.test
        clients/Tests/MAL-signatures.test
        sql/backends/monet5/rel_bin.c
        sql/storage/bat/bat_storage.c
Branch: ustr
Log Message:

Merge with default branch.


diffs (truncated from 5333 to 300 lines):

diff --git a/ChangeLog.Dec2025 b/ChangeLog.Dec2025
--- a/ChangeLog.Dec2025
+++ b/ChangeLog.Dec2025
@@ -1,3 +1,7 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
+* Thu Apr 23 2026 Sjoerd Mullender <[email protected]>
+- It is no longer allowed to run mserver5 or monetdbd as root.  There are
+  important security concerns when these servers are run as root.
+
diff --git a/buildtools/conf/Maddlog b/buildtools/conf/Maddlog
--- a/buildtools/conf/Maddlog
+++ b/buildtools/conf/Maddlog
@@ -1,5 +1,4 @@
 #!/usr/bin/env bash
-# -*-shell-script-*-
 
 # SPDX-License-Identifier: MPL-2.0
 #
diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -48222,12 +48222,12 @@ mmath
 log2arg
 command mmath.log2arg(X_0:dbl, X_1:dbl):dbl
 MATHbinary_LOGdbl
-The log(x) function returns the logarithm of x in the given base.
+The log(base,x) function returns the logarithm of x in the given base.
 mmath
 log2arg
 command mmath.log2arg(X_0:flt, X_1:flt):flt
 MATHbinary_LOGflt
-The log(x) function returns the logarithm of x in the given base.
+(empty)
 mmath
 nextafter
 command mmath.nextafter(X_0:dbl, X_1:dbl):dbl
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -36707,12 +36707,12 @@ mmath
 log2arg
 command mmath.log2arg(X_0:dbl, X_1:dbl):dbl
 MATHbinary_LOGdbl
-The log(x) function returns the logarithm of x in the given base.
+The log(base,x) function returns the logarithm of x in the given base.
 mmath
 log2arg
 command mmath.log2arg(X_0:flt, X_1:flt):flt
 MATHbinary_LOGflt
-The log(x) function returns the logarithm of x in the given base.
+(empty)
 mmath
 nextafter
 command mmath.nextafter(X_0:dbl, X_1:dbl):dbl
diff --git a/misc/python/fixlicense.py b/misc/python/fixlicense.py
--- a/misc/python/fixlicense.py
+++ b/misc/python/fixlicense.py
@@ -205,20 +205,6 @@ def addlicense(file, pre=None, post=None
             # add a blank line
             addblank = True
             line = f.readline()
-        if '-*-' in line:
-            # if file starts with an Emacs mode specification, keep
-            # the line there
-            g.write(line)
-            # add a blank line
-            addblank = True
-            line = f.readline()
-        if 'vim:' in line:
-            # if file starts with a vim mode specification, keep
-            # the line there
-            g.write(line)
-            # add a blank line
-            addblank = True
-            line = f.readline()
         if line.startswith('<?xml'):
             # if line starts with an XML declaration, keep the line there
             g.write(line)
@@ -328,16 +314,6 @@ def dellicense(file, pre=None, post=None
             line = f.readline()
             if line and line == '\n':
                 line = f.readline()
-        if '-*-' in line:
-            g.write(line)
-            line = f.readline()
-            if line and line == '\n':
-                line = f.readline()
-        if 'vim:' in line:
-            g.write(line)
-            line = f.readline()
-            if line and line == '\n':
-                line = f.readline()
         if line.startswith('<?xml'):
             g.write(line)
             line = f.readline()
@@ -456,14 +432,6 @@ def listfile(file, pre=None, post=None, 
             line = f.readline()
             if line and line == '\n':
                 line = f.readline()
-        if '-*-' in line:
-            line = f.readline()
-            if line and line == '\n':
-                line = f.readline()
-        if 'vim:' in line:
-            line = f.readline()
-            if line and line == '\n':
-                line = f.readline()
         if line.startswith('<?xml'):
             line = f.readline()
             if line and line == '\n':
diff --git a/monetdb5/modules/kernel/algebra.c 
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -57,6 +57,7 @@ static gdk_return
 CMDgen_group(BAT **result, BAT *gids, BAT *cnts)
 {
        BUN j;
+       BUN n = 0;
        BATiter gi = bat_iterator(gids);
        BAT *r = COLnew(0, TYPE_oid, gi.count * 2, TRANSIENT);
 
@@ -65,38 +66,45 @@ CMDgen_group(BAT **result, BAT *gids, BA
                return GDK_FAIL;
        }
        BATiter ci = bat_iterator(cnts);
+       oid *rp = (oid *) Tloc(r, 0);
        if (gi.type == TYPE_void) {
                oid id = gi.tseq;
                lng *cnt = (lng *) ci.base;
                for (j = 0; j < gi.count; j++) {
-                       lng i, sz = cnt[j];
-                       for (i = 0; i < sz; i++) {
-                               if (BUNappend(r, &id, false) != GDK_SUCCEED) {
-                                       BBPreclaim(r);
-                                       bat_iterator_end(&ci);
-                                       bat_iterator_end(&gi);
-                                       return GDK_FAIL;
+                       for (lng sz = cnt[j], i = 0; i < sz; i++) {
+                               if (n >= BATcapacity(r)) {
+                                       r->theap->free = n * sizeof(oid);
+                                       BUN sz = BATgrows(r);
+                                       if (BATextend(r, sz) != GDK_SUCCEED) {
+                                               BBPreclaim(r);
+                                               return GDK_FAIL;
+                                       }
+                                       rp = (oid *) Tloc(r, 0);
                                }
+                               rp[n++] = id;
                        }
-                       id ++;
+                       id++;
                }
        } else {
-               oid *id = (oid *) gi.base;
+               oid *idp = (oid *) gi.base;
                lng *cnt = (lng *) ci.base;
                for (j = 0; j < gi.count; j++) {
-                       lng i, sz = cnt[j];
-                       for (i = 0; i < sz; i++) {
-                               if (BUNappend(r, id, false) != GDK_SUCCEED) {
-                                       BBPreclaim(r);
-                                       bat_iterator_end(&ci);
-                                       bat_iterator_end(&gi);
-                                       return GDK_FAIL;
+                       for (lng sz = cnt[j], i = 0; i < sz; i++) {
+                               if (n >= BATcapacity(r)) {
+                                       r->theap->free = n * sizeof(oid);
+                                       BUN sz = BATgrows(r);
+                                       if (BATextend(r, sz) != GDK_SUCCEED) {
+                                               BBPreclaim(r);
+                                               return GDK_FAIL;
+                                       }
+                                       rp = (oid *) Tloc(r, 0);
                                }
+                               rp[n++] = idp[j];
                        }
-                       id ++;
                }
        }
        bat_iterator_end(&ci);
+       BATsetcount(r, n);
        r->tkey = false;
        r->tseqbase = oid_nil;
        r->tsorted = gi.sorted;
diff --git a/monetdb5/modules/kernel/mmath.c b/monetdb5/modules/kernel/mmath.c
--- a/monetdb5/modules/kernel/mmath.c
+++ b/monetdb5/modules/kernel/mmath.c
@@ -362,8 +362,8 @@ static mel_func mmath_init_funcs[] = {
  command("mmath", "exp", MATHunary_EXPdbl, false, "The exp(x) function returns 
the value of e (the base of \nnatural logarithms) raised to the power of x.", 
args(1,2, arg("",dbl),arg("x",dbl))),
  command("mmath", "log", MATHunary_LOGflt, false, "", args(1,2, 
arg("",flt),arg("x",flt))),
  command("mmath", "log", MATHunary_LOGdbl, false, "The log(x) function returns 
the natural logarithm of x.", args(1,2, arg("",dbl),arg("x",dbl))),
- command("mmath", "log2arg", MATHbinary_LOGflt, false, "The log(x) function 
returns the logarithm of x in the given base.", args(1,3, 
arg("",flt),arg("x",flt),arg("base",flt))),
- command("mmath", "log2arg", MATHbinary_LOGdbl, false, "The log(x) function 
returns the logarithm of x in the given base.", args(1,3, 
arg("",dbl),arg("x",dbl),arg("base",dbl))),
+ command("mmath", "log2arg", MATHbinary_LOGflt, false, "", args(1,3, 
arg("",flt),arg("x",flt),arg("base",flt))),
+ command("mmath", "log2arg", MATHbinary_LOGdbl, false, "The log(base,x) 
function returns the logarithm of x in the given base.", args(1,3, 
arg("",dbl),arg("x",dbl),arg("base",dbl))),
  command("mmath", "log10", MATHunary_LOG10flt, false, "", args(1,2, 
arg("",flt),arg("x",flt))),
  command("mmath", "log10", MATHunary_LOG10dbl, false, "The log10(x) function 
returns the base-10 logarithm of x.", args(1,2, arg("",dbl),arg("x",dbl))),
  command("mmath", "log2", MATHunary_LOG2flt, false, "", args(1,2, 
arg("",flt),arg("x",flt))),
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
@@ -1486,10 +1486,6 @@ exp2bin_file_loader(backend *be, sql_exp
        sql_subfunc *f = fe->f;
 
        list *arg_list = fe->l;
-       /*
-       list *type_list = f->res;
-       assert(1 + list_length(type_list) == list_length(arg_list));
-       */
 
        sql_exp *eexp = arg_list->h->next->data;
        assert(is_atom(eexp->type));
@@ -1522,10 +1518,6 @@ exp2bin_proto_loader(backend *be, sql_ex
        sql_subfunc *f = fe->f;
 
        list *arg_list = fe->l;
-       /*
-       list *type_list = f->res;
-       assert(1 + list_length(type_list) == list_length(arg_list));
-       */
 
        sql_exp *eexp = arg_list->h->next->data;
        assert(is_atom(eexp->type));
@@ -1939,6 +1931,10 @@ exp_bin(backend *be, sql_exp *e, stmt *l
                                        s = exp_bin(be, n->data, right, NULL, 
grp, ext, cnt, NULL, depth+1, 0, push);
                                        swapped = 1;
                                }
+                               if (!s && right && !reduce) {
+                                       clean_mal_statements(be, oldstop, 
oldvtop);
+                                       s = exp_bin(be, n->data, left, right, 
grp, ext, cnt, NULL, depth+1, 0, push);
+                               }
                                if (!s)
                                        return s;
                                if (s->nrcols == 0 && first && left && 
left->nrcols)
@@ -3149,7 +3145,7 @@ rel2bin_groupjoin(backend *be, sql_rel *
                        if (mark && is_any(e)) {
                                join = stmt_markjoin(be, l, r, !is_any(e), 0);
                        } else
-                               join = stmt_join_cand(be, column(be, l), 
column(be, r), left->cand, NULL/*right->cand*/, is_anti(e), (comp_type) 
cmp_equal/*e->flag*/, 0, is_any(e)|is_semantics(e), false, rel->op == 
op_left?false:true);
+                               join = stmt_join_cand(be, column(be, l), 
column(be, r), left->cand, NULL/*right->cand*/, is_anti(e), (comp_type) 
cmp_equal/*e->flag*/, 0, is_any(e)|is_semantics(e), false, (rel->op == op_left 
|| !list_empty(rel->attr))?false:true);
                        jl = stmt_result(be, join, 0);
                        jr = stmt_result(be, join, 1);
                        if (mark && is_any(e))
@@ -7121,9 +7117,9 @@ rel2bin_delete(backend *be, sql_rel *rel
                        if (!s) /* error */
                                return NULL;
 
-                       if (!exp_name(exp))
+                       if (!exp_name(exp)) {
                                exp_label(sql->sa, exp, ++sql->label);
-                       if (exp_name(exp)) {
+                       } else {
                                s = stmt_rename(be, exp, s);
                                s->label = exp->alias.label;
                        }
diff --git a/sql/common/sql_list.c b/sql/common/sql_list.c
--- a/sql/common/sql_list.c
+++ b/sql/common/sql_list.c
@@ -713,6 +713,8 @@ list_map(list *l, void *data, fmap map)
 list *
 list_join(list *l, list *data)
 {
+       if (!l)
+               return data;
        assert(data->sa);
        assert(data->sa == l->sa);
        assert(!l->ht);
diff --git a/sql/server/CMakeLists.txt b/sql/server/CMakeLists.txt
--- a/sql/server/CMakeLists.txt
+++ b/sql/server/CMakeLists.txt
@@ -51,7 +51,6 @@ target_sources(sqlserver
   rel_optimize_others.c
   rel_optimize_proj.c
   rel_optimize_sel.c
-  rel_planner.c rel_planner.h
   rel_distribute.c
   rel_remote.c rel_remote.h
   rel_propagate.c rel_propagate.h
diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -3392,6 +3392,28 @@ exp_copy(mvc *sql, sql_exp * e)
        return ne;
 }
 
+list *
+exps_refs(mvc *sql, list *exps)
+{
+       if (mvc_highwater(sql)) {
+               return sql_error(sql, 10, SQLSTATE(42000) "Query too complex: 
running out of stack space");
+       }
+       if (!exps) {
+               return NULL;
+       }
+       list *nexps = new_exp_list(sql->sa);
+       for (node *n = exps->h; n; n = n->next) {
+               sql_exp *arg = n->data;
+
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to