Changeset: 04368664c4f4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/04368664c4f4
Modified Files:
        MonetDB.spec
        sql/server/rel_select.c
Branch: default
Log Message:

Merge with Dec2025 branch.


diffs (truncated from 396 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -1520,6 +1520,20 @@ rm "${RPM_BUILD_ROOT}"%{_unitdir}/monetd
   using the arena allocator.
 - sql: Unused helper function mapiuri_database() has been removed from
   rel_remote.h.
+- mapilib: msettings can now be allocated with a custom memory allocator using
+  msettings_create_with() and msettings_clone_with().  This is used in
+  the SQL module to allocate them using the arena allocator.
+- mapilib: The msettings objects no longer keep track of 'ignored' settings.
+  Function msetting_set_ignored has been removed.
+- mapilib: Function msetting_as_string() has been changed to never return a 
newly
+  allocated string.  To make this possible the user now has to pass in
+  a small scratch buffer that will be used if the setting is a number.
+  (booleans and strings can use existing strings).
+- mapilib: Functions msettings_parse_url() and msettings_validate() have been
+  modified to return any error message instead of setting it through a
+  pointer parameter.
+- mapilib: Function msettings_write_url() has been added to render an msettings
+  object as a URL string.
 
 * Mon Jan 13 2025 Sjoerd Mullender <[email protected]> - 11.53.1-20250317
 - monetdb5: Removed function bat.attach since it wasn't used.
diff --git a/clients/mapilib/ChangeLog-Archive 
b/clients/mapilib/ChangeLog-Archive
--- a/clients/mapilib/ChangeLog-Archive
+++ b/clients/mapilib/ChangeLog-Archive
@@ -1,6 +1,22 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Wed Jan 29 2025 Joeri van Ruth <[email protected]> - 
11.53.1-20250317
+- msettings can now be allocated with a custom memory allocator using
+  msettings_create_with() and msettings_clone_with().  This is used in
+  the SQL module to allocate them using the arena allocator.
+- The msettings objects no longer keep track of 'ignored' settings.
+  Function msetting_set_ignored has been removed.
+- Function msetting_as_string() has been changed to never return a newly
+  allocated string.  To make this possible the user now has to pass in
+  a small scratch buffer that will be used if the setting is a number.
+  (booleans and strings can use existing strings).
+- Functions msettings_parse_url() and msettings_validate() have been
+  modified to return any error message instead of setting it through a
+  pointer parameter.
+- Function msettings_write_url() has been added to render an msettings
+  object as a URL string.
+
 * Wed Jun 19 2024 Joeri van Ruth <[email protected]> - 
11.51.1-20240812
 - Add new columns to sys.sessions. Column 'language' is usually 'sql'.
   Column 'peer' is the network address of the client (something like
diff --git a/clients/mapilib/ChangeLog.odbc_loader 
b/clients/mapilib/ChangeLog.odbc_loader
deleted file mode 100644
--- a/clients/mapilib/ChangeLog.odbc_loader
+++ /dev/null
@@ -1,19 +0,0 @@
-# ChangeLog file for mapilib
-# This file is updated with Maddlog
-
-* Wed Jan 29 2025 Joeri van Ruth <[email protected]>
-- msettings can now be allocated with a custom memory allocator using
-  msettings_create_with() and msettings_clone_with().  This is used in
-  the SQL module to allocate them using the arena allocator.
-- The msettings objects no longer keep track of 'ignored' settings.
-  Function msetting_set_ignored has been removed.
-- Function msetting_as_string() has been changed to never return a newly
-  allocated string.  To make this possible the user now has to pass in
-  a small scratch buffer that will be used if the setting is a number.
-  (booleans and strings can use existing strings).
-- Functions msettings_parse_url() and msettings_validate() have been
-  modified to return any error message instead of setting it through a
-  pointer parameter.
-- Function msettings_write_url() has been added to render an msettings
-  object as a URL string.
-
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -603,6 +603,20 @@ monetdb (11.53.1) unstable; urgency=low
     using the arena allocator.
   * sql: Unused helper function mapiuri_database() has been removed from
     rel_remote.h.
+  * mapilib: msettings can now be allocated with a custom memory allocator 
using
+    msettings_create_with() and msettings_clone_with().  This is used in
+    the SQL module to allocate them using the arena allocator.
+  * mapilib: The msettings objects no longer keep track of 'ignored' settings.
+    Function msetting_set_ignored has been removed.
+  * mapilib: Function msetting_as_string() has been changed to never return a 
newly
+    allocated string.  To make this possible the user now has to pass in
+    a small scratch buffer that will be used if the setting is a number.
+    (booleans and strings can use existing strings).
+  * mapilib: Functions msettings_parse_url() and msettings_validate() have been
+    modified to return any error message instead of setting it through a
+    pointer parameter.
+  * mapilib: Function msettings_write_url() has been added to render an 
msettings
+    object as a URL string.
 
  -- Joeri van Ruth <[email protected]>  Wed, 29 Jan 2025 
11:38:46 +0100
 
diff --git a/monetdb5/mal/CMakeLists.txt b/monetdb5/mal/CMakeLists.txt
--- a/monetdb5/mal/CMakeLists.txt
+++ b/monetdb5/mal/CMakeLists.txt
@@ -10,6 +10,7 @@
 
 set(mal_public_headers
   ${CMAKE_CURRENT_SOURCE_DIR}/mal.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/mal_arguments.h
   ${CMAKE_CURRENT_SOURCE_DIR}/mal_authorize.h
   ${CMAKE_CURRENT_SOURCE_DIR}/mal_client.h
   ${CMAKE_CURRENT_SOURCE_DIR}/mal_errors.h
diff --git a/monetdb5/mal/mal_arguments.h b/monetdb5/mal/mal_arguments.h
new file mode 100644
--- /dev/null
+++ b/monetdb5/mal/mal_arguments.h
@@ -0,0 +1,124 @@
+/*
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * For copyright information, see the file debian/copyright.
+ */
+
+#ifndef _MAL_ARGUMENTS_H
+#define _MAL_ARGUMENTS_H
+
+#include "mal_client.h"
+
+#if !defined(NDEBUG) && defined(__GNUC__)
+/* for ease of programming and debugging (assert reporting a useful
+ * location), we use a GNU C extension to check the type of arguments,
+ * and of course only when assertions are enabled */
+#define getArgReference_TYPE(s, pci, k, TYPE)                                  
\
+       ({                                                                      
                                                \
+               assert((s)->stk[(pci)->argv[k]].vtype == TYPE_##TYPE);  \
+               (TYPE *) getArgReference((s), (pci), (k));                      
        \
+       })
+#define getArgReference_msk(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_msk);                           \
+               &v->val.mval;                                                   
        \
+       })
+#define getArgReference_bit(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_bit);                           \
+               (bit *) &v->val.btval;                                          
\
+       })
+#define getArgReference_sht(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_sht);                           \
+               &v->val.shval;                                                  
        \
