Changeset: 205cea5cdc4f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/205cea5cdc4f
Modified Files:
        MonetDB.spec
        sql/server/rel_select.c
        
sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
        sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
        sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
        
sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out
        sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out
        sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade/Tests/upgrade.stable.out
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Dec2025 branch.


diffs (truncated from 8320 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -852,3 +852,4 @@ 2842c30252114ac29284da18825ed15f86bc507f
 2842c30252114ac29284da18825ed15f86bc507f Mar2025_SP3_release
 3bc4079f4e74840fe5a946ed084fb439a351049e Dec2025_root
 b4c2936c46f28ad6b3e59ed5a1a844726d521994 Dec2025_1
+b4c2936c46f28ad6b3e59ed5a1a844726d521994 Dec2025_release
diff --git a/ChangeLog-Archive b/ChangeLog-Archive
--- a/ChangeLog-Archive
+++ b/ChangeLog-Archive
@@ -1,6 +1,16 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Tue Dec 16 2025 svetlin <[email protected]> - 
11.55.1-20251209
+- Extended MonetDB’s memory allocator framework from the SQL layer to all
+  layers of the database server. The new memory allocator replaces all
+  malloc() and free() function calls in the MonetDB (server) code base.
+  The main features of the allocator framework include i) efficient
+  processing of large numbers of memory allocation calls, and ii) efficient
+  management of memory to avoid fragmentation. This update also enables
+  fine-grained configuration and monitoring of memory usage per thread,
+  per query, per client, etc.
+
 * Tue Sep 16 2025 Sjoerd Mullender <[email protected]> - 11.55.1-20251209
 - This server is no longer compatible with the MonetDB Stethoscope.
 
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1057,6 +1057,21 @@ rm "${RPM_BUILD_ROOT}"%{_unitdir}/monetd
 %endif
 
 %changelog
+* Tue Dec 16 2025 Lucas Pereira <[email protected]> - 
11.55.1-20251209
+- sql: New implementation for the CONTAINS filter function for string data
+  types using a much faster algorithm based on the knowledge of the
+  bigram occurrences of the to-be-filtered column.
+
+* Tue Dec 16 2025 svetlin <[email protected]> - 
11.55.1-20251209
+- Extended MonetDB’s memory allocator framework from the SQL layer to all
+  layers of the database server. The new memory allocator replaces all
+  malloc() and free() function calls in the MonetDB (server) code base.
+  The main features of the allocator framework include i) efficient
+  processing of large numbers of memory allocation calls, and ii) efficient
+  management of memory to avoid fragmentation. This update also enables
+  fine-grained configuration and monitoring of memory usage per thread,
+  per query, per client, etc.
+
 * Tue Dec 09 2025 Sjoerd Mullender <[email protected]> - 11.55.1-20251209
 - Rebuilt.
 - GH#7635: Unexpected Inner Join Crash
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+monetdb (11.55.1) unstable; urgency=low
+
+  * sql: New implementation for the CONTAINS filter function for string data
+    types using a much faster algorithm based on the knowledge of the
+    bigram occurrences of the to-be-filtered column.
+
+ -- Lucas Pereira <[email protected]>  Tue, 16 Dec 2025 
17:00:00 +0100
+
+  * Extended MonetDB’s memory allocator framework from the SQL layer to all
+    layers of the database server. The new memory allocator replaces all
+    malloc() and free() function calls in the MonetDB (server) code base.
+    The main features of the allocator framework include i) efficient
+    processing of large numbers of memory allocation calls, and ii) efficient
+    management of memory to avoid fragmentation. This update also enables
+    fine-grained configuration and monitoring of memory usage per thread,
+    per query, per client, etc.
+
+ -- svetlin <[email protected]>  Tue, 16 Dec 2025 17:00:00 
+0100
+
 monetdb (11.55.1) unstable; urgency=low
 
   * Rebuilt.
diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -9928,6 +9928,7 @@ BATaggrdigest(allocator *ma, BAT **bnp, 
                if (mdctx[gid] == NULL) {
                        mdctx[gid] = EVP_MD_CTX_new();
                        if (mdctx[gid] == NULL || !EVP_DigestInit(mdctx[gid], 
md)) {
+                               GDKerror("Could not initialize digest method 
%s\n", digest);
                                goto bailout;
                        }
                } else if (mdctx[gid] == (EVP_MD_CTX *) -1) {
@@ -9935,6 +9936,7 @@ BATaggrdigest(allocator *ma, BAT **bnp, 
                }
                /* calculate digest including terminating NUL byte */
                if (!EVP_DigestUpdate(mdctx[gid], s, strlen(s) + 1)) {
+                       GDKerror("Could not update digest value.\n");
                        goto bailout;
                }
        }
diff --git a/sql/ChangeLog-Archive b/sql/ChangeLog-Archive
--- a/sql/ChangeLog-Archive
+++ b/sql/ChangeLog-Archive
@@ -1,6 +1,11 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Tue Dec 16 2025 Lucas Pereira <[email protected]> - 
11.55.1-20251209
+- New implementation for the CONTAINS filter function for string data
+  types using a much faster algorithm based on the knowledge of the
+  bigram occurrences of the to-be-filtered column.
+
 * Mon Nov 10 2025 Joeri van Ruth <[email protected]> - 
11.55.1-20251209
 - Add functions to_hex(int) and to_hex(bigint). They return the
   unsigned hexadecimal string representation of their argument.
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -1545,34 +1545,37 @@ rel_column_ref(sql_query *query, sql_rel
        sql_rel *inner = rel?*rel:NULL, *outer = NULL;
        int used_lower_after_processed = 0;
 
-       assert((column_r->token == SQL_COLUMN || column_r->token == SQL_IDENT) 
&& column_r->type == type_list);
+       assert((column_r->token == SQL_COLUMN || column_r->token == SQL_IDENT)
+                  && column_r->type == type_list);
+
        l = column_r->data.lval;
 
        if (dlist_length(l) == 1) {
                const char *name = l->h->data.sval;
                if (!name)
                        return NULL;
-
                if (!exp && inner)
                        if (!(exp = rel_bind_column(sql, inner, name, f, 0)) && 
sql->session->status == -ERR_AMBIGUOUS)
                                return NULL;
                if (!exp && inner && ((is_sql_aggr(f) && (is_groupby(inner->op) 
|| is_select(inner->op))) ||
-                                                    (is_groupby(inner->op) && 
inner->flag))) {
+                                                         
(is_groupby(inner->op) && inner->flag))) {
                        /* if inner is selection, ie having clause, get the 
left relation to reach group by */
                        sql_rel *gp = inner;
                        while (gp && is_select(gp->op))
                                gp = gp->l;
-                       if (gp && !is_basetable(gp->op) && gp->l && !(exp = 
rel_bind_column(sql, gp->l, name, f, 0)) && sql->session->status == 
-ERR_AMBIGUOUS)
+                       if (gp && !is_basetable(gp->op) && gp->l && !(exp = 
rel_bind_column(sql, gp->l, name, f, 0)) &&
+                               sql->session->status == -ERR_AMBIGUOUS)
                                return NULL;
                }
                if (!exp && query && query_has_outer(query)) {
                        int i;
-
-                       for (i=query_has_outer(query)-1; i>= 0 && !exp && 
(outer = query_fetch_outer(query,i)); i--) {
-                               if (!(exp = rel_bind_column(sql, outer, name, 
f, 0)) && sql->session->status == -ERR_AMBIGUOUS)
+                       for (i = query_has_outer(query)-1; i>= 0 && !exp && 
(outer = query_fetch_outer(query,i)); i--) {
+                               if (!(exp = rel_bind_column(sql, outer, name, 
f, 0)) &&
+                                       sql->session->status == -ERR_AMBIGUOUS)
                                        return NULL;
                                if (!exp && is_groupby(outer->op)) {
-                                       if (!(exp = rel_bind_column(sql, 
outer->l, name, f, 0)) && sql->session->status == -ERR_AMBIGUOUS)
+                                       if (!(exp = rel_bind_column(sql, 
outer->l, name, f, 0)) &&
+                                               sql->session->status == 
-ERR_AMBIGUOUS)
                                                return NULL;
                                        else
                                                used_lower_after_processed = 
is_processed(outer);
@@ -1582,16 +1585,24 @@ rel_column_ref(sql_query *query, sql_rel
                                if (exp)
                                        break;
                        }
-                       if (exp && exp->card != CARD_AGGR && 
is_groupby(outer->op) && !is_sql_aggr(f) && rel_find_exp(outer->l, exp))
-                               return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000) "SELECT: cannot use non GROUP BY column '%s' in query results 
without an aggregate function", name);
+                       if (exp && exp->card != CARD_AGGR && 
is_groupby(outer->op) &&
+                               !is_sql_aggr(f) && rel_find_exp(outer->l, exp))
+                               return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000)
+                                                                "SELECT: 
cannot use non GROUP BY column '%s' in query"
+                                                                " results 
without an aggregate function", name);
                        if (exp && outer && outer->card <= CARD_AGGR && 
exp->card > CARD_AGGR && !is_sql_aggr(f))
-                               return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000) "SELECT: cannot use non GROUP BY column '%s' in query results 
without an aggregate function", name);
+                               return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000)
+                                                                "SELECT: 
cannot use non GROUP BY column '%s' in query"
+                                                                " results 
without an aggregate function", name);
                        if (exp && outer && !is_sql_aggr(f) && 
!is_sql_aggr(query_fetch_outer_state(query, i))) {
                                if (used_lower_after_processed || 
query_outer_used_exp( query, i, exp, f)) {
                                        sql_exp *lu = 
used_lower_after_processed?exp:query_outer_last_used(query, i);
                                        if (exp_name(lu) && exp_relname(lu) && 
!has_label(lu))
-                                               return sql_error(sql, 
ERR_GROUPBY, SQLSTATE(42000) "SELECT: subquery uses ungrouped column \"%s.%s\" 
from outer query", exp_relname(lu), exp_name(lu));
-                                       return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000) "SELECT: subquery uses ungrouped column from outer query");
+                                               return sql_error(sql, 
ERR_GROUPBY, SQLSTATE(42000)
+                                                                               
 "SELECT: subquery uses ungrouped column \"%s.%s\""
+                                                                               
 " from outer query", exp_relname(lu), exp_name(lu));
+                                       return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000)
+                                                                        
"SELECT: subquery uses ungrouped column from outer query");
                                }
                        }
                        if (exp) {
@@ -1611,12 +1622,11 @@ rel_column_ref(sql_query *query, sql_rel
                        if (exp && outer && (is_select(outer->op) || 
is_join(outer->op)))
                                set_dependent_(outer);
                }
-
                /* some views are just in the stack, like before and after 
updates views */
                if (rel && sql->use_views) {
                        sql_rel *v = NULL;
-                       int dup = stack_find_rel_view_projection_columns(sql, 
name, &v); /* trigger views are basetables relations, so those may conflict */
-
+                       /* trigger views are basetables relations, so those may 
conflict */
+                       int dup = stack_find_rel_view_projection_columns(sql, 
name, &v);
                        if (dup < 0 || (v && exp && *rel && is_base(v->op) && v 
!= *rel)) /* comparing pointers, ugh */
                                return sql_error(sql, ERR_AMBIGUOUS, 
SQLSTATE(42000) "SELECT: identifier '%s' ambiguous", name);
                        if (v && !exp) {
@@ -1629,18 +1639,24 @@ rel_column_ref(sql_query *query, sql_rel
                }
                if (!exp) /* If no column was found, try a variable or 
parameter */
                        exp = rel_exp_variable_on_scope(sql, NULL, name);
-
                if (!exp) {
-                       if (inner && !is_sql_aggr(f) && is_groupby(inner->op) 
&& inner->l && (exp = rel_bind_column(sql, inner->l, name, f, 0)))
-                               return sql_error(sql, ERR_NOTFOUND, 
SQLSTATE(42000) "SELECT: cannot use non GROUP BY column '%s' in query results 
without an aggregate function", name);
-               }
-
+                       if (inner && !is_sql_aggr(f) && is_groupby(inner->op) 
&& inner->l &&
+                               (exp = rel_bind_column(sql, inner->l, name, f, 
0)))
+                               return sql_error(sql, ERR_NOTFOUND, 
SQLSTATE(42000)
+                                                                "SELECT: 
cannot use non GROUP BY column '%s' in query"
+                                                                " results 
without an aggregate function", name);
+               }
                if (!exp)
-                       return sql_error(sql, ERR_NOTFOUND, SQLSTATE(42000) 
"SELECT: identifier '%s' unknown", name);
-               if (exp && inner && inner->card <= CARD_AGGR && exp->card > 
CARD_AGGR && (is_sql_sel(f) || is_sql_having(f)) && (!is_sql_aggr(f) && 
!(inner->flag)))
-                       return sql_error(sql, ERR_GROUPBY, SQLSTATE(42000) 
"SELECT: cannot use non GROUP BY column '%s' in query results without an 
aggregate function", name);
+                       return sql_error(sql, ERR_NOTFOUND, SQLSTATE(42000)
+                                                        "SELECT: identifier 
'%s' unknown", name);
+               if (exp && inner && inner->card <= CARD_AGGR && exp->card > 
CARD_AGGR &&
+                       (is_sql_sel(f) || is_sql_having(f)) && (!is_sql_aggr(f) 
&& !(inner->flag)))
+                       return sql_error(sql, ERR_GROUPBY, SQLSTATE(42000)
+                                                        "SELECT: cannot use 
non GROUP BY column '%s' in query"
+                                                        " results without an 
aggregate function", name);
                if (exp && inner && is_groupby(inner->op) && !is_sql_aggr(f) && 
!is_freevar(exp) && !inner->flag)
                        exp = rel_groupby_add_aggr(sql, inner, exp);
+
        } else if (dlist_length(l) == 2 || dlist_length(l) == 3) {
                const char *sname = NULL;
                const char *tname = l->h->data.sval;
@@ -1654,24 +1670,32 @@ rel_column_ref(sql_query *query, sql_rel
                        return NULL;
 
                if (!exp && rel && inner)
-                       if (!(exp = rel_bind_column3(sql, inner, sname, tname, 
cname, f)) && sql->session->status == -ERR_AMBIGUOUS)
+                       if (!(exp = rel_bind_column3(sql, inner, sname, tname, 
cname, f)) &&
+                               sql->session->status == -ERR_AMBIGUOUS)
+                               return NULL;
+               if (!exp && inner && is_groupby(inner->op) && inner->flag)
+                       if (!(exp = rel_bind_column3(sql, inner->l, sname, 
tname, cname, f)) &&
+                               sql->session->status == -ERR_AMBIGUOUS)
                                return NULL;
                if (!exp && inner && is_sql_aggr(f) && (is_groupby(inner->op) 
|| is_select(inner->op))) {
-                       /* if inner is selection, ie having clause, get the 
left relation to reach group by */
                        sql_rel *gp = inner;
                        while (gp && is_select(gp->op))
                                gp = gp->l;
-                       if (gp && !is_basetable(gp->op) && gp->l && !(exp = 
rel_bind_column3(sql, gp->l, sname, tname, cname, f)) && sql->session->status 
== -ERR_AMBIGUOUS)
+                       if (gp && !is_basetable(gp->op) && gp->l &&
+                               !(exp = rel_bind_column3(sql, gp->l, sname, 
tname, cname, f)) &&
+                               sql->session->status == -ERR_AMBIGUOUS)
                                return NULL;
                }
                if (!exp && query && query_has_outer(query)) {
                        int i;
 
                        for (i=query_has_outer(query)-1; i>= 0 && !exp && 
(outer = query_fetch_outer(query,i)); i--) {
-                               if (!(exp = rel_bind_column3(sql, outer, sname, 
tname, cname, f | sql_outer)) && sql->session->status == -ERR_AMBIGUOUS)
+                               if (!(exp = rel_bind_column3(sql, outer, sname, 
tname, cname, f | sql_outer)) &&
+                                       sql->session->status == -ERR_AMBIGUOUS)
                                        return NULL;
                                if (!exp && is_groupby(outer->op)) {
-                                       if (!(exp = rel_bind_column3(sql, 
outer->l, sname, tname, cname, f)) && sql->session->status == -ERR_AMBIGUOUS)
+                                       if (!(exp = rel_bind_column3(sql, 
outer->l, sname, tname, cname, f)) &&
+                                               sql->session->status == 
-ERR_AMBIGUOUS)
                                                return NULL;
                                        else
                                                used_lower_after_processed = 
is_processed(outer);
@@ -1681,16 +1705,24 @@ rel_column_ref(sql_query *query, sql_rel
                                if (exp)
                                        break;
                        }
-                       if (exp && exp->card != CARD_AGGR && 
is_groupby(outer->op) && !is_sql_aggr(f) && rel_find_exp(outer->l, exp))
-                               return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000) "SELECT: cannot use non GROUP BY column '%s.%s' in query 
results without an aggregate function", tname, cname);
+                       if (exp && exp->card != CARD_AGGR && 
is_groupby(outer->op) &&
+                               !is_sql_aggr(f) && rel_find_exp(outer->l, exp))
+                               return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000)
+                                                                "SELECT: 
cannot use non GROUP BY column '%s.%s' in"
+                                                                " query 
results without an aggregate function", tname, cname);
                        if (exp && outer && outer->card <= CARD_AGGR && 
exp->card > CARD_AGGR && !is_sql_aggr(f))
-                               return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000) "SELECT: cannot use non GROUP BY column '%s.%s' in query 
results without an aggregate function", tname, cname);
+                               return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000)
+                                                                "SELECT: 
cannot use non GROUP BY column '%s.%s'"
+                                                                " in query 
results without an aggregate function", tname, cname);
                        if (exp && outer && !is_sql_aggr(f)) {
                                if (used_lower_after_processed || 
query_outer_used_exp( query, i, exp, f)) {
                                        sql_exp *lu = 
used_lower_after_processed?exp:query_outer_last_used(query, i);
                                        if (exp_name(lu) && exp_relname(lu) && 
!has_label(lu))
-                                               return sql_error(sql, 
ERR_GROUPBY, SQLSTATE(42000) "SELECT: subquery uses ungrouped column \"%s.%s\" 
from outer query", exp_relname(lu), exp_name(lu));
-                                       return sql_error(sql, ERR_GROUPBY, 
SQLSTATE(42000) "SELECT: subquery uses ungrouped column from outer query");
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to