Changeset: 5c8a8f87a055 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5c8a8f87a055
Modified Files:
        clients/Tests/exports.stable.out
        gdk/gdk.h
        gdk/gdk_bat.c
        gdk/gdk_private.h
        gdk/gdk_string.c
        gdk/gdk_utils.c
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_session.c
        monetdb5/modules/atoms/json.c
        monetdb5/modules/atoms/str.c
        monetdb5/modules/mal/txtsim.c
        monetdb5/optimizer/opt_emptybind.c
        monetdb5/optimizer/opt_mitosis.c
        sql/backends/monet5/UDF/capi/capi.c
        sql/backends/monet5/UDF/pyapi3/conversion3.c
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_statement.c
        sql/common/sql_list.c
        sql/include/sql_list.h
        sql/rel.txt
        sql/server/rel_distribute.c
        sql/server/rel_dump.c
        sql/server/rel_exp.c
        sql/server/rel_exp.h
        sql/server/rel_optimize_others.c
        sql/server/rel_optimize_proj.c
        sql/server/rel_optimize_sel.c
        sql/server/rel_optimizer_private.h
        sql/server/rel_propagate.c
        sql/server/rel_rel.c
        sql/server/rel_rel.h
        sql/server/rel_rewriter.c
        sql/server/rel_rewriter.h
        sql/server/rel_schema.c
        sql/server/rel_select.c
        sql/server/rel_statistics.c
        sql/server/rel_unnest.c
        sql/server/rel_updates.c
        sql/server/sql_parser.y
        sql/storage/bat/bat_storage.c
        sql/storage/store.c
Branch: resource_management
Log Message:

merge with default


diffs (truncated from 16494 to 300 lines):

diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml 
b/.github/ISSUE_TEMPLATE/bug_report.yml
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -59,3 +59,24 @@ body:
         Add any other context or screenshots about the problem here.
     validations:
       required: false