+       })
+#define getArgReference_bat(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->bat);                                                 
        \
+               &v->val.bval;                                                   
        \
+       })
+#define getArgReference_int(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_int);                           \
+               &v->val.ival;                                                   
        \
+       })
+#define getArgReference_bte(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_bte);                           \
+               &v->val.btval;                                                  
        \
+       })
+#define getArgReference_oid(s, pci, k)                                         
        \
+       ({                                                                      
                                                \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];                       
        \
+               assert(v->vtype == TYPE_oid || v->vtype == TYPE_void);  \
+               &v->val.oval;                                                   
                                \
+       })
+#define getArgReference_ptr(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_ptr);                           \
+               &v->val.pval;                                                   
        \
+       })
+#define getArgReference_flt(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_flt);                           \
+               &v->val.fval;                                                   
        \
+       })
+#define getArgReference_dbl(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_dbl);                           \
+               &v->val.dval;                                                   
        \
+       })
+#define getArgReference_lng(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_lng);                           \
+               &v->val.lval;                                                   
        \
+       })
+#ifdef HAVE_HGE
+#define getArgReference_hge(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_hge);                           \
+               &v->val.hval;                                                   
        \
+       })
+#endif
+#define getArgReference_str(s, pci, k)                         \
+       ({                                                                      
                        \
+               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
+               assert(v->vtype == TYPE_str);                           \
+               &v->val.sval;                                                   
        \
+       })
+#else
+#define getArgReference_TYPE(s, pci, k, TYPE)  ((TYPE *) getArgReference(s, 
pci, k))
+#define getArgReference_msk(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.mval)
+#define getArgReference_bit(s, pci, k) ((bit *) 
&(s)->stk[(pci)->argv[k]].val.btval)
+#define getArgReference_sht(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.shval)
+#define getArgReference_bat(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.bval)
+#define getArgReference_int(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.ival)
+#define getArgReference_bte(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.btval)
+#define getArgReference_oid(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.oval)
+#define getArgReference_ptr(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.pval)
+#define getArgReference_flt(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.fval)
+#define getArgReference_dbl(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.dval)
+#define getArgReference_lng(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.lval)
+#ifdef HAVE_HGE
+#define getArgReference_hge(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.hval)
+#endif
+#define getArgReference_str(s, pci, k) (&(s)->stk[(pci)->argv[k]].val.sval)
+#endif
+
+#endif
diff --git a/monetdb5/mal/mal_interpreter.h b/monetdb5/mal/mal_interpreter.h
--- a/monetdb5/mal/mal_interpreter.h
+++ b/monetdb5/mal/mal_interpreter.h
@@ -18,6 +18,7 @@
 
 #include "mal_client.h"
 #include "mal_profiler.h"
