MonetDB: default - Implemented a -DMONETDB_STATIC=ON option.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: 324a18105e69 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/324a18105e69
Modified Files:
clients/CMakeLists.txt
clients/mapilib/CMakeLists.txt
clients/odbc/driver/CMakeLists.txt
cmake/monetdb-options.cmake
common/options/CMakeLists.txt
common/stream/CMakeLists.txt
common/utils/CMakeLists.txt
ctest/tools/monetdbe/CMakeLists.txt
gdk/CMakeLists.txt
geom/monetdb5/CMakeLists.txt
monetdb5/extras/mal_optimizer_template/CMakeLists.txt
monetdb5/extras/rapi/CMakeLists.txt
monetdb5/modules/kernel/CMakeLists.txt
monetdb5/tools/CMakeLists.txt
sql/backends/monet5/CMakeLists.txt
sql/backends/monet5/generator/CMakeLists.txt
sql/backends/monet5/vaults/csv/CMakeLists.txt
sql/common/CMakeLists.txt
sql/server/CMakeLists.txt
sql/storage/CMakeLists.txt
sql/storage/bat/CMakeLists.txt
tools/CMakeLists.txt
tools/monetdbe/CMakeLists.txt
Branch: default
Log Message:

Implemented a -DMONETDB_STATIC=ON option.
When using cmake options
-DMONETDB_STATIC=ON -DWITH_UDF=OFF -DWITH_VAULTS=OFF
-DWITH_MEROVINGIAN=OFF -DWITH_MSERVER5=OFF -DWITH_MAPI_CLIENT=OFF
the whole thing compiles.  Default is and will remain the opposite of
the above settings.


diffs (truncated from 1000 to 300 lines):

diff --git a/clients/CMakeLists.txt b/clients/CMakeLists.txt
--- a/clients/CMakeLists.txt
+++ b/clients/CMakeLists.txt
@@ -11,7 +11,9 @@
 #]]
 
 add_subdirectory(mapilib)
-add_subdirectory(mapiclient)
+if(WITH_MAPI_CLIENT)
+  add_subdirectory(mapiclient)
+endif()
 add_subdirectory(odbc)
 if(TESTING)
   add_subdirectory(examples)
diff --git a/clients/mapilib/CMakeLists.txt b/clients/mapilib/CMakeLists.txt
--- a/clients/mapilib/CMakeLists.txt
+++ b/clients/mapilib/CMakeLists.txt
@@ -10,9 +10,11 @@
 # Copyright 1997 - July 2008 CWI.
 #]]
 
-add_library(mapi
-  SHARED)
-
+if(MONETDB_STATIC)
+  add_library(mapi STATIC)
+else()
+  add_library(mapi SHARED)
+endif()
 
 # We need to add the public library twice to the target sources, once for
 # the build interface and once for the install interface. This is because