+  - type: markdown
+    attributes:
+      value: "Identity Disclosure:"
+  - type: input
+    attributes:
+      label: "Full Name:"
+      placeholder: e.g., Jane Doe
+    validations:
+      required: true
+  - type: input
+    attributes:
+      label: "Affiliation:"
+      placeholder: e.g., FooBar Corp
+    validations:
+      required: true
+  - type: markdown
+    attributes:
+      value: |
+        If the above is not given and is not obvious from your GitHub profile 
page,
+        we might close your issue without further review. Please refer to the
+        [reasoning behind this 
rule](https://berthub.eu/articles/posts/anonymous-help/) if you have questions.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml 
b/.github/ISSUE_TEMPLATE/feature_request.yml
--- a/.github/ISSUE_TEMPLATE/feature_request.yml
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -34,3 +34,24 @@ body:
         Add any other context or screenshots about the feature request here.
     validations:
       required: false
+  - type: markdown
+    attributes:
+      value: "Identity Disclosure:"
+  - type: input
+    attributes:
+      label: "Full Name:"
+      placeholder: e.g., Jane Doe
+    validations:
+      required: true
+  - type: input
+    attributes:
+      label: "Affiliation:"
+      placeholder: e.g., FooBar Corp
+    validations:
+      required: true
+  - type: markdown
+    attributes:
+      value: |
+        If the above is not provided and cannot be inferred from your GitHub 
profile page,
+        we might close your issue without further review. Refer to the
+        [reasoning behind this 
rule](https://berthub.eu/articles/posts/anonymous-help/) if you have questions.
diff --git a/.github/ISSUE_TEMPLATE/other_issue.yml 
b/.github/ISSUE_TEMPLATE/other_issue.yml
--- a/.github/ISSUE_TEMPLATE/other_issue.yml
+++ b/.github/ISSUE_TEMPLATE/other_issue.yml
@@ -26,3 +26,24 @@ body:
         Add any other context or screenshots about the problem here.
     validations:
       required: false
+  - type: markdown
+    attributes:
+      value: "Identity Disclosure:"
+  - type: input
+    attributes:
+      label: "Full Name:"
+      placeholder: e.g., Jane Doe
+    validations:
+      required: true
+  - type: input
+    attributes:
+      label: "Affiliation:"
+      placeholder: e.g., FooBar Corp
+    validations:
+      required: true
+  - type: markdown
+    attributes:
+      value: |
+        If the above is not provided and cannot be inferred from your GitHub 
profile page,
+        we might close your issue without further review. Refer to the
+        [reasoning behind this 
rule](https://berthub.eu/articles/posts/anonymous-help/) if you have questions.
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
+* Mon Apr 28 2025 Niels Nes <[email protected]>
+- Changed the way complex AND and OR expressions are handled. The new
+  expression tree uses 2 new cmp flag (cmp_con/cmp_dis), both expressions
+  hold lists of expressions. This structure reduces the need for stack
+  space, allowing way larger expressions trees to be handled.
+
diff --git a/ChangeLog.Mar2025 b/ChangeLog.Mar2025
--- a/ChangeLog.Mar2025
+++ b/ChangeLog.Mar2025
@@ -1,3 +1,9 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
+* Thu May  8 2025 Sjoerd Mullender <[email protected]>
+- It is now possible to specify an idle timeout using --set
+  idle_timeout=<seconds> (see mserver5 manual page) which gets triggered
+  if a connection to the server is idle (i.e. does not send any queries
+  to the server) while there is a SQL transaction active.
+
diff --git a/clients/ChangeLog.Mar2025 b/clients/ChangeLog.Mar2025
--- a/clients/ChangeLog.Mar2025
+++ b/clients/ChangeLog.Mar2025
@@ -1,3 +1,22 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Tue Jun  3 2025 Sjoerd Mullender <[email protected]>
+- When connecting to a database, if there are multiple monetdbd servers
+  running, mclient will try them all, and also both UNIX domain
+  sockets and then TCP, in order to find a server that accepts the
+  connection.  However, when a server that handles the requested
+  database does exist but refuses the connection for some other
+  reason, mclient would continue searching.  This has now been
+  changed.  If monetdbd reports an error other than database unknown,
+  mclient will now stop looking and report the error.  This is
+  actually a change in the "mapi" library, so any program using the
+  library gets the new behavior.
+- There is a new option --quiet (or just -q) in mclient.  If used, the
+  welcome message that is normally printed in an interactive invocation
+  is suppressed.
+
+* Fri May  9 2025 Sjoerd Mullender <[email protected]>
+- There is now a \dm command in the interactive mclient to show
+  information about merge tables.
+
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -569,6 +569,7 @@ const ptr ptr_nil;
 void *sa_alloc(allocator *sa, size_t sz);
 void sa_close(allocator *sa);
 void sa_destroy(allocator *sa);
+exception_buffer *sa_get_eb(allocator *sa) __attribute__((__pure__));
 void sa_free(allocator *sa, void *);
 void sa_open(allocator *sa);
 void *sa_realloc(allocator *sa, void *ptr, size_t sz, size_t osz);
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -157,7 +157,7 @@ descape(const char *s)
        return d;
 }
 
-static char *
+char *
 sescape(const char *s)
 {
        const char *p;
diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -452,16 +452,16 @@ Dump the given
 \fB\[rs]d\fP
 Alias for \[rs]dvt.
 .TP
-\fB\[rs]d[Stvsfn]+\fP
+\fB\[rs]d[Stvmsfn]+\fP
 List database objects of the given type.
 Multiple type specifiers can be used at the same time.
-The specifiers \fIS\fP, \fIt\fP, \fIv\fP, \fIs\fP, \fIf\fP and \fIn\fP
-stand for System, table, view, sequence, function and schema
+The specifiers \fBS\fP, \fBt\fP, \fBv\fP, \fBm\fP, \fBs\fP, \fBf\fP and \fBn\fP
+stand for System, table, view, merge table, sequence, function and schema
 respectively.
-Note that \fIS\fP simply switches on viewing system catalog objects,
+Note that \fBS\fP simply switches on viewing system catalog objects,
 which is orthogonal to the other specifiers.
 .TP
-\fB\[rs]d[Stvsfn]+\fP \fIobject\fP
+\fB\[rs]d[Stvsfnm]+\fP \fIobject\fP
 Describe the given
 .I object
 in the database using SQL statements that reconstruct the object.
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -38,6 +38,7 @@
 #include "msqldump.h"
 #include "mprompt.h"
 #include "mutils.h"            /* mercurial_revision */
+#include "mstring.h"
 #include "dotmonetdb.h"
 
 #include <locale.h>
@@ -2151,6 +2152,7 @@ showCommands(void)
 #define MD_SEQ      4
 #define MD_FUNC     8
 #define MD_SCHEMA  16
+#define MD_MERGE   32
 
 #define READBLOCK 8192
 
@@ -2438,7 +2440,6 @@ doFile(Mapi mid, stream *fp, bool useins
                                        continue;
                                case 'd': {
                                        bool hasWildcard = false;
-                                       bool hasSchema = false;
                                        bool wantsSystem = false;
                                        unsigned int x = 0;
                                        char *p, *q;
@@ -2466,6 +2467,9 @@ doFile(Mapi mid, stream *fp, bool useins
                                                case 'n':
                                                        x |= MD_SCHEMA;
                                                        break;
+                                               case 'm':
+                                                       x |= MD_MERGE;
+                                                       break;
                                                case 'S':
                                                        wantsSystem = true;
                                                        break;
@@ -2484,6 +2488,8 @@ doFile(Mapi mid, stream *fp, bool useins
                                                ;
 
                                        /* lowercase the object, except for 
quoted parts */
+                                       char *tname = NULL;
+                                       char *sname = NULL;
                                        q = line;
                                        for (p = line; *p != '\0'; p++) {
                                                if (*p == '"') {
@@ -2498,6 +2504,8 @@ doFile(Mapi mid, stream *fp, bool useins
                                                                escaped = true;
                                                        }
                                                } else {
+                                                       if (tname == NULL)
+                                                               tname = p;
                                                        if (!escaped) {
                                                                *q++ = 
tolower((int) *p);
                                                                if (*p == '*') {
@@ -2507,7 +2515,9 @@ doFile(Mapi mid, stream *fp, bool useins
                                                                        *p = 
'_';
                                                                        
hasWildcard = true;
                                                                } else if (*p 
== '.') {
-                                                                       
hasSchema = true;
+                                                                       *p = 
'\0';
+                                                                       sname = 
tname;
+                                                                       tname = 
NULL;
                                                                }
                                                        } else {
                                                                *q++ = *p;
@@ -2521,26 +2531,181 @@ doFile(Mapi mid, stream *fp, bool useins
                                                continue;
                                        }
 
-                                       if (*line && !hasWildcard) {
+                                       if (x & MD_MERGE) {
+                                               const char mquery[] = "select 
s1.name as s1name,"
+                                                       " t1.name as t1name,"
+                                                       " c1.name as c1name,"
+                                                       " s2.name as s2name,"
+                                                       " t2.name as t2name,"
+                                                       " tp.expression,"
+                                                       " tp.type,"
+                                                       " 
''''||replace(rp.minimum, '''', '''''')||'''' as minimum,"
+                                                       " 
''''||replace(rp.maximum, '''', '''''')||'''' as maximum,"
+                                                       " rp.with_nulls,"
+                                                       " 
'('||group_concat(''''||replace(vp.value, '''', '''''')||'''', ',' order by 
vp.value)||')' as values,"
+                                                       " count(vp.value) <> 
count(*) as has_nulls"
+                                                       " from sys.schemas as 
s1,"
+                                                       " sys._tables as t1 
left outer join sys.table_partitions as tp on t1.id = tp.table_id left outer 
join sys._columns as c1 on tp.column_id = c1.id,"
+                                                       " sys.schemas as s2,"
+                                                       " sys._tables as t2 
left outer join sys.range_partitions as rp on t2.id = rp.table_id left outer 
join sys.value_partitions as vp on t2.id = vp.table_id,"
+                                                       " sys.dependencies as d"
+                                                       " where%s%s"
+                                                       " t1.type = 3 and"
+                                                       " s1.id = t1.schema_id 
and"
+                                                       " s2.id = t2.schema_id 
and"
+                                                       " t1.id = d.depend_id 
and"
+                                                       " d.id = t2.id"
+                                                       " group by s1.name, 
t1.name, s2.name, t2.name, c1.name, tp.expression, tp.type, rp.minimum, 
rp.maximum, rp.with_nulls"
+                                                       " order by s1.name, 
t1.name, s2.name, t2.name";
+                                               char *squery = NULL;
+                                               size_t squerylen = 0;
+                                               char *tquery = NULL;
+                                               size_t tquerylen = 0;
+                                               if (sname) {
+                                                       sname = sescape(sname);
+                                                       squerylen = 
strlen(sname) + 21;
+                                                       squery = 
malloc(squerylen);
+                                                       if (hasWildcard)
+                                                               
snprintf(squery, squerylen, " s1.name like '%s' and", sname);
+                                                       else
+                                                               
snprintf(squery, squerylen, " s1.name = '%s' and", sname);
+                                                       free(sname);
+                                                       sname = NULL;
+                                               }
+                                               if (tname) {
+                                                       if (squery == NULL) {
+                                                               squery = 
strdup(" s1.name = current_schema and");
+                                                               squerylen = 
strlen(squery);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to