+#include "mal_arguments.h"
 
 /*
  * Activation of a thread requires construction of the argument list
@@ -39,112 +40,5 @@ mal_export void garbageCollector(Client 
                                                                 int flag);
 
 mal_export ptr getArgReference(MalStkPtr stk, InstrPtr pci, int k);
-#if !defined(NDEBUG) && defined(__GNUC__)
-/* for ease of programming and debugging (assert reporting a useful
- * location), we use a GNU C extension to check the type of arguments,
- * and of course only when assertions are enabled */
-#define getArgReference_TYPE(s, pci, k, TYPE)                                  
\
-       ({                                                                      
                                                \
-               assert((s)->stk[(pci)->argv[k]].vtype == TYPE_##TYPE);  \
-               (TYPE *) getArgReference((s), (pci), (k));                      
        \
-       })
-#define getArgReference_msk(s, pci, k)                         \
-       ({                                                                      
                        \
-               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
-               assert(v->vtype == TYPE_msk);                           \
-               &v->val.mval;                                                   
        \
-       })
-#define getArgReference_bit(s, pci, k)                         \
-       ({                                                                      
                        \
-               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
-               assert(v->vtype == TYPE_bit);                           \
-               (bit *) &v->val.btval;                                          
\
-       })
-#define getArgReference_sht(s, pci, k)                         \
-       ({                                                                      
                        \
-               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
-               assert(v->vtype == TYPE_sht);                           \
-               &v->val.shval;                                                  
        \
-       })
-#define getArgReference_bat(s, pci, k)                         \
-       ({                                                                      
                        \
-               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
-               assert(v->bat);                                                 
        \
-               &v->val.bval;                                                   
        \
-       })
-#define getArgReference_int(s, pci, k)                         \
-       ({                                                                      
                        \
-               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
-               assert(v->vtype == TYPE_int);                           \
-               &v->val.ival;                                                   
        \
-       })
-#define getArgReference_bte(s, pci, k)                         \
-       ({                                                                      
                        \
-               ValRecord *v = &(s)->stk[(pci)->argv[k]];       \
-               assert(v->vtype == TYPE_bte);                           \
-               &v->val.btval;                                                  
        \
-       })
-#define getArgReference_oid(s, pci, k)                                         
        \
-       ({                                                                      
                                                \
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to