@@ -92,11 +94,13 @@ install(TARGETS
   COMPONENT clientdev
   INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 
-install(EXPORT mapiTargets
-  FILE mapiTargets.cmake
-  NAMESPACE MonetDB::
-  DESTINATION ${EXPORT_TARGET_PATH}
-  COMPONENT clientdev)
+if(NOT MONETDB_STATIC)
+  install(EXPORT mapiTargets
+FILE mapiTargets.cmake
+NAMESPACE MonetDB::
+DESTINATION ${EXPORT_TARGET_PATH}
+COMPONENT clientdev)
+endif()
 
 if(WIN32)
   install(FILES
diff --git a/clients/odbc/driver/CMakeLists.txt 
b/clients/odbc/driver/CMakeLists.txt
--- a/clients/odbc/driver/CMakeLists.txt
+++ b/clients/odbc/driver/CMakeLists.txt
@@ -14,8 +14,11 @@ if (${HAVE_ODBCINST})
   add_compile_definitions(HAVE_SQLGETPRIVATEPROFILESTRING)
 endif()
 
-add_library(MonetODBC
-  MODULE)
+if(MONETDB_STATIC)
+  add_library(MonetODBC STATIC)
+else()
+  add_library(MonetODBC MODULE)
+endif()
 
 target_sources(MonetODBC
   PRIVATE
diff --git a/cmake/monetdb-options.cmake b/cmake/monetdb-options.cmake
--- a/cmake/monetdb-options.cmake
+++ b/cmake/monetdb-options.cmake
@@ -156,3 +156,27 @@ option(CMAKE_SUMMARY
 option(CMAKE_UNITTESTS
   "Build and run the unittest for the build system"
   OFF)
+
+option(MONETDB_STATIC
+  "Enable static compilation mode"
+  OFF)
+
+option(WITH_UDF
+  "Include UDF support"
+  ON)
+
+option(WITH_VAULTS
+  "Include UDF support"
+  ON)
+
+option(WITH_MEROVINGIAN
+  "Build merovingian and friends"
+  ON)
+
+option(WITH_MSERVER5
+  "Build mserver5"
+  ON)
+
+option(WITH_MAPI_CLIENT
+  "Build mapi clients(mclient, msqldump)"
+  ON)
diff --git a/common/options/CMakeLists.txt b/common/options/CMakeLists.txt
--- a/common/options/CMakeLists.txt
+++ b/common/options/CMakeLists.txt
@@ -35,10 +35,12 @@ target_link_libraries(moptions
   monetdb_config_header
   $<$:${GETOPT_LIB}>)
 
-set_target_properties(moptions
-  PROPERTIES
-  POSITION_INDEPENDENT_CODE ON
-  PUBLIC_HEADER "${moptions_public_headers}")
+if(NOT MONETDB_STATIC)
+  set_target_properties(moptions
+PROPERTIES
+POSITION_INDEPENDENT_CODE ON
+PUBLIC_HEADER "${moptions_public_headers}")
+endif()
 
 install(FILES
   monet_options.h
@@ -46,3 +48,18 @@ install(FILES
   DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monetdb
   COMPONENT
   monetdbdev)
+
+if(MONETDB_STATIC)
+  install(TARGETS
+moptions
+COMPONENT monetdbdev
+RUNTIME
+DESTINATION ${CMAKE_INSTALL_BINDIR}
+LIBRARY
+DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ARCHIVE
+DESTINATION ${CMAKE_INSTALL_LIBDIR}
+PUBLIC_HEADER
+DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monetdb
+INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+endif()
diff --git a/common/stream/CMakeLists.txt b/common/stream/CMakeLists.txt
--- a/common/stream/CMakeLists.txt
+++ b/common/stream/CMakeLists.txt
@@ -16,8 +16,11 @@ set(stream

MonetDB: default - Print time in a more understandable way.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: 2e74b023dfee for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2e74b023dfee
Modified Files:
monetdb5/mal/mal_runtime.c
Branch: default
Log Message:

Print time in a more understandable way.


diffs (21 lines):

diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c
--- a/monetdb5/mal/mal_runtime.c
+++ b/monetdb5/mal/mal_runtime.c
@@ -326,11 +326,15 @@ runtimeProfileFinish(Client cntxt, MalBl
for (i = 0; i < qsize; i++) {
// print some info. of queries not "finished"
if (strcmp(QRYqueue[i].status, "finished") != 
0) {
+   struct tm tmp;
+   char tbuf[64];
+   (void) localtime_r(&QRYqueue[i].start, 
&tmp);
+   strftime(tbuf, sizeof(tbuf), "%F %T", 
&tmp);
TRC_INFO_ENDIF(MAL_SERVER,
   
"QRYqueue[%zu]: stk(%p), tag(" OIDFMT
-  "), 
username(%s), start(%ld), status(%s), query(%s)",
+  "), 
username(%s), start(%s), status(%s), query(%s)",
   i, 
QRYqueue[i].stk, QRYqueue[i].tag,
-  
QRYqueue[i].username, QRYqueue[i].start,
+  
QRYqueue[i].username, tbuf,
   
QRYqueue[i].status, QRYqueue[i].query);
}
}
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: monetdbe_static - Closing branch monetdbe_static.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: 15c918de0ef2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/15c918de0ef2
Branch: monetdbe_static
Log Message:

Closing branch monetdbe_static.

___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: recursive_cte - Test requires hugeint.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: 715095cae3e1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/715095cae3e1
Modified Files:
sql/test/cte/Tests/recursive_cte_complex_pipelines.test
Branch: recursive_cte
Log Message:

Test requires hugeint.


diffs (11 lines):

diff --git a/sql/test/cte/Tests/recursive_cte_complex_pipelines.test 
b/sql/test/cte/Tests/recursive_cte_complex_pipelines.test
--- a/sql/test/cte/Tests/recursive_cte_complex_pipelines.test
+++ b/sql/test/cte/Tests/recursive_cte_complex_pipelines.test
@@ -18,6 +18,7 @@ 81
 243
 
 # what if we have different types?
+onlyif has-hugeint
 query I nosort
 WITH RECURSIVE t AS
 (
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: recursive_cte - merged with default

2024-12-16 Thread Niels Nes via checkin-list
Changeset: 8bb215918248 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8bb215918248
Modified Files:
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/sql_statement.h
sql/include/sql_relation.h
sql/server/rel_dump.c
sql/server/rel_optimize_sel.c
sql/server/rel_select.c
sql/server/rel_unnest.c
sql/server/sql_mvc.h
sql/server/sql_parser.y
sql/server/sql_scan.c
Branch: recursive_cte
Log Message:

merged with default


diffs (truncated from 9264 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -835,3 +835,4 @@ dce400b68239412b1835fb28bd183bf50f5e8692
 dce400b68239412b1835fb28bd183bf50f5e8692 Aug2024_release
 ab5d60be21cd1c65e9de476d71a86c2995f70785 Aug2024_5
 ab5d60be21cd1c65e9de476d71a86c2995f70785 Aug2024_SP1_release
+30e6380820842b9e0325536eb22d7cb3843ab095 Aug2024_7
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -95,7 +95,7 @@ Group: Applications/Databases
 License: MPL-2.0
 URL: https://www.monetdb.org/
 BugURL: https://github.com/MonetDB/MonetDB/issues
-Source: 
https://www.monetdb.org/downloads/sources/Aug2024-SP1/MonetDB-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Aug2024-SP2/MonetDB-%{version}.tar.bz2
 
 # The Fedora packaging document says we need systemd-rpm-macros for
 # the _unitdir and _tmpfilesdir macros to exist; however on RHEL 7
@@ -989,6 +989,26 @@ rm "${RPM_BUILD_ROOT}"%{_unitdir}/monetd
 %endif
 
 %changelog
+* Mon Dec 16 2024 Sjoerd Mullender  - 11.51.7-20241216
+- Rebuilt.
+- GH#7112: Need keyboard shortcut to interrupt query execution rather than
+  session
+- GH#7205: Unpredictable performance when performing joins over nested
+  queries
+- GH#7574: Assertion failure at `rel2bin_select` when using `STARTSWITH`
+- GH#7588: incorrect output with single row inputs for var_samp(c) over()
+- GH#7589: "SELECT * FROM sessions" crashes monetdb/e
+- GH#7593: A value is being returned with unnecessary scientific notation
+- GH#7595: SQLTestCase leaks pymonetdb connections
+- GH#7597: Upgrade + quick restart causes database inconsistency
+- GH#7599: str_to_date fails when combined with SQL CASE clause
+- GH#7602: COPY INTO from multiple files causes an assertion error.
+- GH#7603: COPY INTO from three or more files crashes the server.
+- GH#7604: file_loader() causes server crash when csv file contains too
+  few field separators or contains empty lines
+- GH#7607: Adding a column of serial type fails with "Access denied for
+   to schema 'sys'"
+
 * Thu Oct 24 2024 Sjoerd Mullender  - 11.51.5-20241024
 - Rebuilt.
 - GH#7281: UDFs defined at compile time in a user schema should not become
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
@@ -1035,6 +1035,7 @@ const char grant_rolesRef[];
 const char groupRef[];
 const char groupbyRef[];
 const char groupdoneRef[];
+const char groupedfirstnRef[];
 const char growRef[];
 int hasSideEffects(MalBlkPtr mb, InstrPtr p, int strict);
 const char hgeRef[];
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -44,7 +44,7 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # common/options and common/utils)
 set(GDK_VERSION_MAJOR "29")
 set(GDK_VERSION_MINOR "0")
-set(GDK_VERSION_PATCH "1")
+set(GDK_VERSION_PATCH "2")
 set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 # version of the MAPI library (subdirectory clients/mapilib)
@@ -57,7 +57,7 @@ set(MAPI_VERSION "${MAPI_VERSION_MAJOR}.
 # extras, and tools/utils/msabaoth.[ch])
 set(MONETDB5_VERSION_MAJOR "36")
 set(MONETDB5_VERSION_MINOR "0")
-set(MONETDB5_VERSION_PATCH "2")
+set(MONETDB5_VERSION_PATCH "3")
 set(MONETDB5_VERSION 
"${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_MINOR}.${MONETDB5_VERSION_PATCH}")
 
 # version of the MONETDBE library (subdirectory tools/monetdbe)
@@ -75,5 +75,5 @@ set(STREAM_VERSION "${STREAM_VERSION_MAJ
 # version of the SQL library (subdirectory sql)
 set(SQL_VERSION_MAJOR "15")
 set(SQL_VERSION_MINOR "0")
-set(SQL_VERSION_PATCH "2")
+set(SQL_VERSION_PATCH "3")
 set(SQL_VERSION 
"${SQL_VERSION_MAJOR}.${SQL_VERSION_MINOR}.${SQL_VERSION_PATCH}")
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,26 @@
+monetdb (11.51.7) unstable; urgency=low
+
+  * Rebuilt.
+  * GH#7112: Need keyboard shortcut to interrupt query execution rather than
+session
+  * GH#7205: Unpredictable performance when performing joins over nested
+queries
+  * GH#7574: Assertion failure at `rel2bin_

MonetDB: resource_management - wip

2024-12-16 Thread svetlin via checkin-list
Changeset: d93e6b8726d1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d93e6b8726d1
Modified Files:
sql/server/rel_dump.c
sql/server/rel_exp.c
sql/server/rel_optimize_sel.c
sql/server/rel_rel.c
sql/server/rel_rel.h
sql/server/rel_select.c
sql/server/rel_unnest.c
Branch: resource_management
Log Message:

wip


diffs (196 lines):

diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c
--- a/sql/server/rel_dump.c
+++ b/sql/server/rel_dump.c
@@ -120,7 +120,7 @@ exp_print(mvc *sql, stream *fout, sql_ex
(void)sql;
if (!e)
return;
-   //mnstr_printf(fout, "%p ", e);
+   // mnstr_printf(fout, "%p ", e);
if (mvc_debug_on(sql, 4) && e->alias.label < 0)
mnstr_printf(fout, "%d: ", e->alias.label);
switch(e->type) {
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
@@ -3940,12 +3940,22 @@ free_exp(allocator *sa, sql_exp *e)
}
break;
case e_cmp:
-   if (e->l)
-   free_exp(sa, e->l);
-   if (e->r)
-   free_exp(sa, e->r);
-   if (e->f)
-   free_exp(sa, e->f);
+   if (e->flag < cmp_filter) {
+   // l and r are exp
+   if (e->l)
+   free_exp(sa, e->l);
+   if (e->r)
+   free_exp(sa, e->r);
+   if (e->f)
+   free_exp(sa, e->f);
+   }
+   if (e->flag == cmp_or || e->flag == cmp_filter) {
+   // l and r are list
+   if (e->l)
+   free_exps_list(sa, e->l);
+   if (e->r)
+   free_exps_list(sa, e->r);
+   }
break;
case e_func:
case e_aggr:
diff --git a/sql/server/rel_optimize_sel.c b/sql/server/rel_optimize_sel.c
--- a/sql/server/rel_optimize_sel.c
+++ b/sql/server/rel_optimize_sel.c
@@ -3208,7 +3208,7 @@ rel_semijoin_use_fk(visitor *v, sql_rel 
 /*
  * Push {semi}joins down, pushes the joins through group by expressions.
  * When the join is on the group by columns, we can push the joins left
- * under the group by. This should only be done, iff the new semijoin would
+ * under the group by. This should only be done, if the new semijoin would
  * reduce the input table to the groupby. So there should be a reduction
  * (selection) on the table A and this should be propagated to the groupby via
  * for example a primary key.
@@ -3636,7 +3636,7 @@ rel_push_select_down(visitor *v, sql_rel
/* merge 2 selects */
r = rel->l;
if (is_select(rel->op) && r && r->exps && is_select(r->op) && 
!(rel_is_ref(r)) && !exps_have_func(rel->exps)) {
-   (void)list_merge(r->exps, rel->exps, (fdup)NULL);
+   (void)list_merge(r->exps, exps_copy(v->sql, rel->exps), 
(fdup)NULL);
rel->l = NULL;
rel_destroy(v->sql, rel);
v->changes++;
diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c
--- a/sql/server/rel_rel.c
+++ b/sql/server/rel_rel.c
@@ -160,7 +160,7 @@ rel_destroy(mvc *sql, sql_rel *rel)
if (!list_empty(rel->exps) && sql && (!rel->l) && (!rel->r)) {
// perhaps separate allocator for exps
// for later
-   // free_exps_list(sql->sa, rel->exps);
+   //free_exps_list(sql->sa, rel->exps);
rel->exps = NULL;
}
 }
@@ -290,7 +290,7 @@ rel_select_copy(allocator *sa, sql_rel *
rel->l = l;
rel->r = NULL;
rel->op = op_select;
-   rel->exps = exps?list_dup(exps, (fdup)NULL):NULL;
+   rel->exps = exps? list_dup(exps, (fdup)NULL) : NULL;
rel->card = CARD_ATOM; /* no relation */
if (l) {
rel->card = l->card;
@@ -1714,7 +1714,7 @@ rel_or(mvc *sql, sql_rel *rel, sql_rel *
assert(!lexps || l == r);
if (l == r && lexps) { /* merge both lists */
sql_exp *e = exp_or(sql->sa, lexps, rexps, 0);
-   list *nl = oexps?oexps:new_exp_list(sql->sa);
+   list *nl = oexps? oexps : new_exp_list(sql->sa);
 
rel_destroy(sql, r);
append(nl, e);
@@ -1727,8 +1727,7 @@ rel_or(mvc *sql, sql_rel *rel, sql_rel *
/* favor or expressions over union */
if (l->op == r->op && is_select(l->op) &&
ll == rl && ll == rel && !rel_is_ref(l) && !rel_is_ref(r)) {
-   // need a copy of r->exps, r will be destroyed
-   

MonetDB: default - Merge ordered-set-aggregates into default.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: 8e4fa53e2f76 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8e4fa53e2f76
Branch: default
Log Message:

Merge ordered-set-aggregates into default.


diffs (truncated from 9159 to 300 lines):

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
@@ -1035,6 +1035,7 @@ const char grant_rolesRef[];
 const char groupRef[];
 const char groupbyRef[];
 const char groupdoneRef[];
+const char groupedfirstnRef[];
 const char growRef[];
 int hasSideEffects(MalBlkPtr mb, InstrPtr p, int strict);
 const char hgeRef[];
diff --git a/monetdb5/mal/mal_namespace.c b/monetdb5/mal/mal_namespace.c
--- a/monetdb5/mal/mal_namespace.c
+++ b/monetdb5/mal/mal_namespace.c
@@ -197,6 +197,7 @@ const char grantRef[] = "grant";
 const char grant_rolesRef[] = "grant_roles";
 const char groupbyRef[] = "groupby";
 const char groupdoneRef[] = "groupdone";
+const char groupedfirstnRef[] = "groupedfirstn";
 const char groupRef[] = "group";
 const char growRef[] = "grow";
 const char hgeRef[] = "hge";
@@ -462,6 +463,7 @@ initNamespace(void)
fixName(grant_rolesRef);
fixName(groupbyRef);
fixName(groupdoneRef);
+   fixName(groupedfirstnRef);
fixName(groupRef);
fixName(growRef);
fixName(hgeRef);
diff --git a/monetdb5/mal/mal_namespace.h b/monetdb5/mal/mal_namespace.h
--- a/monetdb5/mal/mal_namespace.h
+++ b/monetdb5/mal/mal_namespace.h
@@ -123,6 +123,7 @@ mal_export const char grantRef[];
 mal_export const char grant_rolesRef[];
 mal_export const char groupbyRef[];
 mal_export const char groupdoneRef[];
+mal_export const char groupedfirstnRef[];
 mal_export const char groupRef[];
 mal_export const char growRef[];
 mal_export const char hgeRef[];
diff --git a/monetdb5/optimizer/opt_mergetable.c 
b/monetdb5/optimizer/opt_mergetable.c
--- a/monetdb5/optimizer/opt_mergetable.c
+++ b/monetdb5/optimizer/opt_mergetable.c
@@ -2317,6 +2317,8 @@ OPTmergetableImplementation(Client cntxt
}
 
/* pack if there is a group statement following a groupdone (ie 
aggr(distinct)) */
+   if (getModuleId(p) == algebraRef && getFunctionId(p) == 
groupedfirstnRef)
+   groupdone = 1;
if (getModuleId(p) == groupRef && p->argc == 5
&& (getFunctionId(p) == subgroupRef
|| getFunctionId(p) == subgroupdoneRef
diff --git a/monetdb5/optimizer/opt_mitosis.c b/monetdb5/optimizer/opt_mitosis.c
--- a/monetdb5/optimizer/opt_mitosis.c
+++ b/monetdb5/optimizer/opt_mitosis.c
@@ -67,13 +67,15 @@ OPTmitosisImplementation(Client cntxt, M
nr_aggrs += (p->argc > 2 && getModuleId(p) == aggrRef);
nr_maps += (isMapOp(p));
 
-   if (p->argc > 2 && getModuleId(p) == aggrRef
+   if ((getModuleId(p) == algebraRef &&
+   getFunctionId(p) == groupedfirstnRef) ||
+   (p->argc > 2 && getModuleId(p) == aggrRef
&& getFunctionId(p) != subcountRef && getFunctionId(p) 
!= subminRef
&& getFunctionId(p) != submaxRef && getFunctionId(p) != 
subavgRef
&& getFunctionId(p) != subsumRef && getFunctionId(p) != 
subprodRef
&& getFunctionId(p) != countRef && getFunctionId(p) != 
minRef
&& getFunctionId(p) != maxRef && getFunctionId(p) != 
avgRef
-   && getFunctionId(p) != sumRef && getFunctionId(p) != 
prodRef) {
+   && getFunctionId(p) != sumRef && getFunctionId(p) != 
prodRef)) {
pieces = 0;
goto bailout;
}
diff --git a/sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_01.test 
b/sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_01.test
--- a/sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_01.test
+++ b/sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_01.test
@@ -86,7 +86,7 @@ DROP LOADER myfunc2
 statement ok
 DROP LOADER myfunc3
 
-query ITTT rowsort
+query ITTTI rowsort
 SELECT * FROM functions WHERE name='myfunc'
 
 
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
@@ -1686,10 +1686,17 @@ exp_bin(backend *be, sql_exp *e, stmt *l
}   break;
case e_aggr: {
list *attr = e->l;
+   list *r = e->r;
stmt *as = NULL;
sql_subfunc *a = e->f;
 
assert(sel == NULL);
+   /* cases
+* 0) count(*)
+* 1) general aggregation
+* 2) aggregation with required order (quantile etc)
+* 3) aggregation with optional order by, group_concat, 
xml_agg
+* */
if (attr &

MonetDB: ordered-set-aggregates - Closing branch ordered-set-agg...

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: cd0c67ef9ed4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cd0c67ef9ed4
Branch: ordered-set-aggregates
Log Message:

Closing branch ordered-set-aggregates.

___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: recursive_cte - fixed accessing the list of stmt.s

2024-12-16 Thread Niels Nes via checkin-list
Changeset: 3f126330d58c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3f126330d58c
Modified Files:
sql/backends/monet5/rel_bin.c
Branch: recursive_cte
Log Message:

fixed accessing the list of stmt.s


diffs (41 lines):

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
@@ -3979,7 +3979,7 @@ subres_assign_resultvars(backend *be, st
list *nstmt = sa_list(be->mvc->sa);
for (node *n = stmts->h, *m = vars->h; n && m; n = n->next, m = 
m->next) {
stmt *r = n->data;
-   InstrPtr v = m->data;
+   stmt *v = m->data;
InstrPtr a = newAssignment(be->mb);
stmt *ns = NULL;
const char *rnme = table_name(be->mvc->sa, r);
@@ -3989,7 +3989,7 @@ subres_assign_resultvars(backend *be, st
if (r->nrcols == 0)
r = const_column(be, r);
ns = stmt_alias(be, r, label, rnme, nme);
-   a->argv[0] = v->argv[0];
+   a->argv[0] = v->nr;
a = pushArgument(be->mb, a, ns->nr);
pushInstruction(be->mb, a);
ns->q = a;
@@ -4160,8 +4160,6 @@ rel2bin_recursive_munion(backend *be, sq
if (distinct) {
rec = rel2bin_distinct(be, rec, NULL);
/* remove values allready in the result table */
-   //rec = rel2bin_except(rec, result_table);
-
stmt *s = releqjoin(be, rec->op4.lval, result_table, 
NULL, 0 /* use hash */, 0, 1 /*is_semantics*/);
stmt *lm = stmt_result(be, s, 0);
 
@@ -4169,8 +4167,8 @@ rel2bin_recursive_munion(backend *be, sq
s = stmt_tdiff(be, s, lm, NULL);
rec->cand = s;
rec = subrel_project(be, rec, refs, recursive);
-   }
-   rec = subres_assign_resultvars(be, rec, rel_stmt->op4.lval);
+   rec = subres_assign_resultvars(be, rec, 
rel_stmt->op4.lval);
+   }
 
/* cnt = count(temptable) */
stmt *s = stmt_aggr(be, rec->op4.lval->h->data, NULL, NULL, 
cnt, 1, 0, 1);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Moved contents of ChangeLog.Aug2024 to MonetD...

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: 30e638082084 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/30e638082084
Modified Files:
MonetDB.spec
debian/changelog
misc/packages/deb/changelog
misc/packages/rpm/changelog
Branch: Aug2024
Log Message:

Moved contents of ChangeLog.Aug2024 to MonetDB.spec, debian/changelog and 
ChangeLog-Archive.


diffs (126 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -95,7 +95,7 @@ Group: Applications/Databases
 License: MPL-2.0
 URL: https://www.monetdb.org/
 BugURL: https://github.com/MonetDB/MonetDB/issues
-Source: 
https://www.monetdb.org/downloads/sources/Aug2024-SP1/MonetDB-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Aug2024-SP2/MonetDB-%{version}.tar.bz2
 
 # The Fedora packaging document says we need systemd-rpm-macros for
 # the _unitdir and _tmpfilesdir macros to exist; however on RHEL 7
@@ -990,6 +990,26 @@ rm "${RPM_BUILD_ROOT}"%{_unitdir}/monetd
 %endif
 
 %changelog
+* Mon Dec 16 2024 Sjoerd Mullender  - 11.51.7-20241216
+- Rebuilt.
+- GH#7112: Need keyboard shortcut to interrupt query execution rather than
+  session
+- GH#7205: Unpredictable performance when performing joins over nested
+  queries
+- GH#7574: Assertion failure at `rel2bin_select` when using `STARTSWITH`
+- GH#7588: incorrect output with single row inputs for var_samp(c) over()
+- GH#7589: "SELECT * FROM sessions" crashes monetdb/e
+- GH#7593: A value is being returned with unnecessary scientific notation
+- GH#7595: SQLTestCase leaks pymonetdb connections
+- GH#7597: Upgrade + quick restart causes database inconsistency
+- GH#7599: str_to_date fails when combined with SQL CASE clause
+- GH#7602: COPY INTO from multiple files causes an assertion error.
+- GH#7603: COPY INTO from three or more files crashes the server.
+- GH#7604: file_loader() causes server crash when csv file contains too
+  few field separators or contains empty lines
+- GH#7607: Adding a column of serial type fails with "Access denied for
+   to schema 'sys'"
+
 * Thu Oct 24 2024 Sjoerd Mullender  - 11.51.5-20241024
 - Rebuilt.
 - GH#7281: UDFs defined at compile time in a user schema should not become
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,26 @@
+monetdb (11.51.7) unstable; urgency=low
+
+  * Rebuilt.
+  * GH#7112: Need keyboard shortcut to interrupt query execution rather than
+session
+  * GH#7205: Unpredictable performance when performing joins over nested
+queries
+  * GH#7574: Assertion failure at `rel2bin_select` when using `STARTSWITH`
+  * GH#7588: incorrect output with single row inputs for var_samp(c) over()
+  * GH#7589: "SELECT * FROM sessions" crashes monetdb/e
+  * GH#7593: A value is being returned with unnecessary scientific notation
+  * GH#7595: SQLTestCase leaks pymonetdb connections
+  * GH#7597: Upgrade + quick restart causes database inconsistency
+  * GH#7599: str_to_date fails when combined with SQL CASE clause
+  * GH#7602: COPY INTO from multiple files causes an assertion error.
+  * GH#7603: COPY INTO from three or more files crashes the server.
+  * GH#7604: file_loader() causes server crash when csv file contains too
+few field separators or contains empty lines
+  * GH#7607: Adding a column of serial type fails with "Access denied for
+ to schema 'sys'"
+
+ -- Sjoerd Mullender   Mon, 16 Dec 2024 12:45:20 +0100
+
 monetdb (11.51.5) unstable; urgency=low
 
   * Rebuilt.
diff --git a/misc/packages/deb/changelog b/misc/packages/deb/changelog
--- a/misc/packages/deb/changelog
+++ b/misc/packages/deb/changelog
@@ -1,3 +1,26 @@
+monetdb (11.51.7) unstable; urgency=low
+
+  * Rebuilt.
+  * GH#7112: Need keyboard shortcut to interrupt query execution rather than
+session
+  * GH#7205: Unpredictable performance when performing joins over nested
+queries
+  * GH#7574: Assertion failure at `rel2bin_select` when using `STARTSWITH`
+  * GH#7588: incorrect output with single row inputs for var_samp(c) over()
+  * GH#7589: "SELECT * FROM sessions" crashes monetdb/e
+  * GH#7593: A value is being returned with unnecessary scientific notation
+  * GH#7595: SQLTestCase leaks pymonetdb connections
+  * GH#7597: Upgrade + quick restart causes database inconsistency
+  * GH#7599: str_to_date fails when combined with SQL CASE clause
+  * GH#7602: COPY INTO from multiple files causes an assertion error.
+  * GH#7603: COPY INTO from three or more files crashes the server.
+  * GH#7604: file_loader() causes server crash when csv file contains too
+few field separators or contains empty lines
+  * GH#7607: Adding a column of serial type fails with "Access denied for
+ to schema 'sys'"
+
+ -- Sjoerd Mullender   Mon, 16 Dec 2024 12:45:20 +0100
+
 monetdb (11.51.5) unstable; urgency=low
 
   * Rebuilt.
diff --git a/misc/packages/rpm/changelog b/mis

MonetDB: Aug2024 - Post release build.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: 9e9a188e14d5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9e9a188e14d5
Modified Files:
.bumpversion.cfg
MonetDB.spec
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
cmake/monetdb-versions.cmake
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
Branch: Aug2024
Log Message:

Post release build.


diffs (191 lines):

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 11.51.7
+current_version = 11.51.8
 commit = False
 tag = False
 
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -8,7 +8,7 @@
 # Copyright August 2008 - 2023 MonetDB B.V.;
 # Copyright 1997 - July 2008 CWI.
 
-%global version 11.51.7
+%global version 11.51.8
 
 %bcond_with compat
 
diff --git a/clients/mapilib/mapi.rc b/clients/mapilib/mapi.rc
--- a/clients/mapilib/mapi.rc
+++ b/clients/mapilib/mapi.rc
@@ -6,8 +6,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
 #define sversion(major,minor,patch)#major "." #minor "." #patch "\0"
 
 1 VERSIONINFO
-  FILEVERSION version(11,51,7)
-  PRODUCTVERSION version(11,51,7)
+  FILEVERSION version(11,51,8)
+  PRODUCTVERSION version(11,51,8)
   FILEFLAGSMASK 0x3fL
   FILEFLAGS 0
   FILEOS VOS_NT_WINDOWS32
@@ -21,14 +21,14 @@ BEGIN
   VALUE "Comments", "\0"
   VALUE "CompanyName", "MonetDB Foundation\0"
   VALUE "FileDescription", "MonetDB Application Interface DLL\0"
-  VALUE "FileVersion", sversion(11,51,7)
+  VALUE "FileVersion", sversion(11,51,8)
   VALUE "InternalName", "Mapi\0"
   VALUE "LegalCopyright", "Copyright (c) 2024 MonetDB Foundation\0"
   VALUE "LegalTrademarks", "\0"
   VALUE "OriginalFilename", "Mapi.dll\0"
   VALUE "PrivateBuild", "\0"
   VALUE "ProductName", "MonetDB Client Libraries\0"
-  VALUE "ProductVersion", sversion(11,51,7)
+  VALUE "ProductVersion", sversion(11,51,8)
   VALUE "SpecialBuild", "\0"
 END
   END
diff --git a/clients/odbc/driver/driver.rc b/clients/odbc/driver/driver.rc
--- a/clients/odbc/driver/driver.rc
+++ b/clients/odbc/driver/driver.rc
@@ -6,8 +6,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
 #define sversion(major,minor,patch)#major "." #minor "." #patch "\0"
 
 1 VERSIONINFO
-  FILEVERSION version(11,51,7)
-  PRODUCTVERSION version(11,51,7)
+  FILEVERSION version(11,51,8)
+  PRODUCTVERSION version(11,51,8)
   FILEFLAGSMASK 0x3fL
   FILEFLAGS 0
   FILEOS VOS_NT_WINDOWS32
@@ -21,14 +21,14 @@ BEGIN
   VALUE "Comments", "\0"
   VALUE "CompanyName", "MonetDB Foundation\0"
   VALUE "FileDescription", "MonetDB ODBC Driver DLL\0"
-  VALUE "FileVersion", sversion(11,51,7)
+  VALUE "FileVersion", sversion(11,51,8)
   VALUE "InternalName", "MonetODBC\0"
   VALUE "LegalCopyright", "Copyright (c) 2024 MonetDB Foundation\0"
   VALUE "LegalTrademarks", "\0"
   VALUE "OriginalFilename", "MonetODBC.dll\0"
   VALUE "PrivateBuild", "\0"
   VALUE "ProductName", "MonetDB ODBC Driver\0"
-  VALUE "ProductVersion", sversion(11,51,7)
+  VALUE "ProductVersion", sversion(11,51,8)
   VALUE "SpecialBuild", "\0"
 END
   END
diff --git a/clients/odbc/winsetup/setup.rc b/clients/odbc/winsetup/setup.rc
--- a/clients/odbc/winsetup/setup.rc
+++ b/clients/odbc/winsetup/setup.rc
@@ -51,8 +51,8 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION version(11,51,7)
- PRODUCTVERSION version(11,51,7)
+ FILEVERSION version(11,51,8)
+ PRODUCTVERSION version(11,51,8)
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -69,12 +69,12 @@ BEGIN
 BEGIN
 VALUE "CompanyName", "MonetDB Foundation"
 VALUE "FileDescription", "MonetDB ODBC Setup DLL"
-VALUE "FileVersion", sversion(11,51,7)
+VALUE "FileVersion", sversion(11,51,8)
 VALUE "InternalName", "MonetODBCs.dll"
 VALUE "LegalCopyright", "Copyright (c) 2024 MonetDB Foundation"
 VALUE "OriginalFilename", "MonetODBCs.dll"
 VALUE "ProductName", "MonetDB ODBC Setup"
-VALUE "ProductVersion", sversion(11,51,7)
+VALUE "ProductVersion", sversion(11,51,8)
 END
 END
 BLOCK "VarFileInfo"
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -12,10 +12,10 @@
 
 set(MONETDB_VERSION_MAJOR "11")
 set(MONETDB_VERSION_MINOR "51")
-set(MONETDB_VERSION_PATCH "7")
+set(MONETDB_VERSION_PATCH "8")
 
 if(RELEASE_VERSION)
-  set(MONETDB_RELEASE "Aug2024-SP2")
+  set(MONETDB_RELEASE "unreleased")
 endif()
 set(MONETDB_VERSION 
"${MONETDB_VERSION_MAJOR}.${MONETDB_VERSION_MINOR}.${MONETDB_VERSION_PATCH}")
 
diff --git a/gdk/libbat.rc b/gdk/libbat.rc
--- a/gdk/libbat.rc
+++ b/gdk/libbat.rc
@@ -6,8 +6,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
 #define sversion(major,minor,patch)#maj

MonetDB: Aug2024 - Pre-release version number update.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: bd61958dffc3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bd61958dffc3
Modified Files:
.bumpversion.cfg
MonetDB.spec
clients/mapilib/mapi.rc
clients/odbc/driver/driver.rc
clients/odbc/winsetup/setup.rc
cmake/monetdb-versions.cmake
gdk/libbat.rc
monetdb5/tools/libmonetdb5.rc
Branch: Aug2024
Log Message:

Pre-release version number update.


diffs (191 lines):

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 11.51.6
+current_version = 11.51.7
 commit = False
 tag = False
 
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -8,7 +8,7 @@
 # Copyright August 2008 - 2023 MonetDB B.V.;
 # Copyright 1997 - July 2008 CWI.
 
-%global version 11.51.6
+%global version 11.51.7
 
 %bcond_with compat
 
diff --git a/clients/mapilib/mapi.rc b/clients/mapilib/mapi.rc
--- a/clients/mapilib/mapi.rc
+++ b/clients/mapilib/mapi.rc
@@ -6,8 +6,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
 #define sversion(major,minor,patch)#major "." #minor "." #patch "\0"
 
 1 VERSIONINFO
-  FILEVERSION version(11,51,6)
-  PRODUCTVERSION version(11,51,6)
+  FILEVERSION version(11,51,7)
+  PRODUCTVERSION version(11,51,7)
   FILEFLAGSMASK 0x3fL
   FILEFLAGS 0
   FILEOS VOS_NT_WINDOWS32
@@ -21,14 +21,14 @@ BEGIN
   VALUE "Comments", "\0"
   VALUE "CompanyName", "MonetDB Foundation\0"
   VALUE "FileDescription", "MonetDB Application Interface DLL\0"
-  VALUE "FileVersion", sversion(11,51,6)
+  VALUE "FileVersion", sversion(11,51,7)
   VALUE "InternalName", "Mapi\0"
   VALUE "LegalCopyright", "Copyright (c) 2024 MonetDB Foundation\0"
   VALUE "LegalTrademarks", "\0"
   VALUE "OriginalFilename", "Mapi.dll\0"
   VALUE "PrivateBuild", "\0"
   VALUE "ProductName", "MonetDB Client Libraries\0"
-  VALUE "ProductVersion", sversion(11,51,6)
+  VALUE "ProductVersion", sversion(11,51,7)
   VALUE "SpecialBuild", "\0"
 END
   END
diff --git a/clients/odbc/driver/driver.rc b/clients/odbc/driver/driver.rc
--- a/clients/odbc/driver/driver.rc
+++ b/clients/odbc/driver/driver.rc
@@ -6,8 +6,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
 #define sversion(major,minor,patch)#major "." #minor "." #patch "\0"
 
 1 VERSIONINFO
-  FILEVERSION version(11,51,6)
-  PRODUCTVERSION version(11,51,6)
+  FILEVERSION version(11,51,7)
+  PRODUCTVERSION version(11,51,7)
   FILEFLAGSMASK 0x3fL
   FILEFLAGS 0
   FILEOS VOS_NT_WINDOWS32
@@ -21,14 +21,14 @@ BEGIN
   VALUE "Comments", "\0"
   VALUE "CompanyName", "MonetDB Foundation\0"
   VALUE "FileDescription", "MonetDB ODBC Driver DLL\0"
-  VALUE "FileVersion", sversion(11,51,6)
+  VALUE "FileVersion", sversion(11,51,7)
   VALUE "InternalName", "MonetODBC\0"
   VALUE "LegalCopyright", "Copyright (c) 2024 MonetDB Foundation\0"
   VALUE "LegalTrademarks", "\0"
   VALUE "OriginalFilename", "MonetODBC.dll\0"
   VALUE "PrivateBuild", "\0"
   VALUE "ProductName", "MonetDB ODBC Driver\0"
-  VALUE "ProductVersion", sversion(11,51,6)
+  VALUE "ProductVersion", sversion(11,51,7)
   VALUE "SpecialBuild", "\0"
 END
   END
diff --git a/clients/odbc/winsetup/setup.rc b/clients/odbc/winsetup/setup.rc
--- a/clients/odbc/winsetup/setup.rc
+++ b/clients/odbc/winsetup/setup.rc
@@ -51,8 +51,8 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION version(11,51,6)
- PRODUCTVERSION version(11,51,6)
+ FILEVERSION version(11,51,7)
+ PRODUCTVERSION version(11,51,7)
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -69,12 +69,12 @@ BEGIN
 BEGIN
 VALUE "CompanyName", "MonetDB Foundation"
 VALUE "FileDescription", "MonetDB ODBC Setup DLL"
-VALUE "FileVersion", sversion(11,51,6)
+VALUE "FileVersion", sversion(11,51,7)
 VALUE "InternalName", "MonetODBCs.dll"
 VALUE "LegalCopyright", "Copyright (c) 2024 MonetDB Foundation"
 VALUE "OriginalFilename", "MonetODBCs.dll"
 VALUE "ProductName", "MonetDB ODBC Setup"
-VALUE "ProductVersion", sversion(11,51,6)
+VALUE "ProductVersion", sversion(11,51,7)
 END
 END
 BLOCK "VarFileInfo"
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -12,10 +12,10 @@
 
 set(MONETDB_VERSION_MAJOR "11")
 set(MONETDB_VERSION_MINOR "51")
-set(MONETDB_VERSION_PATCH "6")
+set(MONETDB_VERSION_PATCH "7")
 
 if(RELEASE_VERSION)
-  set(MONETDB_RELEASE "unreleased")
+  set(MONETDB_RELEASE "Aug2024-SP2")
 endif()
 set(MONETDB_VERSION 
"${MONETDB_VERSION_MAJOR}.${MONETDB_VERSION_MINOR}.${MONETDB_VERSION_PATCH}")
 
diff --git a/gdk/libbat.rc b/gdk/libbat.rc
--- a/gdk/libbat.rc
+++ b/gdk/libbat.rc
@@ -6,8 +6,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
 #define sversion(major,minor

MonetDB: default - Merge with Aug2024 branch.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: 87000a192348 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/87000a192348
Modified Files:
MonetDB.spec
cmake/monetdb-versions.cmake
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (105 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -835,3 +835,4 @@ dce400b68239412b1835fb28bd183bf50f5e8692
 dce400b68239412b1835fb28bd183bf50f5e8692 Aug2024_release
 ab5d60be21cd1c65e9de476d71a86c2995f70785 Aug2024_5
 ab5d60be21cd1c65e9de476d71a86c2995f70785 Aug2024_SP1_release
+30e6380820842b9e0325536eb22d7cb3843ab095 Aug2024_7
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -95,7 +95,7 @@ Group: Applications/Databases
 License: MPL-2.0
 URL: https://www.monetdb.org/
 BugURL: https://github.com/MonetDB/MonetDB/issues
-Source: 
https://www.monetdb.org/downloads/sources/Aug2024-SP1/MonetDB-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Aug2024-SP2/MonetDB-%{version}.tar.bz2
 
 # The Fedora packaging document says we need systemd-rpm-macros for
 # the _unitdir and _tmpfilesdir macros to exist; however on RHEL 7
@@ -989,6 +989,26 @@ rm "${RPM_BUILD_ROOT}"%{_unitdir}/monetd
 %endif
 
 %changelog
+* Mon Dec 16 2024 Sjoerd Mullender  - 11.51.7-20241216
+- Rebuilt.
+- GH#7112: Need keyboard shortcut to interrupt query execution rather than
+  session
+- GH#7205: Unpredictable performance when performing joins over nested
+  queries
+- GH#7574: Assertion failure at `rel2bin_select` when using `STARTSWITH`
+- GH#7588: incorrect output with single row inputs for var_samp(c) over()
+- GH#7589: "SELECT * FROM sessions" crashes monetdb/e
+- GH#7593: A value is being returned with unnecessary scientific notation
+- GH#7595: SQLTestCase leaks pymonetdb connections
+- GH#7597: Upgrade + quick restart causes database inconsistency
+- GH#7599: str_to_date fails when combined with SQL CASE clause
+- GH#7602: COPY INTO from multiple files causes an assertion error.
+- GH#7603: COPY INTO from three or more files crashes the server.
+- GH#7604: file_loader() causes server crash when csv file contains too
+  few field separators or contains empty lines
+- GH#7607: Adding a column of serial type fails with "Access denied for
+   to schema 'sys'"
+
 * Thu Oct 24 2024 Sjoerd Mullender  - 11.51.5-20241024
 - Rebuilt.
 - GH#7281: UDFs defined at compile time in a user schema should not become
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -44,7 +44,7 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # common/options and common/utils)
 set(GDK_VERSION_MAJOR "29")
 set(GDK_VERSION_MINOR "0")
-set(GDK_VERSION_PATCH "1")
+set(GDK_VERSION_PATCH "2")
 set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 # version of the MAPI library (subdirectory clients/mapilib)
@@ -57,7 +57,7 @@ set(MAPI_VERSION "${MAPI_VERSION_MAJOR}.
 # extras, and tools/utils/msabaoth.[ch])
 set(MONETDB5_VERSION_MAJOR "36")
 set(MONETDB5_VERSION_MINOR "0")
-set(MONETDB5_VERSION_PATCH "2")
+set(MONETDB5_VERSION_PATCH "3")
 set(MONETDB5_VERSION 
"${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_MINOR}.${MONETDB5_VERSION_PATCH}")
 
 # version of the MONETDBE library (subdirectory tools/monetdbe)
@@ -75,5 +75,5 @@ set(STREAM_VERSION "${STREAM_VERSION_MAJ
 # version of the SQL library (subdirectory sql)
 set(SQL_VERSION_MAJOR "15")
 set(SQL_VERSION_MINOR "0")
-set(SQL_VERSION_PATCH "2")
+set(SQL_VERSION_PATCH "3")
 set(SQL_VERSION 
"${SQL_VERSION_MAJOR}.${SQL_VERSION_MINOR}.${SQL_VERSION_PATCH}")
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,26 @@
+monetdb (11.51.7) unstable; urgency=low
+
+  * Rebuilt.
+  * GH#7112: Need keyboard shortcut to interrupt query execution rather than
+session
+  * GH#7205: Unpredictable performance when performing joins over nested
+queries
+  * GH#7574: Assertion failure at `rel2bin_select` when using `STARTSWITH`
+  * GH#7588: incorrect output with single row inputs for var_samp(c) over()
+  * GH#7589: "SELECT * FROM sessions" crashes monetdb/e
+  * GH#7593: A value is being returned with unnecessary scientific notation
+  * GH#7595: SQLTestCase leaks pymonetdb connections
+  * GH#7597: Upgrade + quick restart causes database inconsistency
+  * GH#7599: str_to_date fails when combined with SQL CASE clause
+  * GH#7602: COPY INTO from multiple files causes an assertion error.
+  * GH#7603: COPY INTO from three or more files crashes the server.
+  * GH#7604: file_loader() causes server crash when csv file contains too
+few field separators or contains empty lines
+  * GH#7607: Adding a column of serial type fails with &quo

MonetDB: Aug2024 - Updated library versions.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: 3bea32cb3534 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3bea32cb3534
Modified Files:
cmake/monetdb-versions.cmake
Branch: Aug2024
Log Message:

Updated library versions.


diffs (28 lines):

diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -44,7 +44,7 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # common/options and common/utils)
 set(GDK_VERSION_MAJOR "29")
 set(GDK_VERSION_MINOR "0")
-set(GDK_VERSION_PATCH "1")
+set(GDK_VERSION_PATCH "2")
 set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 # version of the MAPI library (subdirectory clients/mapilib)
@@ -57,7 +57,7 @@ set(MAPI_VERSION "${MAPI_VERSION_MAJOR}.
 # extras, and tools/utils/msabaoth.[ch])
 set(MONETDB5_VERSION_MAJOR "36")
 set(MONETDB5_VERSION_MINOR "0")
-set(MONETDB5_VERSION_PATCH "2")
+set(MONETDB5_VERSION_PATCH "3")
 set(MONETDB5_VERSION 
"${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_MINOR}.${MONETDB5_VERSION_PATCH}")
 
 # version of the MONETDBE library (subdirectory tools/monetdbe)
@@ -75,5 +75,5 @@ set(STREAM_VERSION "${STREAM_VERSION_MAJ
 # version of the SQL library (subdirectory sql)
 set(SQL_VERSION_MAJOR "15")
 set(SQL_VERSION_MINOR "0")
-set(SQL_VERSION_PATCH "2")
+set(SQL_VERSION_PATCH "3")
 set(SQL_VERSION 
"${SQL_VERSION_MAJOR}.${SQL_VERSION_MINOR}.${SQL_VERSION_PATCH}")
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Setting tag Aug2024_7 for the release build.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: e36ab365db8c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e36ab365db8c
Modified Files:
.hgtags
Branch: Aug2024
Log Message:

Setting tag Aug2024_7 for the release build.


diffs (8 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -835,3 +835,4 @@ dce400b68239412b1835fb28bd183bf50f5e8692
 dce400b68239412b1835fb28bd183bf50f5e8692 Aug2024_release
 ab5d60be21cd1c65e9de476d71a86c2995f70785 Aug2024_5
 ab5d60be21cd1c65e9de476d71a86c2995f70785 Aug2024_SP1_release
+30e6380820842b9e0325536eb22d7cb3843ab095 Aug2024_7
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: recursive_cte - Use TAB for indent.

2024-12-16 Thread Sjoerd Mullender via checkin-list
Changeset: a37f403ee378 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a37f403ee378
Modified Files:
sql/backends/monet5/rel_bin.c
Branch: recursive_cte
Log Message:

Use TAB for indent.


diffs (157 lines):

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
@@ -188,7 +188,7 @@ list_find_column(backend *be, list *l, c
const char *nme = column_name(be->mvc->sa, s);
 
if (rnme && strcmp(rnme, rname) == 0 &&
-   strcmp(nme, name) == 0) {
+   strcmp(nme, name) == 0) {
res = s;
break;
}
@@ -215,7 +215,7 @@ list_find_column(backend *be, list *l, c
const char *nme = column_name(be->mvc->sa, n->data);
 
if (rnme && strcmp(rnme, rname) == 0 &&
-   strcmp(nme, name) == 0) {
+   strcmp(nme, name) == 0) {
res = n->data;
break;
}
@@ -543,7 +543,7 @@ handle_in_exps(backend *be, sql_exp *ce,
?sql_bind_func(sql, "sys", "=", tail_type(c), 
tail_type(c), F_FUNC, true, true)
:sql_bind_func(sql, "sys", "<>", tail_type(c), 
tail_type(c), F_FUNC, true, true);
sql_subfunc *a = (in)?sql_bind_func(sql, "sys", "or", bt, bt, 
F_FUNC, true, true)
-:sql_bind_func(sql, "sys", "and", bt, bt, 
F_FUNC, true, true);
+:sql_bind_func(sql, "sys", "and", bt, 
bt, F_FUNC, true, true);
 
for (n = nl->h; n; n = n->next) {
sql_exp *e = n->data;
@@ -948,19 +948,19 @@ exp2bin_named_placeholders(backend *be, 
InstrPtr q = newAssignment(be->mb);
 
if (!q || !t || !s) {
-sql_error(be->mvc, 10, SQLSTATE(42000) MAL_MALLOC_FAIL);
+   sql_error(be->mvc, 10, SQLSTATE(42000) MAL_MALLOC_FAIL);
return NULL;
}
-int type = t->type->localtype, varid = 0;
-
-snprintf(arg, IDLENGTH, "A%d", argc);
-if ((varid = newVariable(be->mb, arg, strlen(arg), type)) < 0) {
-sql_error(be->mvc, 10, SQLSTATE(42000) "Internal error while 
compiling statement: variable id too long");
+   int type = t->type->localtype, varid = 0;
+
+   snprintf(arg, IDLENGTH, "A%d", argc);
+   if ((varid = newVariable(be->mb, arg, strlen(arg), type)) < 0) {
+   sql_error(be->mvc, 10, SQLSTATE(42000) "Internal error 
while compiling statement: variable id too long");
return NULL;
-}
+   }
if (q)
getDestVar(q) = varid;
-q = pushArgument(be->mb, q, s->nr);
+   q = pushArgument(be->mb, q, s->nr);
pushInstruction(be->mb, q);
}
return NULL;
@@ -1416,7 +1416,7 @@ is_const_func(sql_subfunc *f, list *attr
if (list_length(attr) != 2)
return false;
if (strcmp(f->func->base.name, "quantile") == 0 ||
-   strcmp(f->func->base.name, "quantile_avg") == 0)
+   strcmp(f->func->base.name, "quantile_avg") == 0)
return true;
return false;
 }
@@ -2843,7 +2843,7 @@ can_join_exp(sql_rel *rel, sql_exp *e, b
if ((ll && !rl &&
   ((rr && !lr) || (nrcr1 = r->card == 
CARD_ATOM && exp_is_atom(r))) &&
   ((rf && !lf) || (nrcr2 = f->card == 
CARD_ATOM && exp_is_atom(f))) && (nrcr1+nrcr2) <= 1) ||
-   (rl && !ll &&
+   (rl && !ll &&
   ((lr && !rr) || (nrcl1 = r->card == 
CARD_ATOM && exp_is_atom(r))) &&
   ((lf && !rf) || (nrcl2 = f->card == 
CARD_ATOM && exp_is_atom(f))) && (nrcl1+nrcl2) <= 1)) {
can_join = 1;
@@ -4095,13 +4095,13 @@ rel2bin_recursive_munion(backend *be, sq
}
 
/* while cnt > 0 (and total < limit): */
-InstrPtr r = newAssignment(be->mb);
-if (r == NULL)
+   InstrPtr r = newAssignment(be->mb);
+   if (r == NULL)
return NULL;
int barrier_var = r->argv[0];
-r->argc = r->retc = 1;
-r->barrier = BARRIERsymbol;
-r = pushBit(be->mb, r, TRUE);
+   r->argc = r->retc = 1;
+   r->barrier = BARRIERsymbol;
+   r = pushBit(be->mb, r, TRUE);
   

MonetDB: const_aggr_elim - merges with default

2024-12-16 Thread Wolf Schulz via checkin-list
Changeset: 5753e9eb856b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5753e9eb856b
Branch: const_aggr_elim
Log Message:

merges with default


diffs (truncated from 3965 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -835,3 +835,4 @@ dce400b68239412b1835fb28bd183bf50f5e8692
 dce400b68239412b1835fb28bd183bf50f5e8692 Aug2024_release
 ab5d60be21cd1c65e9de476d71a86c2995f70785 Aug2024_5
 ab5d60be21cd1c65e9de476d71a86c2995f70785 Aug2024_SP1_release
+30e6380820842b9e0325536eb22d7cb3843ab095 Aug2024_7
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -95,7 +95,7 @@ Group: Applications/Databases
 License: MPL-2.0
 URL: https://www.monetdb.org/
 BugURL: https://github.com/MonetDB/MonetDB/issues
-Source: 
https://www.monetdb.org/downloads/sources/Aug2024-SP1/MonetDB-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Aug2024-SP2/MonetDB-%{version}.tar.bz2
 
 # The Fedora packaging document says we need systemd-rpm-macros for
 # the _unitdir and _tmpfilesdir macros to exist; however on RHEL 7
@@ -989,6 +989,26 @@ rm "${RPM_BUILD_ROOT}"%{_unitdir}/monetd
 %endif
 
 %changelog
+* Mon Dec 16 2024 Sjoerd Mullender  - 11.51.7-20241216
+- Rebuilt.
+- GH#7112: Need keyboard shortcut to interrupt query execution rather than
+  session
+- GH#7205: Unpredictable performance when performing joins over nested
+  queries
+- GH#7574: Assertion failure at `rel2bin_select` when using `STARTSWITH`
+- GH#7588: incorrect output with single row inputs for var_samp(c) over()
+- GH#7589: "SELECT * FROM sessions" crashes monetdb/e
+- GH#7593: A value is being returned with unnecessary scientific notation
+- GH#7595: SQLTestCase leaks pymonetdb connections
+- GH#7597: Upgrade + quick restart causes database inconsistency
+- GH#7599: str_to_date fails when combined with SQL CASE clause
+- GH#7602: COPY INTO from multiple files causes an assertion error.
+- GH#7603: COPY INTO from three or more files crashes the server.
+- GH#7604: file_loader() causes server crash when csv file contains too
+  few field separators or contains empty lines
+- GH#7607: Adding a column of serial type fails with "Access denied for
+   to schema 'sys'"
+
 * Thu Oct 24 2024 Sjoerd Mullender  - 11.51.5-20241024
 - Rebuilt.
 - GH#7281: UDFs defined at compile time in a user schema should not become
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
@@ -282,7 +282,7 @@ bool GDKexiting(void);
 jmp_buf GDKfataljump;
 bit GDKfataljumpenable;
 str GDKfatalmsg;
-char *GDKfilepath(int farmid, const char *dir, const char *nme, const char 
*ext);
+gdk_return GDKfilepath(char *buf, size_t bufsize, int farmid, const char *dir, 
const char *nme, const char *ext) __attribute__((__access__(write_only, 1, 2)));
 void GDKfree(void *blk);
 char *GDKgetbuf(void);
 unsigned GDKgetdebug(void);
@@ -301,7 +301,7 @@ MT_Lock *volatile GDKlocklist;
 ATOMIC_FLAG GDKlocklistlock;
 ATOMIC_TYPE GDKlocksleepcnt;
 void GDKlockstatistics(int);
-void *GDKmalloc(size_t size) __attribute__((__malloc__)) 
__attribute__((__alloc_size__(1))) __attribute__((__warn_unused_result__));
+void *GDKmalloc(size_t size) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__alloc_size__(1))) 
__attribute__((__warn_unused_result__));
 size_t GDKmallocated(const void *s);
 size_t GDKmem_cursize(void);
 gdk_return GDKmergeidx(BAT *b, BAT **a, int n_ar);
@@ -324,9 +324,9 @@ stream *GDKstdout;
 ssize_t GDKstrFromStr(unsigned char *restrict dst, const unsigned char 
*restrict src, ssize_t len, char quote);
 int GDKstrcasecmp(const char *s1, const char *s2);
 char *GDKstrcasestr(const char *haystack, const char *needle);
-str GDKstrdup(const char *s) __attribute__((__malloc__)) 
__attribute__((__warn_unused_result__));
+str GDKstrdup(const char *s) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__warn_unused_result__));
 int GDKstrncasecmp(const char *str1, const char *str2, size_t l1, size_t l2);
-str GDKstrndup(const char *s, size_t n) __attribute__((__malloc__)) 
__attribute__((__warn_unused_result__));
+str GDKstrndup(const char *s, size_t n) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__warn_unused_result__));
 gdk_return GDKtolower(char **restrict buf, size_t *restrict buflen, const char 
*restrict s) __attribute__((__access__(read_write, 1))) 
__attribute__((__access__(read_write, 2)));
 gdk_return GDKtoupper(char **restrict buf, size_t *restrict buflen, const char 
*restrict s) __attribute__((__access__(read_write, 1))) 
__attribute__((__access__(read_write, 2)));
 gdk_return GDKtracer_fill_comp_info(BAT *id, BAT *component, BAT *log_level);
@@ -348,7 +348,7 @@ gdk_return GDKupgradevarheap(BAT *b, var
 lng GDKusec(void);
 const char *GDKversion(void) __attribute__(

MonetDB: const_aggr_elim - added mtest for the new optimizer

2024-12-16 Thread Wolf Schulz via checkin-list
Changeset: d519f07e3796 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d519f07e3796
Added Files:
sql/test/rel-optimizers/Tests/const-aggr-elim.test
Modified Files:
sql/test/rel-optimizers/Tests/All
Branch: const_aggr_elim
Log Message:

added mtest for the new optimizer


diffs (52 lines):

diff --git a/sql/test/rel-optimizers/Tests/All 
b/sql/test/rel-optimizers/Tests/All
--- a/sql/test/rel-optimizers/Tests/All
+++ b/sql/test/rel-optimizers/Tests/All
@@ -15,3 +15,4 @@ merge-unions
 merge-ors-base
 merge-ors-single-col-eq-to-cmp_in
 merge-ors-multi-col-eq-to-cmp_in
+const-aggr-elim
diff --git a/sql/test/rel-optimizers/Tests/const-aggr-elim.test 
b/sql/test/rel-optimizers/Tests/const-aggr-elim.test
new file mode 100644
--- /dev/null
+++ b/sql/test/rel-optimizers/Tests/const-aggr-elim.test
@@ -0,0 +1,39 @@
+statement ok
+CREATE TABLE baz (a INT, b INT)
+
+statement ok
+INSERT INTO baz (a, b) VALUES (42, 1), (31, 6), (32, 6), (36, 7), (57, 3)
+
+query I rowsort 
+SELECT avg(3) FROM baz GROUP BY b
+
+3
+3
+3
+3
+
+query T nosort
+PLAN SELECT avg(3) FROM baz GROUP BY b
+
+project (
+| group by (
+| | table("sys"."baz") [ "baz"."b" NOT NULL ]
+| ) [ "baz"."b" NOT NULL ] [ "sys"."avg" no nil (tinyint(2) "3") NOT NULL as 
"%1"."%1" ]
+) [ "%1"."%1" NOT NULL ]
+
+query I rowsort
+SELECT count(3) FROM baz GROUP BY b
+
+1
+1
+1
+2
+
+query T nosort
+PLAN SELECT count(3) FROM baz GROUP BY b
+
+project (
+| group by (
+| | table("sys"."baz") [ "baz"."b" NOT NULL ]
+| ) [ "baz"."b" NOT NULL ] [ "sys"."count"() NOT NULL as "%1"."%1" ]
+) [ "%1"."%1" NOT NULL ]
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: const_aggr_elim - new itteration, almost there.

2024-12-16 Thread Wolf Schulz via checkin-list
Changeset: c60937763cb1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c60937763cb1
Modified Files:
sql/server/rel_optimize_proj.c
Branch: const_aggr_elim
Log Message:

new itteration, almost there.


diffs (110 lines):

diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c
--- a/sql/server/rel_optimize_proj.c
+++ b/sql/server/rel_optimize_proj.c
@@ -3022,11 +3022,88 @@ rel_project_select_exp(visitor *v, sql_r
return rel;
 }
 
-
 static inline sql_rel *
 rel_const_aggr_elimination(visitor *v, sql_rel *rel)
 {
-   (void)v;
+   sql_rel *g=rel->l;
+
+   if (rel->op == op_project && g)
+   {
+   if(g->op == op_groupby)
+   {
+   printf("Found Groupby!\n");
+
+   list *exps=g->exps;
+   node *n,*m;
+
+   for(n = exps->h; n; n = n->next)
+   {
+   sql_exp *e = n->data;
+
+   if(e->type == e_aggr)
+   {
+   list *se=e->l;
+   struct sql_exp_name *en = &e->alias;
+
+   // Check aggr type! exp_aggr_is_count(e)
+
+   for(m = se->h; m; m = m->next)
+   {
+   // 1: Copy pointer to e_atom 
(not atom*); (already have it)
+   sql_exp *w = m->data;
+
+   if(w->type == e_atom && w->card 
== CARD_ATOM)
+   {
+   printf("Atom Found 
Within!\n");
+
+   // 2: Insert step 1 
e_atom ptr into (list*)rel->exps;
+   
list_append(rel->exps,w);
+
+   // 3: Remove e_col from 
(list*)rel->exps that contains ptr to e_aggr; 
list_remove_data((list*)rel->exps,NULL,FOUNDNODE) add_exp_too_project
+   list *ag = rel->exps;
+   node *b;
+   
+   for(b = ag->h; b; b = 
b->next)
+   {
+   sql_exp *a = 
b->data;
+   struct 
sql_exp_name *an = &a->alias;
+
+   printf("Found 
Column?: %u\n",a->type);
+   printf("Label: 
%u\n",en->label);
+
+   if(a->type == 
e_column && en->label == an->label && strcmp(en->name, an->name) == 0 && 
strcmp(en->rname, an->rname) == 0)
+   {
+   
printf("Hit!\n");
+
+   // REF 
TO e_aggr IS a->alias = (label = 1, name = "%1", rname = "%1")
+
+   
list_remove_node(ag,NULL,b);
+   }
+   }
+   
+   // OR Something with ?
+   //add_exp_too_project();
+
+   // 4: Set to e_aggr->l 
to NULL then destroy e_aggr node;
+   e->l=NULL;
+   
list_remove_node(exps,NULL,n);
+
+   v->changes++; // Causes 
Assert Till Changed;
+   }
+   }
+   
+   //printf("Type: %u\n",((list*)e->l));
+   }
+   }
+   }
+   }
+
+   // What more?
+
+   // Are they really aggregates? Or function check;
+   // Look at sql_subfunc and sql_func types and atom types.
+
+   // 
 
return rel;
 }
@@ -3036,6 +3113,7 @@ rel_optimize_projections_(visitor *v, sq
 {
rel = rel_project_cse(v, rel);
rel = rel_project_select_exp(v, rel);
+   rel = rel_const_aggr_elimination(v, rel);
 
if (!rel || !is_groupby(rel-

MonetDB: ordered-set-aggregates - approved output

2024-12-16 Thread Niels Nes via checkin-list
Changeset: ea2a00ffc0c4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ea2a00ffc0c4
Modified Files:
clients/Tests/exports.stable.out
Branch: ordered-set-aggregates
Log Message:

approved output


diffs (truncated from 751 to 300 lines):

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
@@ -282,7 +282,7 @@ bool GDKexiting(void);
 jmp_buf GDKfataljump;
 bit GDKfataljumpenable;
 str GDKfatalmsg;
-char *GDKfilepath(int farmid, const char *dir, const char *nme, const char 
*ext);
+gdk_return GDKfilepath(char *buf, size_t bufsize, int farmid, const char *dir, 
const char *nme, const char *ext) __attribute__((__access__(write_only, 1, 2)));
 void GDKfree(void *blk);
 char *GDKgetbuf(void);
 unsigned GDKgetdebug(void);
@@ -301,7 +301,7 @@ MT_Lock *volatile GDKlocklist;
 ATOMIC_FLAG GDKlocklistlock;
 ATOMIC_TYPE GDKlocksleepcnt;
 void GDKlockstatistics(int);
-void *GDKmalloc(size_t size) __attribute__((__malloc__)) 
__attribute__((__alloc_size__(1))) __attribute__((__warn_unused_result__));
+void *GDKmalloc(size_t size) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__alloc_size__(1))) 
__attribute__((__warn_unused_result__));
 size_t GDKmallocated(const void *s);
 size_t GDKmem_cursize(void);
 gdk_return GDKmergeidx(BAT *b, BAT **a, int n_ar);
@@ -324,9 +324,9 @@ stream *GDKstdout;
 ssize_t GDKstrFromStr(unsigned char *restrict dst, const unsigned char 
*restrict src, ssize_t len, char quote);
 int GDKstrcasecmp(const char *s1, const char *s2);
 char *GDKstrcasestr(const char *haystack, const char *needle);
-str GDKstrdup(const char *s) __attribute__((__malloc__)) 
__attribute__((__warn_unused_result__));
+str GDKstrdup(const char *s) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__warn_unused_result__));
 int GDKstrncasecmp(const char *str1, const char *str2, size_t l1, size_t l2);
-str GDKstrndup(const char *s, size_t n) __attribute__((__malloc__)) 
__attribute__((__warn_unused_result__));
+str GDKstrndup(const char *s, size_t n) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__warn_unused_result__));
 gdk_return GDKtolower(char **restrict buf, size_t *restrict buflen, const char 
*restrict s) __attribute__((__access__(read_write, 1))) 
__attribute__((__access__(read_write, 2)));
 gdk_return GDKtoupper(char **restrict buf, size_t *restrict buflen, const char 
*restrict s) __attribute__((__access__(read_write, 1))) 
__attribute__((__access__(read_write, 2)));
 gdk_return GDKtracer_fill_comp_info(BAT *id, BAT *component, BAT *log_level);
@@ -348,7 +348,7 @@ gdk_return GDKupgradevarheap(BAT *b, var
 lng GDKusec(void);
 const char *GDKversion(void) __attribute__((__const__));
 size_t GDKvm_cursize(void);
-void *GDKzalloc(size_t size) __attribute__((__malloc__)) 
__attribute__((__alloc_size__(1))) __attribute__((__warn_unused_result__));
+void *GDKzalloc(size_t size) __attribute__((__malloc__)) 
__attribute__((__malloc__(GDKfree, 1))) __attribute__((__alloc_size__(1))) 
__attribute__((__warn_unused_result__));
 void HASHdestroy(BAT *b);
 BUN HASHlist(Hash *h, BUN i);
 BUN HASHprobe(const Hash *h, const void *v);
@@ -527,15 +527,15 @@ int dlclose(void *handle);
 char *dlerror(void);
 void *dlopen(const char *file, int mode);
 void *dlsym(void *handle, const char *name);
-_Noreturn void eb_error(exception_buffer *eb, char *msg, int val);
+_Noreturn void eb_error(exception_buffer *eb, const char *msg, int val);
 exception_buffer *eb_init(exception_buffer *eb) 
__attribute__((__access__(write_only, 1)));
 size_t escapedStr(char *restrict dst, const char *restrict src, size_t dstlen, 
const char *sep1, const char *sep2, int quote);
 size_t escapedStrlen(const char *restrict src, const char *sep1, const char 
*sep2, int quote);
 ssize_t fltFromStr(const char *src, size_t *len, flt **dst, bool external);
 ssize_t fltToStr(str *dst, size_t *len, const flt *src, bool external);
 const flt flt_nil;
-gdk_return gdk_add_callback(char *name, gdk_callback_func *f, int argc, void 
*argv[], int interval);
-gdk_return gdk_remove_callback(char *, gdk_callback_func *f);
+gdk_return gdk_add_callback(const char *name, gdk_callback_func *f, int argc, 
void *argv[], int interval);
+gdk_return gdk_remove_callback(const char *, gdk_callback_func *f);
 bat getBBPsize(void);
 char *get_bin_path(void);
 int gettimeofday(struct timeval *tv, int *ignore_zone);
@@ -840,147 +840,147 @@ int UTF8_strwidth(const char *s);
 void addMalException(MalBlkPtr mb, str msg);
 str addOptimizerPipe(Client cntxt, MalBlkPtr mb, const char *name);
 str addPipeDefinition(Client cntxt, const char *name, const char *pipe);
-const char *affectedRowsRef;
-const char *aggrRef;
-const char *alarmRef;
-const char *algebraRef;
-const char *alter_add_range_partitionRef;
-const char *alter_add_tableRef;
-const char *alter_add_value_partitio