MonetDB: clean_parser - merged with recursive_cte

2024-12-17 Thread Niels Nes via checkin-list
Changeset: c89b98402032 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c89b98402032
Modified Files:
sql/common/sql_types.c
sql/include/sql_catalog.h
sql/server/rel_psm.c
sql/server/rel_select.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
sql/server/sql_parser.y
sql/server/sql_scan.c
sql/storage/sql_storage.h
sql/test/Dependencies/Tests/dependency_owner_schema_3.test
sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.test
Branch: clean_parser
Log Message:

merged with recursive_cte


diffs (truncated from 9422 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_select` when using `STARTSWITH`
+  * GH#7588: incorrect output with single row inputs for var_samp(c) over()
+  * GH#7589: "SELECT * FROM sessions" crashes monetd

MonetDB: ordered-set-aggregates - set the groupedfirstnRef properly

2024-12-17 Thread Niels Nes via checkin-list
Changeset: 778fe9447bb2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/778fe9447bb2
Modified Files:
monetdb5/mal/mal_namespace.c
monetdb5/optimizer/opt_mitosis.c
Branch: ordered-set-aggregates
Log Message:

set the groupedfirstnRef properly
disable mitosis on groupedfirstn usage


diffs (32 lines):

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
@@ -463,6 +463,7 @@ initNamespace(void)
fixName(grant_rolesRef);
fixName(groupbyRef);
fixName(groupdoneRef);
+   fixName(groupedfirstnRef);
fixName(groupRef);
fixName(growRef);
fixName(hgeRef);
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;
}
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merged branch recursive_cte into default.

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

Merged branch recursive_cte into default.


diffs (truncated from 3286 to 300 lines):

diff --git a/monetdb5/optimizer/opt_commonTerms.c 
b/monetdb5/optimizer/opt_commonTerms.c
--- a/monetdb5/optimizer/opt_commonTerms.c
+++ b/monetdb5/optimizer/opt_commonTerms.c
@@ -120,7 +120,7 @@ OPTcommonTermsImplementation(Client cntx
  p->retc == p->argc);
pushInstruction(mb, p);
old[i] = NULL;
-   continue;
+   break;
}
 
/* when we enter a barrier block, we should ditch all previous 
instructions from consideration */
diff --git a/monetdb5/optimizer/opt_pipes.c b/monetdb5/optimizer/opt_pipes.c
--- a/monetdb5/optimizer/opt_pipes.c
+++ b/monetdb5/optimizer/opt_pipes.c
@@ -203,6 +203,37 @@ static struct pipeline {
 },
 true,
},
+   {"recursive_pipe",
+(char *[]) {
+"inline",
+"remap",
+"costModel",
+"coercions",
+"aliases",
+"evaluate",
+"deadcode",
+"pushselect",
+"aliases",
+"for",
+"dict",
+"mergetable",
+"aliases",
+"constants",
+"projectionpath",
+"deadcode",
+"matpack",
+"querylog",
+"multiplex",
+"generator",
+"candidates",
+"deadcode",
+"postfix",
+"profiler",
+"garbageCollector",
+NULL,
+},
+true,
+   },
 /* Experimental pipelines stressing various components under
  * development.  Do not use any of these pipelines in production
  * settings!
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
@@ -114,9 +114,7 @@ sql_unop_(backend *be, const char *fname
 static stmt *
 refs_find_rel(list *refs, sql_rel *rel)
 {
-   node *n;
-
-   for (n=refs->h; n; n = n->next->next) {
+   for (node *n = refs->h; n; n = n->next->next) {
sql_rel *ref = n->data;
stmt *s = n->next->data;
 
@@ -129,9 +127,7 @@ refs_find_rel(list *refs, sql_rel *rel)
 static void
 refs_update_stmt(list *refs, sql_rel *rel, stmt *s)
 {
-   node *n;
-
-   for (n=refs->h; n; n = n->next->next) {
+   for (node *n = refs->h; n; n = n->next->next) {
sql_rel *ref = n->data;
 
if (rel == ref) {
@@ -192,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;
}
@@ -219,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;
}
@@ -449,7 +445,7 @@ subrel_project(backend *be, stmt *s, lis
stmt *c = n->data;
 
assert(c->type == st_alias || (c->type == st_join && c->flag == 
cmp_project) || c->type == st_bat || c->type == st_idxbat || c->type == 
st_single);
-   if (c->type != st_alias) {
+   if (c->type != st_alias || c->flag) {
c = stmt_project(be, cand, c);
} else if (c->op1->type == st_mirror && is_tid_chain(cand)) { 
/* alias with mirror (ie full row ids) */
//c = stmt_alias(be, cand, 0, c->tname, c->cname);
@@ -547,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) {
 

MonetDB: recursive_cte - Closing branch recursive_cte.

2024-12-17 Thread Sjoerd Mullender via checkin-list
Changeset: 014c12275a97 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/014c12275a97
Branch: recursive_cte
Log Message:

Closing branch recursive_cte.

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


MonetDB: const_aggr_elim - Fixed implementation WIP

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

Fixed implementation WIP


diffs (105 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
@@ -3027,84 +3027,42 @@ rel_const_aggr_elimination(visitor *v, s
 {
sql_rel *g=rel->l;
 
-   if (rel->op == op_project && g)
+   if (rel->op == op_project && g) // 0
{
-   if(g->op == op_groupby)
+   list *exps=g->exps;
+
+   if(g->op == op_groupby && !list_empty(exps))
{
-   printf("Found Groupby!\n");
-
-   list *exps=g->exps;
-   node *n,*m;
-
-   for(n = exps->h; n; n = n->next)
+   for(node *n = exps->h; n; n = n->next)
{
sql_exp *e = n->data;
 
-   if(e->type == e_aggr)
+   // Check aggr type! exp_aggr_is_count(e)
+   // only average for now!
+   if(e->type == e_aggr && 
+   !((sql_subfunc *)e->f)->func->s && 
+   strcmp(((sql_subfunc *)e->f)->func->base.name, 
"avg") == 0)
{
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)
+
+   for(node *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;
+   
exp_setalias(w,e->alias.label,e->alias.rname,e->alias.name);
+
+   n->data=w;
+
+   

MonetDB: const_aggr_elim - Extends mtests for optimizer const_ag...

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

Extends mtests for optimizer const_aggr_elim


diffs (66 lines):

diff --git a/sql/test/rel-optimizers/Tests/const-aggr-elim.test 
b/sql/test/rel-optimizers/Tests/const-aggr-elim.test
--- a/sql/test/rel-optimizers/Tests/const-aggr-elim.test
+++ b/sql/test/rel-optimizers/Tests/const-aggr-elim.test
@@ -5,6 +5,14 @@ statement ok
 INSERT INTO baz (a, b) VALUES (42, 1), (31, 6), (32, 6), (36, 7), (57, 3)
 
 query I rowsort 
+SELECT avg(b) FROM baz GROUP BY b
+
+1
+3
+6
+7
+
+query I rowsort 
 SELECT avg(3) FROM baz GROUP BY b
 
 3
@@ -18,8 +26,45 @@ 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 ]
+| ) [ "baz"."b" NOT NULL ] [ "baz"."b" NOT NULL ]
+) [ tinyint(2) "3" as "%1"."%1" ]
+
+query I rowsort 
+SELECT 1 + avg(3) FROM baz GROUP BY b
+
+4
+4
+4
+4
+
+query T nosort
+PLAN SELECT 1 + avg(3) FROM baz GROUP BY b
+
+project (
+| group by (
+| | table("sys"."baz") [ "baz"."b" NOT NULL ]
+| ) [ "baz"."b" NOT NULL ] [ "baz"."b" NOT NULL ]
+) [ "sys"."sql_add"(tinyint(2) "3", double(53) "1") NOT NULL ]
+
+query I rowsort 
+SELECT avg(NULL) FROM baz GROUP BY b
+
+NULL
+NULL
+NULL
+NULL
+
+query II rowsort
+SELECT avg(3), avg(b) FROM baz GROUP BY b
+
+3
+1
+3
+3
+3
+6
+3
+7
 
 query I rowsort
 SELECT count(3) FROM baz GROUP BY b
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: clean_parser - approved output

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

approved output


diffs (19 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
@@ -1633,6 +1633,7 @@ sql_table *mvc_bind_table(mvc *c, sql_sc
 str mvc_commit(mvc *c, int chain, const char *name, bool enabling_auto_commit);
 int mvc_create_column(sql_column **col, mvc *m, sql_table *t, const char 
*name, sql_subtype *tpe);
 int mvc_create_table(sql_table **t, mvc *m, sql_schema *s, const char *name, 
int tt, bit system, int persistence, int commit_action, int sz, bit properties);
+void mvc_query_processed(mvc *m);
 int mvc_result_column(backend *be, const char *tn, const char *name, const 
char *typename, int digits, int scale, BAT *b);
 int mvc_result_table(backend *be, oid query_id, int nr_cols, mapi_query_t 
type);
 str mvc_rollback(mvc *c, int chain, const char *name, bool 
disabling_auto_commit);
@@ -1646,7 +1647,6 @@ sql_rel *rel_project(allocator *sa, sql_
 void res_tables_destroy(res_table *results);
 list *sa_list(allocator *sa);
 char *sa_message(allocator *sa, _In_z_ _Printf_format_string_ const char 
*format, ...) __attribute__((__format__(__printf__, 2, 3)));
-void scanner_query_processed(struct scanner *s);
 str sht_dec2_bte(bte *res, const int *s1, const sht *v);
 str sht_dec2_dbl(dbl *res, const int *s1, const sht *v);
 str sht_dec2_flt(flt *res, const int *s1, const sht *v);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: clean_parser - merged with default

2024-12-17 Thread Niels Nes via checkin-list
Changeset: 4a40719a9909 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4a40719a9909
Modified Files:
sql/server/CMakeLists.txt
Branch: clean_parser
Log Message:

merged with default


diffs (truncated from 1036 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_public_headers
   $
   $)
 
-add_library(stream
-  SHARED)
+if(MONETDB_STATIC)
+  add_library(stream STATIC)
+else()
+  add_library(stream SHARED)
+endif()
 
 target_sources(stream
   PRIVATE
@@ -125,11 +128,13 @@ install(TARGETS
   COMPONENT streamdev
   INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 
-install(EXPORT streamTargets
-  FILE streamTargets.cmake
-  NAMESPACE MonetDB::
-  DESTINATION ${EXPORT_TARGET_PATH}
-  COMPONENT streamdev)
+if(NOT MONETDB_STATIC)
+  install(EXPORT streamTargets
+FILE streamTargets.cmake
+NAMESPACE MonetDB::
+DESTINATION ${EXPORT_TARGET_PATH}
+COMPONENT streamdev)
+endif()
 
 if(WIN32)
   install(FILES
diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -34,17 +34,19 @@ target_link_libraries(mutils
 target_compile_definitions(mutils PRIVATE
   LIBMUTILS)
 
-set_target_properties(mutils
-  PROPERTIES
-  POSITION_INDEPENDENT_CODE ON
-  PUBLIC_HEADER mutils.h)
+if(NOT MONETDB_STATIC)
+  set_target_properties(mutils
+PROPERTIES
+POSITION_INDEPENDENT_CODE ON
+PUBLIC_HEADER mu

MonetDB: clean_parser - corrections after merge

2024-12-17 Thread Niels Nes via checkin-list
Changeset: 0b3640260cb3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0b3640260cb3
Modified Files:
sql/server/sql_parser.y
Branch: clean_parser
Log Message:

corrections after merge


diffs (47 lines):

diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -2364,6 +2364,7 @@ func_def:
append_int(f, F_PROC);
append_int(f, FUNC_LANG_MAL);
append_int(f, $1);
+   append_int(f, 0);
  $$ = _symbol_create_list( SQL_CREATE_FUNC, f ); }
  |  create_or_replace func_def_type_no_proc qfunc
'(' opt_paramlist ')'
@@ -2392,6 +2393,7 @@ func_def:
append_int(f, F_PROC);
append_int(f, FUNC_LANG_SQL);
append_int(f, $1);
+   append_int(f, 0);
  $$ = _symbol_create_list( SQL_CREATE_FUNC, f ); }
   | create_or_replace func_def_type_no_proc qfunc
'(' opt_paramlist ')'
@@ -2431,6 +2433,7 @@ func_def:
append_int(f, $2);
append_int(f, lang);
append_int(f, $1);
+   append_int(f, 0);
$$ = _symbol_create_list( SQL_CREATE_FUNC, f );
}
 ;
@@ -5070,17 +5073,12 @@ aggr_or_window_ref:
yyerror(m, "Cannot have both order by clause and within 
group clause");
YYABORT;
  }
-  if ($3) {
-   for(dnode *dn = $3->h; dn; dn = dn->next)
-   append_symbol(l, dn->data.sym);
-  } else {
-append_symbol(l, NULL);
-  }
+ append_list(l, $3);
  if ($4)
append_symbol(l, $4);
  else
append_symbol(l, $6);
- $$ = _symbol_create_list( SQL_AGGR, l ); }
+ $$ = _symbol_create_list( SQL_NOP, l ); }
  |  qfunc '(' DISTINCT expr_list ')'
{ dlist *l = L();
  append_list(l, $1);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: clean_parser - approved output

2024-12-17 Thread Niels Nes via checkin-list
Changeset: c8d8a8b4812a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c8d8a8b4812a
Modified Files:
sql/test/Dependencies/Tests/dependency_owner_schema_3.test
Branch: clean_parser
Log Message:

approved output


diffs (12 lines):

diff --git a/sql/test/Dependencies/Tests/dependency_owner_schema_3.test 
b/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
--- a/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
+++ b/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
@@ -886,7 +886,7 @@ DEP_FUNC
 query TTT nosort
 SELECT distinct c.name, v.name, 'DEP_VIEW' from sys.columns as c, sys.tables 
as v, sys.dependencies as dep where c.id = dep.id AND v.id = dep.depend_id AND 
dep.depend_type = 5 AND v.type in (1, 11, 21, 31) order by c.name, v.name
 
-1788 values hashing to a7640c35ae84fb0995f708b8b88e01d0
+1782 values hashing to 88adfb6235ea1b5387ae4b7625859b0c
 
 query TTT nosort
 SELECT c.name, k.name, 'DEP_KEY' from sys.columns as c,  sys.objects as kc, 
sys.keys as k where kc."name" = c.name AND kc.id = k.id AND k.table_id = 
c.table_id AND k.rkey = -1 order by c.name, k.name
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: odbc_loader - merged with default

2024-12-17 Thread Niels Nes via checkin-list
Changeset: 25b2bd0caf8d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/25b2bd0caf8d
Modified Files:
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.h
sql/server/CMakeLists.txt
sql/server/rel_select.c
sql/server/sql_parser.y
Branch: odbc_loader
Log Message:

merged with default


diffs (truncated from 4307 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_public_headers
   $
   $)
 
-add_library(stream
-  SHARED)
+if(MONETDB_STATIC)
+  add_library(stream STATIC)
+else()
+  add_library(stream SHARED)
+endif()
 
 target_sources(stream
   PRIVATE
@@ -125,11 +128,13 @@ install(TARGETS
   COMPONENT streamdev
   INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 
-install(EXPORT streamTargets
-  FILE streamTargets.cmake
-  NAMESPACE MonetDB::
-  DESTINATION ${EXPORT_TARGET_PATH}
-  COMPONENT streamdev)
+if(NOT MONETDB_STATIC)
+  install(EXPORT streamTargets
+FILE streamTargets.cmake
+NAMESPACE MonetDB::
+DESTINATION ${EXPORT_TARGET_PATH}
+COMPONENT streamdev)
+endif()
 
 if(WIN32)
   install(FILES
diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -34,17 +34,19 @@ target_link_libraries(mutils
 target_compile_definitions(mutils PRIVATE
   LIBMUTILS)
 
-set_target_properties(mutils
-  PROPERTIES
-  POSITION_INDEPENDENT_CODE ON
-  PUBLIC

MonetDB: odbc_loader - merged with default

2024-12-17 Thread Niels Nes via checkin-list
Changeset: 9502377a9d2e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9502377a9d2e
Modified Files:
clients/Tests/exports.stable.out
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.h
sql/common/sql_types.c
sql/server/rel_select.c
sql/server/sql_parser.y
Branch: odbc_loader
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_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#759

MonetDB: odbc_loader - approved output

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

approved output


diffs (34 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
@@ -1628,6 +1628,7 @@ str lng_num2dec_flt(flt *res, const lng 
 str lng_num2dec_int(int *res, const lng *v, const int *d2, const int *s2);
 str lng_num2dec_lng(lng *res, const lng *v, const int *d2, const int *s2);
 str lng_num2dec_sht(sht *res, const lng *v, const int *d2, const int *s2);
+int mapiuri_valid(const char *uri);
 sql_schema *mvc_bind_schema(mvc *c, const char *sname);
 sql_table *mvc_bind_table(mvc *c, sql_schema *s, const char *tname);
 str mvc_commit(mvc *c, int chain, const char *name, bool enabling_auto_commit);
@@ -1641,10 +1642,14 @@ bool option_disable_fork;
 sql_part *partition_find_part(sql_trans *tr, sql_table *pt, sql_part *pp);
 int pl_register(const char *name, pl_add_types_fptr add_types, pl_load_fptr 
pl_load);
 void pl_unregister(const char *name);
+prop *prop_create(allocator *sa, rel_prop kind, prop *pre);
 void qc_delete(qc *cache, cq *q);
 cq *qc_find(qc *cache, int id);
 cq *qc_insert(qc *cache, allocator *sa, sql_rel *r, symbol *s, list *params, 
mapi_query_t type, char *codedstr, int no_mitosis);
+void rel_base_use_all(mvc *sql, sql_rel *rel);
+sql_rel *rel_basetable(mvc *sql, sql_table *t, const char *tname);
 sql_rel *rel_project(allocator *sa, sql_rel *l, list *e);
+list *rel_projections(mvc *sql, sql_rel *rel, const char *tname, int settname, 
int intern);
 void res_tables_destroy(res_table *results);
 list *sa_list(allocator *sa);
 char *sa_message(allocator *sa, _In_z_ _Printf_format_string_ const char 
*format, ...) __attribute__((__format__(__printf__, 2, 3)));
@@ -1674,6 +1679,7 @@ void sql_init_subtype(sql_subtype *res, 
 void sql_register(const char *name, const unsigned char *code);
 int sql_trans_add_dependency_change(sql_trans *tr, sqlid id, 
sql_dependency_change_type tp);
 int sql_trans_create_table(sql_table **tres, sql_trans *tr, sql_schema *s, 
const char *name, const char *sql, int tt, bit system, int persistence, int 
commit_action, int sz, bte properties);
+stmt *stmt_func(backend *be, stmt *ops, const char *name, sql_rel *imp, int 
f_union);
 
 # stream
 stream *block_stream(stream *s);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: const_aggr_elim - added new test case

2024-12-17 Thread Wolf Schulz via checkin-list
Changeset: 695d8f13fee2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/695d8f13fee2
Modified Files:
sql/server/rel_optimize_proj.c
sql/test/rel-optimizers/Tests/const-aggr-elim.test
Branch: const_aggr_elim
Log Message:

added new test case


diffs (45 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
@@ -3037,6 +3037,8 @@ rel_const_aggr_elimination(visitor *v, s
{
sql_exp *e = n->data;
 
+   // SELECT 1 + avg(3), avg(3) * 10 FROM baz 
GROUP BY b;
+
// Check aggr type! exp_aggr_is_count(e)
// only average for now!
if(e->type == e_aggr && 
diff --git a/sql/test/rel-optimizers/Tests/const-aggr-elim.test 
b/sql/test/rel-optimizers/Tests/const-aggr-elim.test
--- a/sql/test/rel-optimizers/Tests/const-aggr-elim.test
+++ b/sql/test/rel-optimizers/Tests/const-aggr-elim.test
@@ -55,6 +55,29 @@ NULL
 NULL
 
 query II rowsort
+SELECT 1 + avg(3), avg(3) * 10 FROM baz GROUP BY b
+
+4
+30
+4
+30
+4
+30
+4
+30
+
+query T nosort
+PLAN SELECT 1 + avg(3), avg(3) * 10 FROM baz GROUP BY b
+
+project (
+| project (
+| | group by (
+| | | table("sys"."baz") [ "baz"."b" NOT NULL ]
+| | ) [ "baz"."b" NOT NULL ] [ "baz"."b" NOT NULL ]
+| ) [ tinyint(2) "3" as "%1"."%1" ]
+) [ "sys"."sql_add"("%1"."%1" NOT NULL, double(53) "1") NOT NULL, 
"sys"."sql_mul"("%1"."%1" NOT NULL, double(53) "10") NOT NULL ]
+
+query II rowsort
 SELECT avg(3), avg(b) FROM baz GROUP BY b
 
 3
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org