MonetDB: odbc-tls - small compilation issue (ie start a block wi...

2024-05-24 Thread Niels Nes via checkin-list
Changeset: 49981ac16809 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/49981ac16809
Modified Files:
clients/odbc/driver/SQLSetConnectAttr.c
Branch: odbc-tls
Log Message:

small compilation issue (ie start a block with {}, if you need local variables 
in a switch case label)


diffs (18 lines):

diff --git a/clients/odbc/driver/SQLSetConnectAttr.c 
b/clients/odbc/driver/SQLSetConnectAttr.c
--- a/clients/odbc/driver/SQLSetConnectAttr.c
+++ b/clients/odbc/driver/SQLSetConnectAttr.c
@@ -65,12 +65,12 @@ MNDBSetConnectAttr(ODBCDbc *dbc,
/* Driver does not support this function */
addDbcError(dbc, "IM001", NULL, 0);
return SQL_ERROR;
-   case SQL_ATTR_CONNECTION_TIMEOUT:   /* SQLUINTEGER */
+   case SQL_ATTR_CONNECTION_TIMEOUT: { /* SQLUINTEGER */
long timeout = 1000 * (long)(uintptr_t) ValuePtr;
msetting_set_long(dbc->settings, MP_CONNECT_TIMEOUT, timeout);
if (dbc->mid)
mapi_timeout(dbc->mid, timeout);
-   break;
+   }break;
case SQL_ATTR_LOGIN_TIMEOUT:/* SQLUINTEGER */
/* currently only value 0 (no timeout) is accepted
 * as mapilib currently does not provide a way to set login 
timeout */
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: odbc-tls - merged with default

2024-05-23 Thread Niels Nes via checkin-list
Changeset: 815cd59d6d88 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/815cd59d6d88
Branch: odbc-tls
Log Message:

merged with default


diffs (truncated from 5367 to 300 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1038,6 +1038,7 @@ log_read_types_file(logger *lg, FILE *fp
 {
int id = 0;
char atom_name[IDLENGTH];
+   bool seen_geom = false;
 
/* scanf should use IDLENGTH somehow */
while (fscanf(fp, "%d,%63s\n", , atom_name) == 2) {
@@ -1049,9 +1050,17 @@ log_read_types_file(logger *lg, FILE *fp
GDKerror("unknown type in log file '%s'\n", atom_name);
return GDK_FAIL;
}
+   seen_geom |= strcmp(atom_name, "mbr") == 0 || strcmp(atom_name, 
"wkb") == 0;
lg->type_id[i] = (int8_t) id;
lg->type_nr[id < 0 ? 256 + id : id] = i;
}
+#ifdef HAVE_GEOM
+   if (!seen_geom && ATOMindex("mbr") > 0) {
+   GDKerror("incompatible database: server supports GEOM, but 
database does not\n");
+   return GDK_FAIL;
+   }
+#endif
+   (void) seen_geom;
return GDK_SUCCEED;
 }
 
@@ -1802,7 +1811,8 @@ bm_subcommit(logger *lg, logged_range *p
cleanup++;
if (lids[p] == -1)
continue;
-   if (BUNappend(dcatalog, &(oid){p}, true) != 
GDK_SUCCEED) {
+   if (BUNfnd(dcatalog, &(oid){p}) == BUN_NONE &&
+   BUNappend(dcatalog, &(oid){p}, true) != 
GDK_SUCCEED) {
while (BATcount(dcatalog) > dcnt) {
if (BUNdelete(dcatalog, 
BATcount(dcatalog) - 1) != GDK_SUCCEED) {
TRC_CRITICAL(WAL, "delete after 
failed append failed\n");
diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -1477,153 +1477,155 @@ GDKanalytical_str_group_concat(BAT *r, B
  * Only for the casefold table, if the converted codepoint is negative,
  * it is actually an escape into the specialcase table.  The absolute
  * value is the index. */
+
+/* These tables were created using the code in unicaseconvtabs.py */
 static const char *const specialcase[] = {
NULL,
-   "ss",
-   "i\xCC\x87",
-   "\xCA\xBCn",
-   "j\xCC\x8C",
-   "\xCE\xB9\xCC\x88\xCC\x81",
-   "\xCF\x85\xCC\x88\xCC\x81",
-   "\xD5\xA5\xD6\x82",
-   "h\xCC\xB1",
-   "t\xCC\x88",
-   "w\xCC\x8A",
-   "y\xCC\x8A",
-   "a\xCA\xBE",
-   "\xCF\x85\xCC\x93",
-   "\xCF\x85\xCC\x93\xCC\x80",
-   "\xCF\x85\xCC\x93\xCC\x81",
-   "\xCF\x85\xCC\x93\xCD\x82",
-   "\xE1\xBC\x80\xCE\xB9",
-   "\xE1\xBC\x81\xCE\xB9",
-   "\xE1\xBC\x82\xCE\xB9",
-   "\xE1\xBC\x83\xCE\xB9",
-   "\xE1\xBC\x84\xCE\xB9",
-   "\xE1\xBC\x85\xCE\xB9",
-   "\xE1\xBC\x86\xCE\xB9",
-   "\xE1\xBC\x87\xCE\xB9",
-   "\xE1\xBC\xA0\xCE\xB9",
-   "\xE1\xBC\xA1\xCE\xB9",
-   "\xE1\xBC\xA2\xCE\xB9",
-   "\xE1\xBC\xA3\xCE\xB9",
-   "\xE1\xBC\xA4\xCE\xB9",
-   "\xE1\xBC\xA5\xCE\xB9",
-   "\xE1\xBC\xA6\xCE\xB9",
-   "\xE1\xBC\xA7\xCE\xB9",
-   "\xE1\xBD\xA0\xCE\xB9",
-   "\xE1\xBD\xA1\xCE\xB9",
-   "\xE1\xBD\xA2\xCE\xB9",
-   "\xE1\xBD\xA3\xCE\xB9",
-   "\xE1\xBD\xA4\xCE\xB9",
-   "\xE1\xBD\xA5\xCE\xB9",
-   "\xE1\xBD\xA6\xCE\xB9",
-   "\xE1\xBD\xA7\xCE\xB9",
-   "\xE1\xBD\xB0\xCE\xB9",
-   "\xCE\xB1\xCE\xB9",
-   "\xCE\xAC\xCE\xB9",
-   "\xCE\xB1\xCD\x82",
-   "\xCE\xB1\xCD\x82\xCE\xB9",
-   "\xE1\xBD\xB4\xCE\xB9",
-   "\xCE\xB7\xCE\xB9",
-   "\xCE\xAE\xCE\xB9",
-   "\xCE\xB7\xCD\x82",
-   "\xCE\xB7\xCD\x82\xCE\xB9",
-   "\xCE\xB9\xCC\x88\xCC\x80",
-   "\xCE\xB9\xCD\x82",
-   "\xCE\xB9\xCC\x88\xCD\x82",
-   "\xCF\x85\xCC\x88\xCC\x80",
-   "\xCF\x81\xCC\x93",
-   "\xCF\x85\xCD\x82",
-   "\xCF\x85\xCC\x88\xCD\x82",
-   "\xE1\xBD\xBC\xCE\xB9",
-   "\xCF\x89\xCE\xB9",
-   "\xCF\x8E\xCE\xB9",
-   "\xCF\x89\xCD\x82",
-   "\xCF\x89\xCD\x82\xCE\xB9",
-   "ff",
-   "fi",
-   "fl",
-   "ffi",
-   "ffl",
-   "st",
-   "\xD5\xB4\xD5\xB6",
-   "\xD5\xB4\xD5\xA5",
-   "\xD5\xB4\xD5\xAB",
-   "\xD5\xBE\xD5\xB6",
-   "\xD5\xB4\xD5\xAD",
-   "SS",
-   "FF",
-   "FI",
-   "FL",
-   "FFI",
-   "FFL",
-   "ST",
-   "\xD4\xB5\xD5\x92",
-   "\xD5\x84\xD5\x86",
-   "\xD5\x84\xD4\xB5",
-   "\xD5\x84\xD4\xBB",
-   "\xD5\x8E\xD5\x86",
-   "\xD5\x84\xD4\xBD",
-   "\xCA\xBCN",
-   "\xCE\x99\xCC\x88\xCC\x81",
-   "\xCE\xA5\xCC\x88\xCC\x81",
-   "J\xCC\x8C",
-   "H\xCC\xB1",
-   "T\xCC\x88",
-   "W\xCC\x8A",
-   "Y\xCC\x8A",
-   "A\xCA\xBE",
-   

MonetDB: odbc-tls - add missing wtypes for windows

2024-05-23 Thread Niels Nes via checkin-list
Changeset: f909d09defb1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f909d09defb1
Modified Files:
clients/odbc/samples/odbcconnect.c
Branch: odbc-tls
Log Message:

add missing wtypes for windows


diffs (16 lines):

diff --git a/clients/odbc/samples/odbcconnect.c 
b/clients/odbc/samples/odbcconnect.c
--- a/clients/odbc/samples/odbcconnect.c
+++ b/clients/odbc/samples/odbcconnect.c
@@ -9,6 +9,12 @@
  * Copyright August 2008 - 2023 MonetDB B.V.;
  * Copyright 1997 - July 2008 CWI.
  */
+#ifdef _MSC_VER
+/* suppress deprecation warning for snprintf */
+#define _CRT_SECURE_NO_WARNINGS
+
+#include 
+#endif
 #include 
 #include 
 #include 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: odbc-tls - trigger build

2024-05-23 Thread Niels Nes via checkin-list
Changeset: a8f48d17688b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a8f48d17688b
Modified Files:
clients/odbc/driver/SQLConnect.c
Branch: odbc-tls
Log Message:

trigger build


diffs (11 lines):

diff --git a/clients/odbc/driver/SQLConnect.c b/clients/odbc/driver/SQLConnect.c
--- a/clients/odbc/driver/SQLConnect.c
+++ b/clients/odbc/driver/SQLConnect.c
@@ -70,6 +70,7 @@ const struct attr_setting attr_settings[
 
 const int attr_setting_count = sizeof(attr_settings) / 
sizeof(attr_settings[0]);
 
+
 int
 attr_setting_lookup(const char *attr_name, bool allow_alt_name)
 {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: odbc-tls - try to fix compilation issue on bufsize (int...

2024-05-23 Thread Niels Nes via checkin-list
Changeset: b2ab3e53c2ef for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b2ab3e53c2ef
Modified Files:
clients/odbc/driver/SQLConnect.c
Branch: odbc-tls
Log Message:

try to fix compilation issue on bufsize (int vs size_t)


diffs (12 lines):

diff --git a/clients/odbc/driver/SQLConnect.c b/clients/odbc/driver/SQLConnect.c
--- a/clients/odbc/driver/SQLConnect.c
+++ b/clients/odbc/driver/SQLConnect.c
@@ -240,7 +240,7 @@ end:
 }
 
 static int
-lookup(const char *dsn, const struct attr_setting *entry, char *buf, size_t 
bufsize)
+lookup(const char *dsn, const struct attr_setting *entry, char *buf, int 
bufsize)
 {
int n;
assert(entry->name);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: odbc-tls - it seems setsockopt on windows needs char*, ...

2024-05-23 Thread Niels Nes via checkin-list
Changeset: 65fd1c1dbd3c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/65fd1c1dbd3c
Modified Files:
clients/mapilib/connect.c
Branch: odbc-tls
Log Message:

it seems setsockopt on windows needs char*, while descent systems have void *


diffs (16 lines):

diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -356,9 +356,10 @@ connect_socket_tcp_addr(Mapi mid, struct
.tv_sec = timeout / 1000,
.tv_usec = timeout % 1000,
};
+   /* cast to char * for Windows, no harm on "normal" systems */
if (
-   setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, , sizeof(tv)) 
== SOCKET_ERROR
-   || setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, , 
sizeof(tv)) == SOCKET_ERROR
+   setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, (char*), 
sizeof(tv)) == SOCKET_ERROR
+   || setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, (char*), 
sizeof(tv)) == SOCKET_ERROR
) {
closesocket(s);
return mapi_printError(
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - solved issue #7514, handle window function wi...

2024-05-17 Thread Niels Nes via checkin-list
Changeset: 28b1ec5883ad for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/28b1ec5883ad
Added Files:
sql/test/BugTracker-2024/Tests/7514-wrong-window-function.test
Modified Files:
sql/server/rel_select.c
sql/test/BugTracker-2024/Tests/All
Branch: default
Log Message:

solved issue #7514, handle window function with more than 2 arguments


diffs (60 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4744,6 +4744,23 @@ rel_rankop(sql_query *query, sql_rel **r
char *uaname = SA_NEW_ARRAY(sql->ta, char, strlen(aname) + 1);
return sql_error(sql, 02, SQLSTATE(42000) "%s: window functions 
cannot be nested", toUpperCopy(uaname, aname));
}
+   if (window_function->token == SQL_UNOP || window_function->token == 
SQL_OP) {
+   window_function->token = SQL_NOP;
+   dn->next->next->data.lval = dlist_append_symbol(sql->sa, 
dlist_create( sql->sa ), dn->next->next->data.sym); /* make a list */
+   }
+   if (window_function->token == SQL_BINOP) {
+   window_function->token = SQL_NOP;
+   dn->next->next->data.lval = dlist_append_symbol(sql->sa, 
dlist_append_symbol(sql->sa, dlist_create( sql->sa ), 
dn->next->next->data.sym), dn->next->next->next->data.sym); /* make a list */
+   dn->next->next->next = dn->next->next->next->next; /* skip 
second arg */
+   }
+   if (window_function->token == SQL_AGGR)
+   dn->next->next->data.lval = dlist_append_symbol(sql->sa, 
dlist_create( sql->sa ), dn->next->next->data.sym); /* make a list */
+   if (window_function->token == SQL_NOP)
+   window_function->token = SQL_AGGR;
+   if (window_function->token != SQL_RANK && window_function->token != 
SQL_AGGR) {
+   char *uaname = SA_NEW_ARRAY(sql->ta, char, strlen(aname) + 1);
+   return sql_error(sql, 02, SQLSTATE(42000) "SELECT: window 
function '%s' unknown", toUpperCopy(uaname, aname));
+   }
 
/* window operations are only allowed in the projection */
if (!is_sql_sel(f))
@@ -4814,7 +4831,7 @@ rel_rankop(sql_query *query, sql_rel **r
}
} else { /* aggregation function call */
distinct = dn->next->data.i_val;
-   for (dargs = dn->next->next ; dargs && dargs->data.sym ; dargs 
= dargs->next) {
+   for (dargs = dn->next->next->data.lval->h ; dargs && 
dargs->data.sym ; dargs = dargs->next) {
exp_kind ek = {type_value, card_column, FALSE};
sql_subtype *empty = sql_bind_localtype("void"), *bte = 
sql_bind_localtype("bte");
 
diff --git a/sql/test/BugTracker-2024/Tests/7514-wrong-window-function.test 
b/sql/test/BugTracker-2024/Tests/7514-wrong-window-function.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7514-wrong-window-function.test
@@ -0,0 +1,11 @@
+statement error SELECT: no such window function 'wrong_function'(tinyint, 
tinyint, tinyint)
+select
+   wrong_function(col1, col2, col3) over w
+from
+   (select 0 as col1, 1 as col2, 2 as col3) t window w as (partition by 
col1)
+
+statement error SELECT: identifier 'wrong_column' unknown
+select
+   wrong_function(col1, col2, wrong_column) over w
+from
+   (select 0 as col1, 1 as col2, 2 as col3) t window w as (partition by 
col1)
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -58,3 +58,4 @@ field-arg-error-Bug-7506
 7511-password-hash-missing-error
 7512-concurrent-globaltmp-instantiate-crash
 7513-uri-authority-parse-issue
+7514-wrong-window-function
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - merged

2024-05-16 Thread Niels Nes via checkin-list
Changeset: 13142ded24ef for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/13142ded24ef
Branch: default
Log Message:

merged


diffs (274 lines):

diff --git a/debian/rules b/debian/rules
--- a/debian/rules
+++ b/debian/rules
@@ -55,9 +55,9 @@ override_dh_auto_install:
dh_auto_install
rm debian/tmp/usr/bin/monetdb_mtest.sh
rm -r debian/tmp/usr/share/monetdb
-   rm debian/tmp/usr/lib/*/monetdb5/lib_opt_sql_append.so
-   rm debian/tmp/usr/lib/*/monetdb5/lib_microbenchmark*.so
-   rm debian/tmp/usr/lib/*/monetdb5/lib_udf*.so
+   rm debian/tmp/usr/lib/*/monetdb5*/lib_opt_sql_append.so
+   rm debian/tmp/usr/lib/*/monetdb5*/lib_microbenchmark*.so
+   rm debian/tmp/usr/lib/*/monetdb5*/lib_udf*.so
 
 override_dh_installsystemd:
dh_installsystemd --no-enable --no-start
diff --git a/sql/backends/monet5/generator/generator.c 
b/sql/backends/monet5/generator/generator.c
--- a/sql/backends/monet5/generator/generator.c
+++ b/sql/backends/monet5/generator/generator.c
@@ -74,83 +74,93 @@ VLTgenerator_noop(Client cntxt, MalBlkPt
return MAL_SUCCEED;
 }
 
-#define check_bte() (s > 0 ? f > l : f < l)
-#define check_sht() (s > 0 ? f > l : f < l)
-#define check_int() (s > 0 ? f > l : f < l)
+#define check_bte() ((void)0)
+#define check_sht() ((void)0)
 #if SIZEOF_BUN < SIZEOF_LNG
-#define check_lng() (s > 0 ? f > l || s > (lng) BUN_MAX : f < l || s < -(lng) 
BUN_MAX)
+#define check_int()
\
+   do {
\
+   if (cnt > (unsigned int) BUN_MAX)   
\
+   throw(MAL, "generator.table",   
\
+ SQLSTATE(42000) "Illegal generator range");   
\
+   } while (0)
 #else
-#define check_lng() (s > 0 ? f > l : f < l)
+#define check_int() ((void)0)
 #endif
+#define check_lng()
\
+   do {
\
+   if (cnt > (ulng) BUN_MAX)   
\
+   throw(MAL, "generator.table",   
\
+ SQLSTATE(42000) "Illegal generator range");   
\
+   } while (0)
 #ifdef HAVE_HGE
-#define check_hge() (s > 0 ? f > l || s > (lng) BUN_MAX : f < l || s < -(lng) 
BUN_MAX)
+#define check_hge()
\
+   do {
\
+   if (cnt > (uhge) BUN_MAX)   
\
+   throw(MAL, "generator.table",   
\
+ SQLSTATE(42000) "Illegal generator range");   
\
+   } while (0)
 #endif
 
-/*
- * The base line consists of materializing the generator iterator value
- */
-#define VLTmaterialize(TPE)
\
+#define VLTmaterialize(TPE, uTPE)  
\
do {
\
-   TPE *v, f, l, s;
\
+   TPE f, l, s;
\
+   uTPE cnt;   
\
+   
\
f = *getArgReference_##TPE(stk, pci, 1);
\
l = *getArgReference_##TPE(stk, pci, 2);
\
if ( pci->argc == 3)
\
-   s = f<=l? (TPE) 1: (TPE)-1; 
\
-   else s =  *getArgReference_##TPE(stk,pci, 3);   
\
-   if (s == 0 || is_##TPE##_nil(f) || is_##TPE##_nil(l) || 
check_##TPE()) \
+   s = f <= l ? (TPE) 1 : (TPE) -1;  

MonetDB: default - fixed bug #7488, for ranges where the end is ...

2024-05-16 Thread Niels Nes via checkin-list
Changeset: c803f8ba800b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c803f8ba800b
Modified Files:
gdk/gdk_analytic.h
gdk/gdk_analytic_func.c
sql/test/BugTracker-2024/Tests/orderby-max-over-rows-Bug-7488.test
Branch: default
Log Message:

fixed bug #7488, for ranges where the end is before the beginning skip 
computation of the window function using the segment tree


diffs (44 lines):

diff --git a/gdk/gdk_analytic.h b/gdk/gdk_analytic.h
--- a/gdk/gdk_analytic.h
+++ b/gdk/gdk_analytic.h
@@ -98,13 +98,14 @@ gdk_export gdk_return GDKrebuild_segment
do { /* taken from https://www.vldb.org/pvldb/vol8/p1058-leis.pdf */ \
oid begin = START, tend = END;  \
CAST computed;  \
-   \
INIT_AGGREGATE(ARG1, ARG2, ARG3);   \
+   if (begin < tend)   \
for (oid level = 0; level < nlevels; level++) { \
CAST *tlevel = (CAST *) segment_tree + 
levels_offset[level]; \
oid parent_begin = begin / SEGMENT_TREE_FANOUT; \
oid parent_end = tend / SEGMENT_TREE_FANOUT;\
\
+   \
if (parent_begin == parent_end) {   \
for (oid pos = begin; pos < tend; pos++) \
COMPUTE(tlevel[pos], ARG1, ARG2, ARG3); 
\
diff --git a/gdk/gdk_analytic_func.c b/gdk/gdk_analytic_func.c
--- a/gdk/gdk_analytic_func.c
+++ b/gdk/gdk_analytic_func.c
@@ -37,7 +37,7 @@ GDKrebuild_segment_tree(oid ncount, oid 
 
assert(ncount > 0);
do { /* compute the next number of levels */
-   counter = (oid) ceil((dbl)counter / SEGMENT_TREE_FANOUT);
+   counter = (counter+(SEGMENT_TREE_FANOUT-1)) / 
SEGMENT_TREE_FANOUT;
next_tree_size += counter;
next_levels++;
} while (counter > 1);
diff --git a/sql/test/BugTracker-2024/Tests/orderby-max-over-rows-Bug-7488.test 
b/sql/test/BugTracker-2024/Tests/orderby-max-over-rows-Bug-7488.test
--- a/sql/test/BugTracker-2024/Tests/orderby-max-over-rows-Bug-7488.test
+++ b/sql/test/BugTracker-2024/Tests/orderby-max-over-rows-Bug-7488.test
@@ -3,8 +3,7 @@ SELECT 0.10 FROM dependencies ORDER 
 
 0.100
 
-skipif knownfail
 query R nosort
-SELECT 0.10 FROM dependencies ORDER BY max ( 'y' ) OVER ( ROWS BETWEEN 
1.10 PRECEDING AND 8 PRECEDING )
+SELECT 0.10 FROM dependencies ORDER BY max ( 'y' ) OVER ( ROWS BETWEEN 
1.10 PRECEDING AND 8 PRECEDING ) limit 1
 
 0.100
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - improved fix for bug #7483, only set operatio...

2024-05-15 Thread Niels Nes via checkin-list
Changeset: 342491c20478 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/342491c20478
Modified Files:
sql/server/rel_select.c
Branch: default
Log Message:

improved fix for bug #7483, only set operations need an extra project


diffs (12 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4374,7 +4374,7 @@ rel_order_by_column_exp(sql_query *query
if (!found) {
if (needs_distinct)
return sql_error(sql, 02, SQLSTATE(42000) 
"SELECT: with DISTINCT ORDER BY expressions must appear in select list");
-   if (!is_simple_project(r->op))
+   if (!is_simple_project(r->op) && !is_groupby(r->op))
*R = r = rel_project(sql->sa, r, 
rel_projections(sql, r, NULL, 1, 0));
append(r->exps, e);
} else {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - improved fix for #7486, is if reference isn't...

2024-05-15 Thread Niels Nes via checkin-list
Changeset: 0fdcd4435c62 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0fdcd4435c62
Modified Files:
sql/backends/monet5/rel_bin.c
Branch: default
Log Message:

improved fix for #7486, is if reference isn't yet handled, do that first.


diffs (17 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
@@ -4560,9 +4560,11 @@ rel2bin_topn(backend *be, sql_rel *rel, 
sql_rel *rl = rel->l;
 
if (rl->op == op_project) {
-   if (rel_is_ref(rl))
+   if (rel_is_ref(rl)) {
sub = refs_find_rel(refs, rl);
-   else
+   if (!sub)
+   sub = rel2bin_project(be, rl, refs, 
rel);
+   } else
sub = rel2bin_project(be, rl, refs, rel);
} else {
sub = subrel_bin(be, rl, refs);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - fixed bug #7486, topn's over referenced relat...

2024-05-15 Thread Niels Nes via checkin-list
Changeset: 150ba22209cb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/150ba22209cb
Modified Files:
sql/backends/monet5/rel_bin.c
sql/test/BugTracker-2024/Tests/CMDgen_group-Bug-7486.test
Branch: default
Log Message:

fixed bug #7486, topn's over referenced relations need to lookup the allready 
constructed relation


diffs (36 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
@@ -4560,7 +4560,10 @@ rel2bin_topn(backend *be, sql_rel *rel, 
sql_rel *rl = rel->l;
 
if (rl->op == op_project) {
-   sub = rel2bin_project(be, rl, refs, rel);
+   if (rel_is_ref(rl))
+   sub = refs_find_rel(refs, rl);
+   else
+   sub = rel2bin_project(be, rl, refs, rel);
} else {
sub = subrel_bin(be, rl, refs);
}
diff --git a/sql/test/BugTracker-2024/Tests/CMDgen_group-Bug-7486.test 
b/sql/test/BugTracker-2024/Tests/CMDgen_group-Bug-7486.test
--- a/sql/test/BugTracker-2024/Tests/CMDgen_group-Bug-7486.test
+++ b/sql/test/BugTracker-2024/Tests/CMDgen_group-Bug-7486.test
@@ -5,7 +5,6 @@ NULL
 NULL
 NULL
 
-skipif knownfail
 query I nosort
 WITH x AS ( SELECT * FROM generate_series ( 32989 , 8100 ) EXCEPT SELECT * 
FROM generate_series ( 44 , 3 ) ) SELECT CASE WHEN NULL IN ( 69 , MAX ( CASE 
WHEN 97 THEN 66 END ) OVER ( ) + ( SELECT COUNT ( * ) ) ) THEN 41 END FROM x 
LIMIT 3
 
@@ -13,8 +12,7 @@ NULL
 NULL
 NULL
 
-skipif knownfail
-query I nosort
+statement error GDK reported error: BATsubcross: more than one match
 SELECT ( WITH x AS ( SELECT * FROM generate_series ( 32989 , 8100 ) EXCEPT 
SELECT * FROM generate_series ( 44 , 3 ) ) SELECT CASE WHEN NULL IN ( 69 , MAX 
( CASE WHEN 97 THEN 66 END ) OVER ( ) + ( SELECT COUNT ( * ) ) ) THEN 41 END 
FROM x )
 
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - fixed issue #7483, introduce project in order...

2024-05-15 Thread Niels Nes via checkin-list
Changeset: 852e065654bd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/852e065654bd
Modified Files:
sql/backends/monet5/sql_rank.c
sql/server/rel_select.c
sql/test/BugTracker-2024/Tests/rel_setop_get_statistics-Bug-7483.test
Branch: default
Log Message:

fixed issue #7483, introduce project in order by if relation isn't a simple 
project yet.
fixed returns of error messages in rel_rankop.c


diffs (48 lines):

diff --git a/sql/backends/monet5/sql_rank.c b/sql/backends/monet5/sql_rank.c
--- a/sql/backends/monet5/sql_rank.c
+++ b/sql/backends/monet5/sql_rank.c
@@ -832,7 +832,7 @@ SQLntile(Client cntxt, MalBlkPtr mb, Mal
 bailout:
unfix_inputs(3, b, p, n);
finalize_output(res, r, msg);
-   return MAL_SUCCEED;
+   return msg;
 }
 
 static str
@@ -954,7 +954,7 @@ do_limit_value(Client cntxt, MalBlkPtr m
 bailout:
unfix_inputs(3, b, s, e);
finalize_output(res, r, msg);
-   return MAL_SUCCEED;
+   return msg;
 }
 
 str
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4374,6 +4374,8 @@ rel_order_by_column_exp(sql_query *query
if (!found) {
if (needs_distinct)
return sql_error(sql, 02, SQLSTATE(42000) 
"SELECT: with DISTINCT ORDER BY expressions must appear in select list");
+   if (!is_simple_project(r->op))
+   *R = r = rel_project(sql->sa, r, 
rel_projections(sql, r, NULL, 1, 0));
append(r->exps, e);
} else {
e = found;
diff --git 
a/sql/test/BugTracker-2024/Tests/rel_setop_get_statistics-Bug-7483.test 
b/sql/test/BugTracker-2024/Tests/rel_setop_get_statistics-Bug-7483.test
--- a/sql/test/BugTracker-2024/Tests/rel_setop_get_statistics-Bug-7483.test
+++ b/sql/test/BugTracker-2024/Tests/rel_setop_get_statistics-Bug-7483.test
@@ -4,8 +4,9 @@ SELECT 'x' x UNION SELECT 10 x
 x
 10
 
-skipif knownfail
-query T nosort
+query I nosort
 SELECT NTILE ( 1.00 ) OVER ( ORDER BY x LIKE x ) FROM ( SELECT 'x' x UNION 
SELECT 10 x ) v
 
+1
+1
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - missing break in GDKanalyticalntile for the h...

2024-05-15 Thread Niels Nes via checkin-list
Changeset: 306d21881f9c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/306d21881f9c
Modified Files:
gdk/gdk_analytic_func.c
Branch: default
Log Message:

missing break in GDKanalyticalntile for the hge implementation


diffs (20 lines):

diff --git a/gdk/gdk_analytic_func.c b/gdk/gdk_analytic_func.c
--- a/gdk/gdk_analytic_func.c
+++ b/gdk/gdk_analytic_func.c
@@ -157,6 +157,7 @@ GDKanalyticalntile(BAT *r, BAT *b, BAT *
 #else
ANALYTICAL_NTILE_SINGLE_IMP(hge, (val > (hge) 
GDK_lng_max) ? GDK_lng_max : (lng) val, BUN);
 #endif
+   break;
 #endif
default:
goto nosupport;
@@ -186,7 +187,7 @@ GDKanalyticalntile(BAT *r, BAT *b, BAT *
 #else
ANALYTICAL_NTILE_MULTI_IMP(hge, val > (hge) GDK_lng_max 
? GDK_lng_max : (lng) val, BUN);
 #endif
-   break;
+   break;
 #endif
default:
goto nosupport;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - fixed issue #7482, with global group by's the...

2024-05-15 Thread Niels Nes via checkin-list
Changeset: 20acc7b01f57 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/20acc7b01f57
Modified Files:
sql/backends/monet5/rel_bin.c
sql/test/BugTracker-2024/Tests/bin_find_smallest_column-Bug-7482.test
Branch: default
Log Message:

fixed issue #7482, with global group by's there is an empty sub expression list


diffs (22 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
@@ -1713,7 +1713,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l
   and/or an attribute to count */
if (grp) {
as = grp;
-   } else if (left) {
+   } else if (left && !list_empty(left->op4.lval)) {
as = bin_find_smallest_column(be, left);
as = exp_count_no_nil_arg(e, ext, NULL, as);
} else {
diff --git 
a/sql/test/BugTracker-2024/Tests/bin_find_smallest_column-Bug-7482.test 
b/sql/test/BugTracker-2024/Tests/bin_find_smallest_column-Bug-7482.test
--- a/sql/test/BugTracker-2024/Tests/bin_find_smallest_column-Bug-7482.test
+++ b/sql/test/BugTracker-2024/Tests/bin_find_smallest_column-Bug-7482.test
@@ -1,5 +1,5 @@
-skipif knownfail
 query I nosort
 SELECT var_samp ( '12' ) OVER ( ORDER BY CAST ( ( CASE WHEN ( 99 ) THEN COUNT 
( * ) ELSE CASE WHEN 1 THEN ( FALSE ) END END ) AS BIGINT ) )
 
+0
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - fixed #7481, correct cardinality of wndow fun...

2024-05-15 Thread Niels Nes via checkin-list
Changeset: 78961a3f4473 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/78961a3f4473
Modified Files:
sql/server/rel_unnest.c
sql/test/BugTracker-2024/Tests/mvc_row_result_wrap-Bug-7481.test
Branch: default
Log Message:

fixed #7481, correct cardinality of wndow functions on constants


diffs (40 lines):

diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -2239,7 +2239,7 @@ exp_reset_card_and_freevar_set_physical_
switch(e->type) {
case e_aggr:
case e_func: {
-   e->card = list_empty(e->l)?CARD_MULTI:exps_card(e->l);
+   e->card = 
list_empty(e->l)?rel?rel->card:CARD_MULTI:exps_card(e->l);
} break;
case e_column: {
sql_exp *le = NULL, *re = NULL;
@@ -2632,7 +2632,6 @@ rewrite_rank(visitor *v, sql_rel *rel, s
(void)depth;
/* ranks/window functions only exist in the projection */
list *l = e->l, *r = e->r, *gbe = r->h->data, *obe = r->h->next->data;
-   e->card = (rel->card == CARD_AGGR) ? CARD_AGGR : CARD_MULTI; /* After 
the unnesting, the cardinality of the window function becomes larger */
 
int needed = (gbe || obe);
if (l)
@@ -2842,8 +2841,6 @@ rel_union_exps(mvc *sql, sql_exp **l, li
exp_label(sql->sa, ve, ++sql->label); /* an alias is needed */
if (exp_has_rel(ve)) {
sq = exp_rel_get_rel(sql->sa, ve); /* get subquery */
-   if (sq)
-   freevar = rel_has_freevar(sql,sq);
} else {
sq = rel_project(sql->sa, NULL, 
append(sa_list(sql->sa), ve));
if (!exp_is_atom(ve))
diff --git a/sql/test/BugTracker-2024/Tests/mvc_row_result_wrap-Bug-7481.test 
b/sql/test/BugTracker-2024/Tests/mvc_row_result_wrap-Bug-7481.test
--- a/sql/test/BugTracker-2024/Tests/mvc_row_result_wrap-Bug-7481.test
+++ b/sql/test/BugTracker-2024/Tests/mvc_row_result_wrap-Bug-7481.test
@@ -8,7 +8,6 @@ SELECT CASE WHEN COUNT ( ) OVER ( ) THEN
 
 63
 
-skipif knownfail
 query II nosort
 SELECT 50 , CASE WHEN COUNT ( ) OVER ( ) THEN ( 63 ) END
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - merged

2024-05-14 Thread Niels Nes via checkin-list
Changeset: 626a06b4c450 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/626a06b4c450
Branch: Dec2023
Log Message:

merged


diffs (truncated from 388 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -826,3 +826,4 @@ dcc8c702e685a4faf21ccf663028d1bc3d1165d1
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_7
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_SP2_release
 9a694c41042503a22d6c92aeab5bc4ca1912b62e Dec2023_9
+9a694c41042503a22d6c92aeab5bc4ca1912b62e Dec2023_SP3_release
diff --git a/gdk/gdk_calc_convert.c b/gdk/gdk_calc_convert.c
--- a/gdk/gdk_calc_convert.c
+++ b/gdk/gdk_calc_convert.c
@@ -865,6 +865,7 @@ convert_str_fix(BATiter *bi, int tp, voi
return 0;
}
 
+   int (*atomcmp)(const void *, const void *) = ATOMcompare(tp);
TIMEOUT_LOOP(ci->ncand, timeoffset) {
oid x = canditer_next(ci) - candoff;
const char *s = BUNtvar(*bi, x);
@@ -878,7 +879,7 @@ convert_str_fix(BATiter *bi, int tp, voi
goto conversion_failed;
}
assert(len == ATOMsize(tp));
-   if (ATOMcmp(tp, dst, nil) == 0)
+   if (atomcmp(dst, nil) == 0)
nils++;
}
dst = (void *) ((char *) dst + len);
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -899,7 +899,8 @@ BAThash_impl(BAT *restrict b, struct can
case TYPE_uuid:
starthash(uuid);
break;
-   default:
+   default: {
+   int (*atomcmp)(const void *, const void *) = 
ATOMcompare(h->type);
TIMEOUT_LOOP(p, timeoffset) {
const void *restrict v = BUNtail(bi, o - 
b->hseqbase);
c = hash_any(h, v);
@@ -913,8 +914,7 @@ BAThash_impl(BAT *restrict b, struct can
for (hb = hget;
 hb != BUN_NONE;
 hb = HASHgetlink(h, hb)) {
-   if (ATOMcmp(h->type,
-   v,
+   if (atomcmp(v,
BUNtail(bi, hb)) == 
0)
break;
}
@@ -928,6 +928,7 @@ BAThash_impl(BAT *restrict b, struct can
  GOTO_LABEL_TIMEOUT_HANDLER(bailout));
break;
}
+   }
TRC_DEBUG_IF(ACCELERATOR) if (p < cnt1)
TRC_DEBUG_ENDIF(ACCELERATOR,
"%s: abort starthash with "
@@ -975,7 +976,8 @@ BAThash_impl(BAT *restrict b, struct can
case TYPE_uuid:
finishhash(uuid);
break;
-   default:
+   default: {
+   int (*atomcmp)(const void *, const void *) = 
ATOMcompare(h->type);
TIMEOUT_LOOP(ci->ncand - p, timeoffset) {
const void *restrict v = BUNtail(bi, o - b->hseqbase);
c = hash_any(h, v);
@@ -985,7 +987,7 @@ BAThash_impl(BAT *restrict b, struct can
for (hb = hget;
 hb != BUN_NONE;
 hb = HASHgetlink(h, hb)) {
-   if (ATOMcmp(h->type, v, BUNtail(bi, 
hb)) == 0)
+   if (atomcmp(v, BUNtail(bi, hb)) == 0)
break;
}
h->nunique += hb == BUN_NONE;
@@ -999,6 +1001,7 @@ BAThash_impl(BAT *restrict b, struct can
  GOTO_LABEL_TIMEOUT_HANDLER(bailout));
break;
}
+   }
bat_iterator_end();
/* if the number of unique values is equal to the bat count,
 * all values are necessarily distinct */
diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -6594,6 +6594,46 @@ sql_update_dec2023_sp1(Client c, mvc *sq
return err;
 }
 
+static str
+sql_update_dec2023_sp4(Client c, mvc *sql, sql_schema *s)
+{
+   char *err;
+   res_table *output;
+   BAT *b;
+
+   (void) sql;
+   (void) s;
+
+   /* SQL optimizer fixes make that some "dependencies" are no longer
+* dependencies (functions that depend on all columns of a table
+* when it only actually uses a subset of the columns); while we're
+* at it, also fix some ancient dependency 

MonetDB: Dec2023 - enable partitioning on rangejoins

2024-05-14 Thread Niels Nes via checkin-list
Changeset: eed3d16b33f6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/eed3d16b33f6
Modified Files:
monetdb5/optimizer/opt_mergetable.c
Branch: Dec2023
Log Message:

enable partitioning on rangejoins


diffs (88 lines):

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
@@ -945,6 +945,68 @@ mat_join2(MalBlkPtr mb, InstrPtr p, matl
 }
 
 static int
+mat_rangejoin(MalBlkPtr mb, InstrPtr p, matlist_t *ml, int m, int n)
+{
+   int tpe1 = getArgType(mb, p, 0), tpe2 = getArgType(mb, p, 1), k, nr = 1;
+   mat_t *mat = ml->v;
+   InstrPtr l;
+   InstrPtr r;
+
+   //printf("# %s.%s(%d,%d)", getModuleId(p), getFunctionId(p), m, n);
+
+   assert(m >= 0 && n >= 0 && mat[m].mi->argc == mat[n].mi->argc);
+   l = newInstructionArgs(mb, matRef, packRef, mat[m].mi->argc * 
mat[n].mi->argc);
+   r = newInstructionArgs(mb, matRef, packRef, mat[m].mi->argc * 
mat[n].mi->argc);
+   if (!l || !r) {
+   freeInstruction(l);
+   freeInstruction(r);
+   return -1;
+   }
+
+   getArg(l, 0) = getArg(p, 0);
+   getArg(r, 0) = getArg(p, 1);
+
+   for (k = 1; k < mat[m].mi->argc; k++) {
+   InstrPtr q = copyInstruction(p);
+
+   if (!q) {
+   freeInstruction(l);
+   freeInstruction(r);
+   return -1;
+   }
+
+   getArg(q, 0) = newTmpVariable(mb, tpe1);
+   getArg(q, 1) = newTmpVariable(mb, tpe2);
+
+   getArg(q, 3) = getArg(mat[m].mi, k);
+   getArg(q, 4) = getArg(mat[n].mi, k);
+   pushInstruction(mb, q);
+
+   if (mb->errors || propagatePartnr(ml, getArg(mat[m].mi, k), 
getArg(q, 0), nr)
+  || propagatePartnr(ml, getArg(mat[n].mi, 
k), getArg(q, 1), nr)) {
+   freeInstruction(r);
+   freeInstruction(l);
+   return -1;
+   }
+
+   /* add result to mat */
+   l = pushArgument(mb, l, getArg(q, 0));
+   r = pushArgument(mb, r, getArg(q, 1));
+   nr++;
+   }
+   if (mb->errors || mat_add(ml, l, mat_none, getFunctionId(p))) {
+   freeInstruction(l);
+   freeInstruction(r);
+   return -1;
+   }
+   if (mat_add(ml, r, mat_none, getFunctionId(p))) {
+   freeInstruction(r);
+   return -1;
+   }
+   return 0;
+}
+
+static int
 join_split(Client cntxt, InstrPtr p, int args)
 {
char *name = NULL;
@@ -2420,6 +2482,15 @@ OPTmergetableImplementation(Client cntxt
goto cleanup;
}
} else {
+   if (bats + nilbats == 5 && !is_a_mat(getArg(p, 
p->retc), ) && match == 2) {
+   n = is_a_mat(getArg(p, p->retc + 1), 
);
+   o = is_a_mat(getArg(p, p->retc + 2), 
);
+   if (mat_rangejoin(mb, p, , n, o)) {
+   msg = createException(MAL, 
"optimizer.mergetable",
+   
  SQLSTATE(HY013) MAL_MALLOC_FAIL);
+   goto cleanup;
+   }
+   } else
if (mat_joinNxM(cntxt, mb, p, , bats)) {
msg = createException(MAL, 
"optimizer.mergetable",

  SQLSTATE(HY013) MAL_MALLOC_FAIL);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - approved new signatures

2024-05-13 Thread Niels Nes via checkin-list
Changeset: 4311aa896c2d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4311aa896c2d
Modified Files:
clients/Tests/MAL-signatures-hge.test
Branch: default
Log Message:

approved new signatures


diffs (78 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -44980,6 +44980,16 @@ VLTgenerator_noop;
 (empty)
 generator
 parameters
+pattern generator.parameters(X_0:date, X_1:date, X_2:int):bat[:date]
+VLTgenerator_noop;
+Retain the table definition, but don't materialize (months)
+generator
+parameters
+pattern generator.parameters(X_0:date, X_1:date, X_2:lng):bat[:date]
+VLTgenerator_noop;
+Retain the table definition, but don't materialize (days)
+generator
+parameters
 pattern generator.parameters(X_0:dbl, X_1:dbl):bat[:dbl]
 VLTgenerator_noop;
 (empty)
@@ -45050,6 +45060,11 @@ VLTgenerator_projection;
 (empty)
 generator
 projection
+pattern generator.projection(X_0:bat[:oid], X_1:bat[:date]):bat[:date]
+VLTgenerator_projection;
+(empty)
+generator
+projection
 pattern generator.projection(X_0:bat[:oid], X_1:bat[:dbl]):bat[:dbl]
 VLTgenerator_projection;
 (empty)
@@ -45095,6 +45110,16 @@ VLTgenerator_subselect;
 (empty)
 generator
 select
+pattern generator.select(X_0:bat[:date], X_1:bat[:oid], X_2:date, X_3:date, 
X_4:bit, X_5:bit, X_6:bit):bat[:oid]
+VLTgenerator_subselect;
+(empty)
+generator
+select
+pattern generator.select(X_0:bat[:date], X_1:date, X_2:date, X_3:bit, X_4:bit, 
X_5:bit):bat[:oid]
+VLTgenerator_subselect;
+(empty)
+generator
+select
 pattern generator.select(X_0:bat[:dbl], X_1:bat[:oid], X_2:dbl, X_3:dbl, 
X_4:bit, X_5:bit, X_6:bit):bat[:oid]
 VLTgenerator_subselect;
 (empty)
@@ -45175,6 +45200,16 @@ VLTgenerator_table;
 (empty)
 generator
 series
+pattern generator.series(X_0:date, X_1:date, X_2:int):bat[:date]
+VLTgenerator_table;
+date generator with step size in months
+generator
+series
+pattern generator.series(X_0:date, X_1:date, X_2:lng):bat[:date]
+VLTgenerator_table;
+date generator with step size in days
+generator
+series
 pattern generator.series(X_0:dbl, X_1:dbl):bat[:dbl]
 VLTgenerator_table;
 (empty)
@@ -45245,6 +45280,11 @@ VLTgenerator_thetasubselect;
 (empty)
 generator
 thetaselect
+pattern generator.thetaselect(X_0:bat[:date], X_1:bat[:oid], X_2:date, 
X_3:str):bat[:oid]
+VLTgenerator_thetasubselect;
+Overloaded selection routine
+generator
+thetaselect
 pattern generator.thetaselect(X_0:bat[:dbl], X_1:bat[:oid], X_2:dbl, 
X_3:str):bat[:oid]
 VLTgenerator_thetasubselect;
 (empty)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - add generate_series for dates, ie steps of 1 ...

2024-05-13 Thread Niels Nes via checkin-list
Changeset: f7406735f6d8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f7406735f6d8
Added Files:
sql/backends/monet5/generator/Tests/generator05.test
Modified Files:
sql/backends/monet5/generator/90_generator.sql
sql/backends/monet5/generator/Tests/All
sql/backends/monet5/generator/generator.c
Branch: default
Log Message:

add generate_series for dates, ie steps of 1 or more days or months.


diffs (truncated from 670 to 300 lines):

diff --git a/sql/backends/monet5/generator/90_generator.sql 
b/sql/backends/monet5/generator/90_generator.sql
--- a/sql/backends/monet5/generator/90_generator.sql
+++ b/sql/backends/monet5/generator/90_generator.sql
@@ -54,6 +54,14 @@ create function sys.generate_series(firs
 returns table (value decimal(10,2))
 external name generator.series;
 
+create function sys.generate_series(first date, "limit" date, stepsize 
interval month)
+returns table (value date)
+external name generator.series;
+
+create function sys.generate_series(first date, "limit" date, stepsize 
interval day)
+returns table (value date)
+external name generator.series;
+
 create function sys.generate_series(first timestamp, "limit" timestamp, 
stepsize interval second)
 returns table (value timestamp)
 external name generator.series;
diff --git a/sql/backends/monet5/generator/Tests/All 
b/sql/backends/monet5/generator/Tests/All
--- a/sql/backends/monet5/generator/Tests/All
+++ b/sql/backends/monet5/generator/Tests/All
@@ -3,6 +3,7 @@ generator01
 generator02
 generator03
 generator04
+generator05
 
 rangejoin
 
diff --git a/sql/backends/monet5/generator/Tests/generator05.test 
b/sql/backends/monet5/generator/Tests/generator05.test
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/generator/Tests/generator05.test
@@ -0,0 +1,24 @@
+query T nosort
+select * from generate_series(date '2023-01-01',date '2024-01-01', interval 
'1' month) where value < date '2023-06-06'
+
+2023-01-01
+2023-02-01
+2023-03-01
+2023-04-01
+2023-05-01
+
+query T nosort
+select * from generate_series(date '2023-01-01',date '2024-01-01', interval 
'15' day) where value < date '2023-06-06'
+
+2023-01-01
+2023-01-16
+2023-01-31
+2023-02-15
+2023-03-02
+2023-03-17
+2023-04-01
+2023-04-16
+2023-05-01
+2023-05-16
+2023-05-31
+
diff --git a/sql/backends/monet5/generator/generator.c 
b/sql/backends/monet5/generator/generator.c
--- a/sql/backends/monet5/generator/generator.c
+++ b/sql/backends/monet5/generator/generator.c
@@ -12,7 +12,7 @@
 
 /*
  * (c) Martin Kersten, Sjoerd Mullender
- * Series generating module for integer, decimal, real, double and timestamps.
+ * Series generating module for integer, decimal, real, double, date and 
timestamps.
  */
 
 #include "monetdb_config.h"
@@ -51,11 +51,21 @@ VLTgenerator_noop(Client cntxt, MalBlkPt
case TYPE_flt: VLTnoop(flt); break;
case TYPE_dbl: VLTnoop(dbl); break;
default:
-   if (tpe == TYPE_timestamp){
+   if (tpe == TYPE_date) {
+   /* with date, step is of SQL type "interval month or 
day",
+* i.e., MAL / C type "int" or "lng" */
+   int steptpe = pci->argc==4 ? getArgType(mb,pci,3) : 0;
+   if (steptpe == TYPE_int)
+   VLTnoop(int);
+   else /* default interval days */
+   VLTnoop(lng);
+   } else if (tpe == TYPE_timestamp) {
/* with timestamp, step is of SQL type "interval 
seconds",
 * i.e., MAL / C type "lng" */
 VLTnoop(lng);
-   } else throw(MAL,"generator.noop", SQLSTATE(42000) "unknown 
data type %d", getArgType(mb,pci,1));
+   } else {
+   throw(MAL,"generator.noop", SQLSTATE(42000) "unknown 
data type %d", getArgType(mb,pci,1));
+   }
}
if( zeroerror)
throw(MAL,"generator.noop", SQLSTATE(42000) "Zero step size not 
allowed");
@@ -204,7 +214,77 @@ VLTgenerator_table_(BAT **result, Client
VLTmaterialize_flt(dbl);
break;
default:
-   if (tpe == TYPE_timestamp) {
+   if (tpe == TYPE_date && pci->argc == 3)
+   throw(MAL,"generator.table", SQLSTATE(42000) "Date step 
missing");
+   if (tpe == TYPE_date && getArgType(mb, pci, 3) == TYPE_int) { 
/* months */
+   date *v,f,l;
+   int s;
+   ValRecord ret;
+   if (VARcalccmp(, >stk[pci->argv[1]],
+  >stk[pci->argv[2]]) != GDK_SUCCEED)
+   throw(MAL, "generator.table",
+ SQLSTATE(42000) "Illegal generator 
expression range");
+   f = *getArgReference_TYPE(stk, pci, 1, date);
+   l = 

MonetDB: default - small improvements of the voc dates

2024-05-11 Thread Niels Nes via checkin-list
Changeset: bf76210949e5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bf76210949e5
Modified Files:
sql/test/VOC/Tests/VOCinsert.test
sql/test/VOC/Tests/VOCquery.test
Branch: default
Log Message:

small improvements of the voc dates


diffs (51 lines):

diff --git a/sql/test/VOC/Tests/VOCinsert.test 
b/sql/test/VOC/Tests/VOCinsert.test
--- a/sql/test/VOC/Tests/VOCinsert.test
+++ b/sql/test/VOC/Tests/VOCinsert.test
@@ -2734,7 +2734,7 @@ 2743  ""  5   ""  "SLOT ALDEGONDE"
"Gillis Ou
 2744   ""  5   ""  "STAD LEIDEN"   "Wouter van Dijk"   1140
NULL"1718"  NULLNULL"A" "A" 1728-06-23  "Texel" 
1728-10-21  1728-11-18  true1729-02-09  "Batavia"   6767
NULL
 2745   ""  4   ""  "CASTRICUM" "Thomas Fletcher"   1150
NULL"1722"  NULLNULL"A" "A" 1728-10-28  "Texel" 
1729-02-23  1729-03-19  true1729-06-13  "Batavia"   6762
NULL
 2746   ""  6   ""  "HUTS DE VLOTTER"   "Jan Molentijn" 528 
"fluit" "1713"  NULLNULL"A" "A" 1728-10-28  "Texel" 
1729-03-29  1729-04-20  true1729-07-12  "Batavia"   6787
NULL
-2747   ""  5   ""  "BORSSELE"  "Jakob Jongerheld"  800 
NULL"1715"  NULLNULL"Z" "Z" 1728-10-29  "Rammekens" 
1729-02-23  1729-03-19  true1129-05-19  "Batavia"   NULL
"Wrecked between Persia and Batavia in 1731."
+2747   ""  5   ""  "BORSSELE"  "Jakob Jongerheld"  800 
NULL"1715"  NULLNULL"Z" "Z" 1728-10-29  "Rammekens" 
1729-02-23  1729-03-19  true1729-05-19  "Batavia"   NULL
"Wrecked between Persia and Batavia in 1731."
 2748   ""  1   ""  "DUINBEEK"  "Marinus Commerse"  800 
NULL"1727"  NULLNULL"Z" "Z" 1728-10-29  "Rammekens" 
1729-02-21  1729-03-12  true1729-05-19  "Batavia"   6829
NULL
 2749   ""  3   ""  "HERSTELLING"   "Jan van der Quade" 600 
NULL"1721"  NULLNULL"D" "R" 1728-10-29  "Goeree"
1729-04-07  1729-04-27  true1729-11-27  "Batavia"   6791
"passengers came aboard."
 2750   ""  3   ""  "LANGERODE" "Kornelis van der Kolster"  
600 NULL"1723"  NULLNULL"D" "D" 1728-10-29  
"Goeree"1729-02-23  1729-03-19  true1729-06-11  
"Batavia"   6766NULL
@@ -3049,7 +3049,7 @@ 3058  ""  1   ""  "WATERVLIET""Pieter 
Korver
 3059   ""  3   ""  "ZORGWIJK"  "Kornelis van der Marie"
650 NULL"1732"  NULLNULL"A" "A" 1737-03-10  "Texel" 
1737-06-18  1737-06-30  true1737-09-16  "Batavia"   7014
"3059/7014 Is the third voyage of the ZORGWIJK, which during its first voyage 
(see 2896/-) was called VOORDUIN."
 3060   ""  5   ""  "KLARABEEK" "Jan Bijland"   705 NULL
"1721"  NULLNULL"Z" "Z" 1737-03-11  "Rammekens" 
1737-07-15  1737-08-06  true1737-10-19  "Batavia"   7007
"During the voyage one of the soldiers became a seafarer. The passengers 
included 11 slaves (6 males and 5 females)."
 3061   ""  2   ""  "HUIS TE RENSBURG"  "Jan de Bruin"  850 
NULL"1733"  NULLNULL"Z" "Z" 1737-03-11  "Rammekens" 
1737-07-09  1737-07-21  true1737-09-23  "Batavia"   7094
"23-06 till 08-07-1737 the ship was at Saldanha Bay."
-3062   ""  1   ""  "ARNESTUN"  "Willem Hendriksz. van Roffe"   
575 NULL"1736"  NULLNULL"Z" "Z" 1737-03-12  
"Rammekens" 1737-06-20  1737-07-06  true1937-09-17  
"Batavia"   7008"During the voyage one of the soldiers became a 
seafarer. The passengers who embarked at the Cape included eight slaves: two 
(married) couples with two children each."
+3062   ""  1   ""  "ARNESTUN"  "Willem Hendriksz. van Roffe"   
575 NULL"1736"  NULLNULL"Z" "Z" 1737-03-12  
"Rammekens" 1737-06-20  1737-07-06  true1737-09-17  
"Batavia"   7008"During the voyage one of the soldiers became a 
seafarer. The passengers who embarked at the Cape included eight slaves: two 
(married) couples with two children each."
 3063   ""  3   ""  "MARIA ADRIANA" "Willem de Wijs"650 
NULL"1730"  NULLNULL"R" "R" 1737-03-12  "Goeree"
1737-06-17  1737-07-02  true1737-09-07  "Batavia"   7055
NULL
 3064   ""  8   ""  "ZOETELINGSKERKE"   "Huibrecht op den Dijk" 
1100NULL"1721"  NULLNULL"Z" "Z" 1737-03-12  
"Rammekens" 1737-06-17  1737-07-07  true 

MonetDB: default - approved output

2024-05-11 Thread Niels Nes via checkin-list
Changeset: a72efd578b97 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a72efd578b97
Modified Files:
sql/test/Dependencies/Tests/dependency_owner_schema_3.test
Branch: default
Log Message:

approved output


diffs (16 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
@@ -1094,12 +1094,6 @@ DEP_FUNC
 schema_id
 get_remote_table_expressions
 DEP_FUNC
-semantics
-describe_function
-DEP_FUNC
-side_effect
-describe_function
-DEP_FUNC
 srid
 getproj4
 DEP_FUNC
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - fixed bug #7512, protect concurrent instantia...

2024-05-10 Thread Niels Nes via checkin-list
Changeset: 06f20b2c802e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/06f20b2c802e
Added Files:

sql/test/BugTracker-2024/Tests/7512-concurrent-globaltmp-instantiate-crash.test
Modified Files:
sql/scripts/52_describe.sql
sql/storage/sql_catalog.c
sql/storage/store.c
sql/test/BugTracker-2024/Tests/All
Branch: Dec2023
Log Message:

fixed bug #7512, protect concurrent instantiation of the global temps


diffs (99 lines):

diff --git a/sql/scripts/52_describe.sql b/sql/scripts/52_describe.sql
--- a/sql/scripts/52_describe.sql
+++ b/sql/scripts/52_describe.sql
@@ -315,7 +315,6 @@ CREATE VIEW sys.describe_foreign_keys AS
AND ((fkk."action" >> 8) & 255)  = ou.id
ORDER BY fkk.name, fkkc.nr;
 
---TODO: CRASHES when this function gets inlined into describe_tables
 CREATE FUNCTION sys.get_merge_table_partition_expressions(tid INT) RETURNS 
STRING
 BEGIN
RETURN
diff --git a/sql/storage/sql_catalog.c b/sql/storage/sql_catalog.c
--- a/sql/storage/sql_catalog.c
+++ b/sql/storage/sql_catalog.c
@@ -253,13 +253,20 @@ find_sql_table(sql_trans *tr, sql_schema
}
 
if (t && isTempTable(t) && tr->tmp == s) {
+   sqlstore *store = tr->store;
assert(isGlobal(t));
 
sql_table* lt = (sql_table*) os_find_name(tr->localtmps, tr, 
tname);
if (lt)
return lt;
+   MT_lock_set(>table_locks[t->base.id&(NR_TABLE_LOCKS-1)]);
 
-   t = globaltmp_instantiate(tr, t);
+   lt = (sql_table*) os_find_name(tr->localtmps, tr, tname);
+   if (!lt)
+   t = globaltmp_instantiate(tr, t);
+   else
+   t = lt;
+   
MT_lock_unset(>table_locks[t->base.id&(NR_TABLE_LOCKS-1)]);
return t;
}
 
@@ -276,13 +283,19 @@ find_sql_table_id(sql_trans *tr, sql_sch
}
 
if (t && isTempTable(t) && tr->tmp == s) {
+   sqlstore *store = tr->store;
assert(isGlobal(t));
 
sql_table* lt = (sql_table*) os_find_id(tr->localtmps, tr, id);
if (lt)
return lt;
-
-   t = globaltmp_instantiate(tr, t);
+   MT_lock_set(>table_locks[id&(NR_TABLE_LOCKS-1)]);
+   lt = (sql_table*) os_find_id(tr->localtmps, tr, id);
+   if (!lt)
+   t = globaltmp_instantiate(tr, t);
+   else
+   t = lt;
+   MT_lock_unset(>table_locks[id&(NR_TABLE_LOCKS-1)]);
return t;
}
return t;
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -3197,9 +3197,6 @@ table_dup(sql_trans *tr, sql_table *ot, 
t->sz = ot->sz;
ATOMIC_PTR_INIT(>data, NULL);
 
-   if ((res = os_add(isLocalTemp(t) ? tr->localtmps : t->s->tables, tr, 
t->base.name, >base)))
-   goto cleanup;
-
if (isPartitionedByExpressionTable(ot)) {
t->part.pexp = ZNEW(sql_expression);
t->part.pexp->exp =_STRDUP(ot->part.pexp->exp);
@@ -3257,6 +3254,8 @@ table_dup(sql_trans *tr, sql_table *ot, 
ATOMIC_PTR_SET(>data, 
store->storage_api.del_dup(ot));
}
}
+   if ((res = os_add(isLocalTemp(t) ? tr->localtmps : t->s->tables, tr, 
t->base.name, >base)))
+   goto cleanup;
 
 cleanup:
if (res) {
diff --git 
a/sql/test/BugTracker-2024/Tests/7512-concurrent-globaltmp-instantiate-crash.test
 
b/sql/test/BugTracker-2024/Tests/7512-concurrent-globaltmp-instantiate-crash.test
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2024/Tests/7512-concurrent-globaltmp-instantiate-crash.test
@@ -0,0 +1,5 @@
+statement error conversion of string '' to type int failed.
+SELECT GET_MERGE_TABLE_PARTITION_EXPRESSIONS('')
+
+statement ok
+SELECT GET_MERGE_TABLE_PARTITION_EXPRESSIONS(0)
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -53,4 +53,5 @@ rel2bin_select-Bug-7496
 multicolumn_IN_value_list-Bug-7497
 field-arg-error-Bug-7506
 7511-password-hash-missing-error
+7512-concurrent-globaltmp-instantiate-crash
 7513-uri-authority-parse-issue
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - fixed issue #7513, the uri parsing didn't res...

2024-05-10 Thread Niels Nes via checkin-list
Changeset: a6bcc084ddee for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a6bcc084ddee
Added Files:
sql/test/BugTracker-2024/Tests/7511-password-hash-missing-error.test
sql/test/BugTracker-2024/Tests/7513-uri-authority-parse-issue.test
Modified Files:
monetdb5/modules/atoms/url.c
sql/test/BugTracker-2024/Tests/All
Branch: Dec2023
Log Message:

fixed issue #7513, the uri parsing didn't reset the port after finding the 
username:password@
added tests


diffs (51 lines):

diff --git a/monetdb5/modules/atoms/url.c b/monetdb5/modules/atoms/url.c
--- a/monetdb5/modules/atoms/url.c
+++ b/monetdb5/modules/atoms/url.c
@@ -107,8 +107,10 @@ skip_authority(const char *uri, const ch
port = pass = uri + 1;
else
port = uri + 1;
-   } else if (*uri == '@')
+   } else if (*uri == '@') {
host = uri + 1;
+   port = NULL;
+   }
uri += *uri == '%' ? 3 : 1;
}
if (user == host) {
diff --git 
a/sql/test/BugTracker-2024/Tests/7511-password-hash-missing-error.test 
b/sql/test/BugTracker-2024/Tests/7511-password-hash-missing-error.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7511-password-hash-missing-error.test
@@ -0,0 +1,3 @@
+
+statement error 42000!SELECT: Failed to retrieve password hash
+SELECT PASSWORD_HASH('1');
diff --git a/sql/test/BugTracker-2024/Tests/7513-uri-authority-parse-issue.test 
b/sql/test/BugTracker-2024/Tests/7513-uri-authority-parse-issue.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7513-uri-authority-parse-issue.test
@@ -0,0 +1,15 @@
+
+query T
+SELECT GETHOST('https://me:p...@www.monetdb.org/Doc');
+
+www.monetdb.org
+
+query T
+SELECT GETHOST('https://me:p...@www.monetdb.org/Doc');
+
+www.monetdb.org
+
+query T
+SELECT GETHOST('https://me:p...@www.monetdb.org/Doc');
+
+www.monetdb.org
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -53,3 +53,4 @@ rel2bin_select-Bug-7496
 multicolumn_IN_value_list-Bug-7497
 field-arg-error-Bug-7506
 7511-password-hash-missing-error
+7513-uri-authority-parse-issue
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - add error message on missing or incorrect pas...

2024-05-10 Thread Niels Nes via checkin-list
Changeset: 610ed55e5ac0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/610ed55e5ac0
Modified Files:
sql/backends/monet5/sql.c
sql/test/BugTracker-2024/Tests/All
Branch: Dec2023
Log Message:

add error message on missing or incorrect password hash, fixes #7511. Also 
added small test.


diffs (20 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -5174,6 +5174,8 @@ SQLuser_password(Client cntxt, MalBlkPtr
return msg;
}
*password = monet5_password_hash(m, username);
+   if (!(*password))
+   throw(SQL, "mvc", SQLSTATE(42000) "SELECT: Failed to retrieve 
password hash");
return MAL_SUCCEED;
 }
 
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -52,3 +52,4 @@ orderby-max-over-rows-Bug-7488
 rel2bin_select-Bug-7496
 multicolumn_IN_value_list-Bug-7497
 field-arg-error-Bug-7506
+7511-password-hash-missing-error
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - improved optimization of relational psm

2024-05-08 Thread Niels Nes via checkin-list
Changeset: e9afbe5ac9c3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e9afbe5ac9c3
Modified Files:
sql/server/rel_optimize_others.c
sql/server/rel_optimizer.c
sql/server/rel_rel.c
sql/server/rel_rel.h
sql/server/rel_select.c
sql/test/BugTracker-2022/Tests/dependencies.Bug-7328.test
sql/test/Dependencies/Tests/dependency_DBobjects.test
sql/test/Dependencies/Tests/dependency_owner_schema_3.test
sql/test/SQLancer/Tests/sqlancer18.test
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/sql_dump/Tests/dump.test
Branch: Dec2023
Log Message:

improved optimization of relational psm


diffs (truncated from 564 to 300 lines):

diff --git a/sql/server/rel_optimize_others.c b/sql/server/rel_optimize_others.c
--- a/sql/server/rel_optimize_others.c
+++ b/sql/server/rel_optimize_others.c
@@ -1054,6 +1054,7 @@ rel_dce_(mvc *sql, sql_rel *rel)
return rel;
 }
 
+
 /* Remove unused expressions */
 static sql_rel *
 rel_dce(visitor *v, global_props *gp, sql_rel *rel)
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -607,8 +607,8 @@ run_optimizer_set(visitor *v, sql_optimi
 
 /* 'profile' means to benchmark each individual optimizer run */
 /* 'instantiate' means to rewrite logical tables: (merge, remote, replica 
tables) */
-sql_rel *
-rel_optimizer(mvc *sql, sql_rel *rel, int profile, int instantiate, int 
value_based_opt, int storage_based_opt)
+static sql_rel *
+rel_optimizer_one(mvc *sql, sql_rel *rel, int profile, int instantiate, int 
value_based_opt, int storage_based_opt)
 {
global_props gp = (global_props) {.cnt = {0}, .instantiate = 
(uint8_t)instantiate, .opt_cycle = 0,
  
.has_special_modify = rel && is_modify(rel->op) && rel->flag_COMP};
@@ -635,3 +635,32 @@ rel_optimizer(mvc *sql, sql_rel *rel, in
rel = run_optimizer_set(, sql->runs, rel, , post_sql_optimizers);
return rel;
 }
+
+static sql_exp *
+exp_optimize_one(visitor *v, sql_rel *rel, sql_exp *e, int depth )
+{
+   (void)rel;
+   (void)depth;
+   if (e->type == e_psm && e->flag == PSM_REL && e->l) {
+   e->l = rel_optimizer_one(v->sql, e->l, 0, v->changes, 
v->value_based_opt, v->storage_based_opt);
+   }
+   return e;
+}
+
+sql_rel *
+rel_optimizer(mvc *sql, sql_rel *rel, int profile, int instantiate, int 
value_based_opt, int storage_based_opt)
+{
+   if (rel && rel->op == op_ddl && rel->flag == ddl_psm) {
+   if (!list_empty(rel->exps)) {
+   bool changed = 0;
+   visitor v = { .sql = sql, .value_based_opt = 
value_based_opt, .storage_based_opt = storage_based_opt, .changes = instantiate 
};
+   for(node *n = rel->exps->h; n; n = n->next) {
+   sql_exp *e = n->data;
+   exp_visitor(, rel, e, 1, exp_optimize_one, 
true, true, true, );
+   }
+   }
+   return rel;
+   } else {
+   return rel_optimizer_one(sql, rel, profile, instantiate, 
value_based_opt, storage_based_opt);
+   }
+}
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
@@ -2044,17 +2044,17 @@ rel_dependencies(mvc *sql, sql_rel *r)
return l;
 }
 
-static list *exps_exp_visitor(visitor *v, sql_rel *rel, list *exps, int depth, 
exp_rewrite_fptr exp_rewriter, bool topdown, bool relations_topdown);
+static list *exps_exp_visitor(visitor *v, sql_rel *rel, list *exps, int depth, 
exp_rewrite_fptr exp_rewriter, bool topdown, bool relations_topdown, bool 
visit_relations_once);
 
 static inline list *
-exps_exps_exp_visitor(visitor *v, sql_rel *rel, list *lists, int depth, 
exp_rewrite_fptr exp_rewriter, bool topdown, bool relations_topdown)
+exps_exps_exp_visitor(visitor *v, sql_rel *rel, list *lists, int depth, 
exp_rewrite_fptr exp_rewriter, bool topdown, bool relations_topdown, bool 
visit_relations_once)
 {
node *n;
 
if (list_empty(lists))
return lists;
for (n = lists->h; n; n = n->next) {
-   if (n->data && (n->data = exps_exp_visitor(v, rel, n->data, 
depth, exp_rewriter, topdown, relations_topdown)) == NULL)
+   if (n->data && (n->data = exps_exp_visitor(v, rel, n->data, 
depth, exp_rewriter, topdown, relations_topdown, visit_relations_once)) == NULL)
return NULL;
}
return lists;
@@ -2062,8 +2062,8 @@ exps_exps_exp_visitor(visitor *v, sql_re
 
 static sql_rel *rel_exp_visitor(visitor *v, sql_rel *rel, exp_rewrite_fptr 
exp_rewriter, bool topdown, bool relations_topdown);
 
-static sql_exp *

MonetDB: default - #7485 was fixed by recent group by changes

2024-05-08 Thread Niels Nes via checkin-list
Changeset: b729bea76345 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b729bea76345
Modified Files:
sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test
Branch: default
Log Message:

#7485 was fixed by recent group by changes


diffs (28 lines):

diff --git a/sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test 
b/sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test
--- a/sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test
+++ b/sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7485.test
@@ -7,15 +7,18 @@ statement error 42000!SELECT: cannot use
 WITH x ( x ) AS ( SELECT 1 ) SELECT x FROM x GROUP BY x + 1
 
 
-skipif knownfail
-statement error 42000!SELECT: cannot use non GROUP BY column 'x' in query 
results without an aggregate function
+query I nosort
 WITH x ( x ) AS ( SELECT 1 ) SELECT x FROM x GROUP BY x + 1 , x
+
+1
 
-skipif knownfail
-statement error 42000!SELECT: cannot use non GROUP BY column 'x' in query 
results without an aggregate function
+query I nosort
 WITH x ( x ) AS ( SELECT 1 ) SELECT ( x ) FROM x WHERE ( SELECT x FROM x GROUP 
BY x + 1 , x )
+
+1
 
-skipif knownfail
-statement error 42000!SELECT: cannot use non GROUP BY column 'x' in query 
results without an aggregate function
+query I nosort
 SELECT ( WITH x ( x ) AS ( SELECT 1 ) SELECT ( x ) FROM x WHERE ( SELECT x 
FROM x GROUP BY x + 1 , x ) )
+
+1
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - #7506 was recently fixed

2024-05-08 Thread Niels Nes via checkin-list
Changeset: d4f8e2e2ff1f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d4f8e2e2ff1f
Modified Files:
sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test
Branch: default
Log Message:

#7506 was recently fixed


diffs (11 lines):

diff --git a/sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test 
b/sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test
--- a/sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test
+++ b/sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test
@@ -29,7 +29,6 @@ SELECT "is_generated", length("is_genera
 
 
 -- next query causes: sql/backends/monet5/rel_bin.c:4355: rel2bin_select: 
Assertion `sql->session->status == -10' failed
-skipif knownfail
 query TI nosort
 SELECT "is_generated", length("is_generated") as data_length FROM columns_7496 
WHERE "is_generated" IS NOT NULL AND length("is_generated") > 2
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - bug #7476 fixed by changes to group by

2024-05-08 Thread Niels Nes via checkin-list
Changeset: b247a3a24ae7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b247a3a24ae7
Modified Files:
sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test
Branch: default
Log Message:

bug #7476 fixed by changes to group by


diffs (17 lines):

diff --git a/sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test 
b/sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test
--- a/sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test
+++ b/sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test
@@ -26,13 +26,11 @@ SELECT ( WITH x ( x ) AS ( SELECT DISTIN
 1
 
 -- the combination leads to crash in rel2bin_join ()
-skipif knownfail
 query I nosort
 WITH x ( x ) AS ( SELECT DISTINCT 1 ) SELECT ( SELECT x FROM x WHERE x = ( 
SELECT ( CASE WHEN x THEN x END ) WHERE x = ( SELECT x FROM x ) AND x GROUP BY 
1 ) ) FROM x
 
 1
 
-skipif knownfail
 query I nosort
 SELECT ( WITH x ( x ) AS ( SELECT DISTINCT 1 ) SELECT ( SELECT x FROM x WHERE 
x = ( SELECT ( CASE WHEN x THEN x END ) WHERE x = ( SELECT x FROM x ) AND x 
GROUP BY 1 ) ) FROM x )
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - bug #7480 was fixed by recent changes

2024-05-08 Thread Niels Nes via checkin-list
Changeset: 601eea2d633f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/601eea2d633f
Modified Files:
sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test
Branch: default
Log Message:

bug #7480 was fixed by recent changes


diffs (11 lines):

diff --git a/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test 
b/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test
--- a/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test
+++ b/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test
@@ -8,7 +8,6 @@ SELECT NULL GROUP BY 1
 
 NULL
 
-skipif knownfail
 query I nosort
 SELECT CASE WHEN ( SELECT 2 WHERE FALSE ) > ANY ( 1 ) THEN 1 END GROUP BY 1
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - fixed bug #7475 by improved check for distinc...

2024-05-08 Thread Niels Nes via checkin-list
Changeset: a8b8f3b90564 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a8b8f3b90564
Modified Files:
sql/server/rel_exp.c
sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test
Branch: default
Log Message:

fixed bug #7475 by improved check for distinct expression names


diffs (32 lines):

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
@@ -1169,7 +1169,8 @@ exp_equal( sql_exp *e1, sql_exp *e2)
if (e1 == e2)
return 0;
if (e1->alias.rname && e2->alias.rname && strcmp(e1->alias.rname, 
e2->alias.rname) == 0)
-   return strcmp(e1->alias.name, e2->alias.name);
+   if (e1->alias.name && e2->alias.name && strcmp(e1->alias.name, 
e2->alias.name) == 0)
+   return 0;
if (!e1->alias.rname && !e2->alias.rname && e1->alias.label == 
e2->alias.label && e1->alias.name && e2->alias.name)
return strcmp(e1->alias.name, e2->alias.name);
return -1;
diff --git a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test 
b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test
--- a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test
+++ b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test
@@ -10,7 +10,6 @@ WITH x AS ( SELECT 1 x ) SELECT 1 , ( SE
 1
 1
 
-skipif knownfail
 query II nosort
 SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM x 
WHERE x ) y
 
@@ -23,7 +22,6 @@ SELECT * FROM ( WITH x AS ( SELECT 1 x )
 1
 1
 
-skipif knownfail
 query II nosort
 SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( 
x NATURAL JOIN x y ) WHERE x ) y
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - fix compilation (unused variable)

2024-05-08 Thread Niels Nes via checkin-list
Changeset: 5ab32c5ce4a6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5ab32c5ce4a6
Modified Files:
sql/server/rel_select.c
Branch: default
Log Message:

fix compilation (unused variable)


diffs (20 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -5609,7 +5609,7 @@ rel_select_exp(sql_query *query, sql_rel
 
if (ce) {
if (inner && inner->flag && is_groupby(inner->op)) {
-   int found = 0, nratom = 0;
+   int found = 0;
list *gbe = inner->r;
/* flag == 2 just add to group by/ aggrs and 
ref-to pexps*/
/* flag == 1 find group by exp referencing this 
column nr */
@@ -5630,7 +5630,6 @@ rel_select_exp(sql_query *query, sql_rel
if (is_atom(e->type) && 
!e->alias.name) {
atom *a = e->l;
int nr = 
(int)atom_get_int(a);
-   nratom++;
if (nr == 
(list_length(pexps) + 1)) {
n->data = ce;
ce = 
exp_ref(sql, ce);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - restrict aliases, ie should be unique on both...

2024-05-08 Thread Niels Nes via checkin-list
Changeset: 7a0f46ef26fb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7a0f46ef26fb
Modified Files:
sql/server/rel_select.c
sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test
sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test
Branch: default
Log Message:

restrict aliases, ie should be unique on both ends of the join


diffs (82 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -5978,6 +5978,9 @@ rel_joinquery_(sql_query *query, symbol 
return NULL;
 
query_processed(query);
+   if (strcmp(rel_name(t1), rel_name(t2)) == 0) {
+   return sql_error(sql, 02, SQLSTATE(42000) "SELECT: ERROR:  
table name '%s' specified more than once", rel_name(t1));
+   }
inner = rel = rel_crossproduct(sql->sa, t1, t2, op);
if (!rel)
return NULL;
diff --git a/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test 
b/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
--- a/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
+++ b/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
@@ -363,18 +363,18 @@ x
 -- WITH v0 AS (SELECT 14, * FROM v0) INSERT INTO v0 SELECT v1 * 0 FROM v0 
NATURAL JOIN v0, v0, v0 AS v2, v0, v0 AS v3 ORDER BY v1 * 0 / 77
 
 statement ok
-WITH v0 AS (SELECT 14, * FROM v0) INSERT INTO v0 SELECT v0.v1 * 0 FROM v0 
NATURAL JOIN v0, v0, v0 AS v2, v0, v0 AS v3 ORDER BY v0.v1 * 0 / 77
+WITH v0 AS (SELECT 14, * FROM v0) INSERT INTO v0 SELECT v0.v1 * 0 FROM v0 
NATURAL JOIN v0 v, v0 as v1, v0 AS v2, v0 as v3, v0 AS v4 ORDER BY v0.v1 * 0 / 
77
 
 query I nosort
 SELECT count(*) FROM v0
 
-131080
+16392
 
 -- after the second insert, rerun same query as above, since it used to crash 
the server
 query RT rowsort
 SELECT * , 'x' FROM v0 WHERE (SELECT 39 WHERE (v1 + -32768 NOT IN (14, 255))) 
* 87 + 2147483647
 
-131080 values hashing to c051bd7cdccd1fd3636c9e0973aca08e
+32776 values hashing to b2c71832cf3b6b1cb7d9db5b58419143
 
 -- mul_bte_bte_bte: ERROR: 22003!overflow in calculation 87*39.
 
diff --git a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test 
b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test
--- a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test
+++ b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test
@@ -5,7 +5,7 @@ 1
 1
 
 query II nosort
-WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN 
x ) WHERE x
+WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN 
x y ) WHERE x
 
 1
 1
@@ -18,14 +18,14 @@ 1
 1
 
 query II nosort
-SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , x FROM ( x NATURAL JOIN x 
) WHERE x ) y
+SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , x FROM ( x NATURAL JOIN x 
y ) WHERE x ) y
 
 1
 1
 
 skipif knownfail
 query II nosort
-SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( 
x NATURAL JOIN x ) WHERE x ) y
+SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( 
x NATURAL JOIN x y ) WHERE x ) y
 
 1
 1
diff --git a/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test 
b/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test
--- a/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test
+++ b/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test
@@ -1,9 +1,9 @@
 query I nosort
-SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x ) WHERE x 
NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY 1 ) )
+SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x as y ) 
WHERE x NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY 1 ) )
 
 NULL
 
 query I nosort
-SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x ) WHERE x 
NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY ( SELECT 1 ) ) )
+SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x as y ) 
WHERE x NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY ( SELECT 1 ) 
) )
 
 NULL
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - added changelog for group by/order by changes

2024-05-08 Thread Niels Nes via checkin-list
Changeset: e21380596aa6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e21380596aa6
Modified Files:
ChangeLog
Branch: default
Log Message:

added changelog for group by/order by changes


diffs (14 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
+* Wed May  8 2024 Niels Nes 
+- Add support for select exp, count(*) group by 1 order by 1; ie. using
+  numeric references Added support for group by all and order by all. The
+  later is ordering on all columns of the selection.  The group by all
+  finds all expressions from the selections which aren't aggregations
+  and groups on those.  All can also be replaced by '*'.
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - implemented group by and order by reference n...

2024-05-08 Thread Niels Nes via checkin-list
Changeset: 2c2bfc484616 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2c2bfc484616
Added Files:
sql/test/miscellaneous/Tests/group_by_all.test
sql/test/sets/Tests/All
sql/test/sets/Tests/union.test
Modified Files:
sql/include/sql_relation.h
sql/rel.txt
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_rel.c
sql/server/rel_select.c
sql/server/rel_unnest.c
sql/server/sql_parser.y
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.test
sql/test/BugTracker-2024/Tests/aggr-exp-copy-crash-7435.test
sql/test/SQLancer/Tests/sqlancer01.test
sql/test/SQLancer/Tests/sqlancer03.test
sql/test/SQLancer/Tests/sqlancer08.test
sql/test/SQLancer/Tests/sqlancer09.test
sql/test/SQLancer/Tests/sqlancer10.test
sql/test/SQLancer/Tests/sqlancer14.test
sql/test/SQLancer/Tests/sqlancer15.test
sql/test/SQLancer/Tests/sqlancer23.test
sql/test/miscellaneous/Tests/All
sql/test/miscellaneous/Tests/groupby_expressions.test
sql/test/miscellaneous/Tests/simple_selects.test
sql/test/subquery/Tests/subquery3.test
sql/test/subquery/Tests/subquery6.test
Branch: default
Log Message:

implemented group by and order by reference number
corrected handling of constants in group by (ie we now disallow this as defined 
by sql standard)
add support for group by and order by all/*


diffs (truncated from 1011 to 300 lines):

diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h
--- a/sql/include/sql_relation.h
+++ b/sql/include/sql_relation.h
@@ -50,7 +50,7 @@ typedef struct expression {
unsigned short tmp;
unsigned int
 card:2,/* card (0 truth value!) (1 atoms) (2 aggr) (3 multi 
value) */
-freevar:4, /* free variable, ie binds to the upper dependent join 
*/
+freevar:8, /* free variable, ie binds to the upper dependent join 
*/
 intern:1,
 selfref:1, /* set when the expression references a 
expression in the same projection list */
 anti:1,
@@ -298,7 +298,7 @@ typedef struct relation {
int nrcols; /* nr of cols */
unsigned int
 flag:16,
-card:4,/* 0, 1 (row), 2 aggr, 3 */
+card:2,/* 0, 1 (row), 2 aggr, 3 */
 dependent:1,   /* dependent join */
 distinct:1,
 processed:1,   /* fully processed or still in the process of building 
*/
diff --git a/sql/rel.txt b/sql/rel.txt
--- a/sql/rel.txt
+++ b/sql/rel.txt
@@ -66,6 +66,7 @@ GROUPBY  (card ATOM (no group by exps), 
-> exps is list of (groupby and) aggregate expressions
-> lis relation
-> ris list of group by expressions
+   -> flag 1 has group by nr , 2 group by all
 
 TOPN   (card ATOM, AGGR, or MULTI (same card as lower relation))
-> exps (list) lng limit, [ lng offset ] -> if the limit is a 
NULL value, then it's ignored, ie only the offset will be used
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
@@ -2058,6 +2058,99 @@ exp_is_atom( sql_exp *e )
return 0;
 }
 
+static int
+exps_are_aggr(sql_rel *r, list *exps)
+{
+   int aggr = 1;
+   if (!list_empty(exps))
+   for(node *n=exps->h; n && aggr; n=n->next)
+   aggr &= exp_is_aggr(r, n->data);
+   return aggr;
+}
+
+/* is expression e an aggregated result of r */
+int
+exp_is_aggr(sql_rel *r, sql_exp *e)
+{
+   sql_exp *ne = NULL;
+
+   switch (e->type) {
+   case e_atom:
+   return true;
+   case e_convert:
+   return exp_is_aggr(r, e->l);
+   case e_func:
+   return exps_are_aggr(r, e->l);
+   case e_aggr:
+   return true;
+   case e_cmp:
+   if (e->card != CARD_ATOM)
+   return false;
+   if (e->flag == cmp_or || e->flag == cmp_filter)
+   return exps_are_aggr(r, e->l) && exps_are_aggr(r, e->r);
+   if (e->flag == cmp_in || e->flag == cmp_notin)
+   return exp_is_aggr(r, e->l) && exps_are_aggr(r, e->r);
+   return exp_is_aggr(r, e->l) && exp_is_aggr(r, e->r) && (!e->f 
|| exp_is_aggr(r, e->f));
+   case e_column:
+   if (e->freevar)
+   return true;
+   ne = rel_find_exp(r, e);
+   if (ne) /* found local */
+   return true;
+   else
+   return false;
+   case e_psm:
+   return false;
+   }
+   return false;
+}
+
+static int
+exps_have_aggr(sql_rel *r, list *exps)
+{
+   int aggr = 0;
+   if (!list_empty(exps))
+   for(node *n=exps->h; n && !aggr; n=n->next)
+   aggr |= exp_has_aggr(r, 

MonetDB: Dec2023 - small cleanup of persist unlogged table

2024-05-06 Thread Niels Nes via checkin-list
Changeset: a107f9de5e96 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a107f9de5e96
Modified Files:
sql/backends/monet5/sql.c
Branch: Dec2023
Log Message:

small cleanup of persist unlogged table


diffs (124 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -4367,8 +4367,10 @@ SQLpersist_unlogged(Client cntxt, MalBlk
sql_trans *tr = m->session->tr;
storage *t_del = bind_del_data(tr, t, NULL);
 
-   BAT *d = BATdescriptor(t_del->cs.bid);
-
+   BAT *d = NULL;
+
+   if (t_del)
+   d = BATdescriptor(t_del->cs.bid);
if (t_del == NULL || d == NULL)
throw(SQL, "sql.persist_unlogged", "Cannot access %s column 
storage.", tname);
 
@@ -4380,15 +4382,17 @@ SQLpersist_unlogged(Client cntxt, MalBlk
assert(d->batInserted <= d_bi.count);
 
if (d->batInserted < d_bi.count) {
-
-   int n = 100;
-   bat *commit_list = GDKzalloc(sizeof(bat) * (n + 1));
-   BUN *sizes = GDKzalloc(sizeof(BUN) * (n + 1));
+   int n = ol_length(t->columns);
+
+   bat *commit_list = GDKzalloc(sizeof(bat) * (n + 2));
+   BUN *sizes = GDKzalloc(sizeof(BUN) * (n + 2));
 
if (commit_list == NULL || sizes == NULL) {
+   bat_iterator_end(_bi);
MT_lock_unset(_persist_unlogged);
GDKfree(commit_list);
GDKfree(sizes);
+   BBPreclaim(d);
throw(SQL, "sql.persist_unlogged", 
SQLSTATE(HY001));
}
 
@@ -4396,51 +4400,41 @@ SQLpersist_unlogged(Client cntxt, MalBlk
sizes[0] = 0;
int i = 1;
 
-   for (node *ncol = ol_first_node(t->columns); ncol; ncol 
= ncol->next) {
+   for (node *ncol = ol_first_node(t->columns); ncol; ncol 
= ncol->next, i++) {
 
sql_column *c = (sql_column *) ncol->data;
BAT *b = store->storage_api.bind_col(tr, c, 
QUICK);
 
if (b == NULL) {
+   bat_iterator_end(_bi);
MT_lock_unset(_persist_unlogged);
GDKfree(commit_list);
GDKfree(sizes);
+   BBPreclaim(d);
throw(SQL, "sql.persist_unlogged", 
"Cannot access column descriptor.");
}
 
-   if (i == n && ncol->next) {
-   n = n * 2;
-   commit_list = GDKrealloc(commit_list, 
sizeof(bat) * n);
-   sizes = GDKrealloc(sizes, sizeof(BUN) * 
n);
-   }
-
-   if (commit_list == NULL || sizes == NULL) {
-   MT_lock_unset(_persist_unlogged);
-   GDKfree(commit_list);
-   GDKfree(sizes);
-   throw(SQL, "sql.persist_unlogged", 
SQLSTATE(HY001));
-   }
-
commit_list[i] = b->batCacheid;
sizes[i] = d_bi.count;
-   i++;
}
 
+   assert(ibatCacheid;
sizes[i] = d_bi.count;
i++;
 
if (TMsubcommit_list(commit_list, sizes, i, -1, -1) != 
GDK_SUCCEED) {
+   bat_iterator_end(_bi);
MT_lock_unset(_persist_unlogged);
GDKfree(commit_list);
GDKfree(sizes);
+   BBPreclaim(d);
throw(SQL, "sql.persist_unlogged", "Lower level 
commit operation failed");
}
 
GDKfree(commit_list);
GDKfree(sizes);
}
-
count = d_bi.count;
}
 
@@ -4452,25 +4446,19 @@ SQLpersist_unlogged(Client cntxt, MalBlk
*tableid = COLnew(0, TYPE_int, 0, TRANSIENT),
*rowcount = COLnew(0, TYPE_lng, 0, TRANSIENT);
 
-   if (table == NULL || tableid == NULL || rowcount == NULL) {
-   BBPnreclaim(3, table, tableid, rowcount);
-   throw(SQL, "sql.persist_unlogged", SQLSTATE(HY001));
-   }
-
-   if (BUNappend(table, tname, false) != GDK_SUCCEED ||
+   if 

MonetDB: default - no more GROUP BY constant (part 1)

2024-05-02 Thread Niels Nes via checkin-list
Changeset: 8bac8f7f028c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8bac8f7f028c
Modified Files:
sql/server/rel_select.c
sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test
sql/test/BugTracker-2024/Tests/where_null-7450.test
sql/test/SQLancer/Tests/sqlancer01.test
sql/test/SQLancer/Tests/sqlancer02.test
sql/test/SQLancer/Tests/sqlancer03.test
sql/test/SQLancer/Tests/sqlancer04.test
sql/test/SQLancer/Tests/sqlancer09.test
sql/test/SQLancer/Tests/sqlancer11.test
sql/test/SQLancer/Tests/sqlancer18.test
sql/test/SQLancer/Tests/sqlancer23.test
sql/test/miscellaneous/Tests/groupby_expressions.test
sql/test/miscellaneous/Tests/simple_selects.test
Branch: default
Log Message:

no more GROUP BY constant (part 1)
We dis-allow grouping by constants.
Todo handle the group by numeric (again), ie lookup the numbered column in the
resulting selection


diffs (truncated from 511 to 300 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4068,6 +4068,15 @@ rel_group_column(sql_query *query, sql_r
exp_kind ek = {type_value, card_value, TRUE};
sql_exp *e = rel_value_exp2(lquery, rel, grp, f, ek);
 
+   if (e && exp_is_atom(e)) {
+   sql_subtype *tpe = exp_subtype(e);
+   if (!tpe || tpe->type->eclass != EC_NUM) {
+   if (!tpe)
+   return sql_error(sql, 02, SQLSTATE(42000) 
"Cannot have a parameter (?) for group by column");
+   return sql_error(sql, 02, SQLSTATE(42000) "SELECT: 
non-integer constant in GROUP BY");
+   }
+   }
+
if (!e) {
char buf[ERRSIZE], *name;
int status = sql->session->status;
diff --git a/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test 
b/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
--- a/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
+++ b/sql/test/BugTracker-2023/Tests/misc-crashes-7390.test
@@ -111,7 +111,7 @@ CREATE TEMP TABLE Table0 (Col0 INT, PRIM
 
 -- 07.sql
 statement ok
-CREATE VIEW v0 AS SELECT CAST (NULL AS INT) EXCEPT SELECT CAST (NULL AS INT) 
GROUP BY NULL
+CREATE VIEW v0 AS SELECT CAST (NULL AS INT) EXCEPT SELECT CAST (NULL AS INT)
 
 statement ok
 DROP VIEW v0
@@ -452,7 +452,7 @@ statement ok
 CREATE TABLE v0(v2 DOUBLE PRIMARY KEY, v1 VARCHAR(1))
 
 statement ok
-DELETE FROM v0 WHERE (SELECT v2 FROM v0 WHERE v0.v2 = v0.v1 GROUP BY 2.10, 
v1) IN (10.10, 10, 10 )
+DELETE FROM v0 WHERE (SELECT v2 FROM v0 WHERE v0.v2 = v0.v1 GROUP BY v1) IN 
(10.10, 10, 10 )
 
 statement ok
 DROP TABLE v0
@@ -533,7 +533,7 @@ statement ok
 CREATE TABLE v0(v1 VARCHAR(30), v2 CHAR(20))
 
 statement ok
-DELETE FROM v0 WHERE (SELECT v1 WHERE (SELECT COUNT (*) OVER (ORDER BY v1 DESC 
NULLS LAST)) = v2 GROUP BY 2.10 HAVING 0 NOT LIKE v2)
+DELETE FROM v0 WHERE (SELECT v1 WHERE (SELECT COUNT (*) OVER (ORDER BY v1 DESC 
NULLS LAST)) = v2)
 
 statement ok
 DROP TABLE v0
diff --git a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test 
b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test
--- a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test
+++ b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test
@@ -1,10 +1,10 @@
 query T nosort
-WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x GROUP BY 'x' )
+WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x)
 
 NULL
 
 query T nosort
-SELECT ( WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x GROUP BY 
'x' ) )
+SELECT ( WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x) )
 
 NULL
 
diff --git a/sql/test/BugTracker-2024/Tests/where_null-7450.test 
b/sql/test/BugTracker-2024/Tests/where_null-7450.test
--- a/sql/test/BugTracker-2024/Tests/where_null-7450.test
+++ b/sql/test/BugTracker-2024/Tests/where_null-7450.test
@@ -5,7 +5,7 @@ statement ok
 INSERT INTO t0 ( c0) VALUES (false)
 
 statement ok
-CREATE VIEW v0(c0) AS SELECT true FROM t0 WHERE NULL GROUP BY t0.c0, true
+CREATE VIEW v0(c0) AS SELECT true FROM t0 WHERE NULL GROUP BY t0.c0
 
 query I nosort
 SELECT * FROM v0
diff --git a/sql/test/SQLancer/Tests/sqlancer01.test 
b/sql/test/SQLancer/Tests/sqlancer01.test
--- a/sql/test/SQLancer/Tests/sqlancer01.test
+++ b/sql/test/SQLancer/Tests/sqlancer01.test
@@ -279,7 +279,7 @@ 0.835   0
 0.455  -1239303309
 
 query I rowsort
-SELECT MIN(DISTINCT t0.c1) FROM t0 WHERE 1 >= t0.c0 GROUP BY true
+SELECT MIN(DISTINCT t0.c1) FROM t0 WHERE 1 >= t0.c0
 
 -1239303309
 
@@ -547,7 +547,7 @@ 1511423462.000
 NULL
 
 query RR rowsort
-SELECT ALL 0.1002352, AVG(ALL t0.c0) FROM t0 GROUP BY CAST(t0.c0 AS 
STRING(799)), 0.4665444117594173, ((sql_min(+ ("locate"('', 'F', 150648381)), 
(((-1039870396))*(length('u')>>(CAST(0.588018201374832 AS INT)))
+SELECT ALL 0.1002352, 

MonetDB: Dec2023 - Field function needs at least 2 arguments, fi...

2024-05-02 Thread Niels Nes via checkin-list
Changeset: bceaa8a1561d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bceaa8a1561d
Modified Files:
sql/server/rel_optimize_proj.c
sql/server/rel_select.c
sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test
Branch: Dec2023
Log Message:

Field function needs at least 2 arguments, fixes #7508


diffs (34 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
@@ -1781,6 +1781,8 @@ rel_groupby_cse(visitor *v, sql_rel *rel
sql_exp *e1_in_exps = (e1->l && 
e1->alias.rname == e1->l && e1->alias.name == e1->r) ?
exps_bind_column2(rel->exps, 
e1->l, e1->r, NULL) :
exps_bind_column(rel->exps, 
e1->alias.name, NULL, NULL, 0);
+   if (!e1_in_exps)
+   continue;
assert(e1_in_exps);
 
/* write e2 as an e1 alias since the 
expressions are the same */
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -3536,6 +3536,8 @@ rel_nop(sql_query *query, sql_rel **rel,
if (!sname && strcmp(fname, "field") == 0) { /* map into join */
if (err)
return NULL;
+   if (list_length(exps) < 2)
+   return sql_error(sql, 02, SQLSTATE(42000) "Field 
function called with not enough arguments");
sql_exp *le = exps->h->data;
set_freevar(le, 1);
list_remove_data(exps, NULL, le);
diff --git a/sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test 
b/sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test
--- a/sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test
+++ b/sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test
@@ -1,2 +1,5 @@
-statement error
+statement error 42000!SELECT: identifier 'x' unknown
 SELECT FIELD(x, '', '', '', '', '', '', '', '', '', '', '', '', '')
+
+statement error 42000!Field function called with not enough arguments
+SELECT 
FIELD('fieldID999')
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - enable test

2024-05-01 Thread Niels Nes via checkin-list
Changeset: 85aaf41e2e88 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/85aaf41e2e88
Modified Files:
sql/test/BugTracker-2024/Tests/multicolumn_IN_value_list-Bug-7497.test
Branch: default
Log Message:

enable test


diffs (11 lines):

diff --git 
a/sql/test/BugTracker-2024/Tests/multicolumn_IN_value_list-Bug-7497.test 
b/sql/test/BugTracker-2024/Tests/multicolumn_IN_value_list-Bug-7497.test
--- a/sql/test/BugTracker-2024/Tests/multicolumn_IN_value_list-Bug-7497.test
+++ b/sql/test/BugTracker-2024/Tests/multicolumn_IN_value_list-Bug-7497.test
@@ -10,7 +10,6 @@ CREATE TABLE s (s1 INT, s2 INT, s3 INT);
 statement ok
 INSERT INTO s VALUES (41, 44, 10), (42, 44, 20), (34, 44, 30), (41, 45, 40), 
(34, 45, 50), (34, 44, 60), (42, 44, 70), (42, 44, 80);
 
-skipif knownfail
 query III nosort
 SELECT * FROM s WHERE (s1, s2) IN ((42,44), (41,45), (43,42)) ORDER BY s3;
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - add support for multi col in statements, fixe...

2024-05-01 Thread Niels Nes via checkin-list
Changeset: d7fec2bf7345 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d7fec2bf7345
Modified Files:
sql/backends/monet5/rel_bin.c
sql/server/rel_exp.c
sql/server/rel_select.c
sql/server/rel_unnest.c
sql/server/sql_parser.y
sql/test/SQLancer/Tests/sqlancer22.test
sql/test/subquery/Tests/subquery3.test
sql/test/subquery/Tests/subquery4.test
Branch: default
Log Message:

add support for multi col in statements, fixes #7497


diffs (truncated from 513 to 300 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
@@ -446,8 +446,65 @@ subrel_project(backend *be, stmt *s, lis
 }
 
 static stmt *
+handle_in_tuple_exps(backend *be, sql_exp *ce, list *nl, stmt *left, stmt 
*right, stmt *grp, stmt *ext, stmt *cnt, stmt *sel, bool in, int depth, int 
reduce, int push)
+{
+   mvc *sql = be->mvc;
+   stmt *s = NULL;
+
+   list *lvals = ce->f, *lstmts = sa_list(sql->sa);
+   for(node *n = lvals->h; n; n = n->next) {
+   sql_exp *ce = n->data;
+   stmt *c = exp_bin(be, ce, left, right, grp, ext, cnt, NULL, 
depth+1, 0, push);
+
+   if (c && reduce && c->nrcols == 0)
+   c = stmt_const(be, bin_find_smallest_column(be, left), 
c);
+   if(!c)
+   return NULL;
+   lstmts = append(lstmts, c);
+   }
+
+   sql_subtype *bt = sql_bind_localtype("bit");
+   sql_subfunc *and = sql_bind_func(sql, "sys", "and", bt, bt, F_FUNC, 
true, true);
+   sql_subfunc *or = sql_bind_func(sql, "sys", "or", bt, bt, F_FUNC, true, 
true);
+   for (node *n = nl->h; n; n = n->next) {
+   sql_exp *e = n->data;
+   list *vals = e->f;
+   stmt *cursel = NULL;
+
+   for (node *m = vals->h, *o = lstmts->h; m && o; m = m->next, o 
= o->next) {
+   stmt *c = o->data;
+   sql_subfunc *cmp = (in)
+   ?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_exp *e = m->data;
+
+   stmt *i = exp_bin(be, e, left, right, grp, ext, cnt, 
NULL, depth+1, 0, push);
+   if(!i)
+   return NULL;
+
+   i = stmt_binop(be, c, i, NULL, cmp);
+   if (cursel)
+   cursel = stmt_binop(be, cursel, i, NULL, 
in?and:or);
+   else
+   cursel = i;
+   }
+   if (s)
+   s = stmt_binop(be, s, cursel, NULL, in?or:and);
+   else
+   s = cursel;
+   }
+   if (sel && !(depth || !reduce))
+   s = stmt_uselect(be,
+   s->nrcols == 0?stmt_const(be, 
bin_find_smallest_column(be, left), s): s,
+   stmt_bool(be, 1), cmp_equal, sel, 0, 0);
+   return s;
+}
+
+static stmt *
 handle_in_exps(backend *be, sql_exp *ce, list *nl, stmt *left, stmt *right, 
stmt *grp, stmt *ext, stmt *cnt, stmt *sel, bool in, int depth, int reduce, int 
push)
 {
+   if (ce && is_values(ce))
+   return handle_in_tuple_exps(be, ce, nl, left, right, grp, ext, 
cnt, sel, in, depth, reduce, push);
mvc *sql = be->mvc;
node *n;
stmt *s = NULL, *c = exp_bin(be, ce, left, right, grp, ext, cnt, NULL, 
depth+1, 0, push);
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
@@ -2036,7 +2036,7 @@ exp_is_atom( sql_exp *e )
switch (e->type) {
case e_atom:
if (e->f) /* values list */
-   return 0;
+   return exps_are_atoms(e->f);
return 1;
case e_convert:
return exp_is_atom(e->l);
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -823,45 +823,84 @@ exp_tuples_set_supertype(mvc *sql, list 
 
for (node *m = vals->h; m; m = m->next) {
sql_exp *tuple = m->data;
-   sql_rel *tuple_relation = exp_rel_get_rel(sql->sa, tuple);
-
-   for(n = tuple_relation->exps->h, i = 0; n; n = n->next, i++) {
-   sql_subtype *tpe;
-   sql_exp *e = n->data;
-
-   if (has_type[i] && e->type == e_atom && !e->l && !e->r 
&& !e->f && !e->tpe.type) {
-   if (set_type_param(sql, types+i, e->flag) == 0)
-   e->tpe = types[i];
-   else
+   if (is_values(tuple)) {
+  

MonetDB: Dec2023 - merged

2024-05-01 Thread Niels Nes via checkin-list
Changeset: 473617d38f50 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/473617d38f50
Branch: Dec2023
Log Message:

merged


diffs (39 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
@@ -6658,7 +6658,15 @@ static stmt *
 rel2bin_merge(backend *be, sql_rel *rel, list *refs)
 {
mvc *sql = be->mvc;
-   sql_rel *join = rel->l, *r = rel->r;
+   sql_rel *join;
+
+   if (is_project(((sql_rel*)rel->l)->op)) {
+   join = ((sql_rel*)rel->l)->l;
+   } else {
+   join = rel->l;
+   }
+
+   sql_rel *r = rel->r;
stmt *join_st, *bt_stmt, *target_stmt, *jl, *jr, *ld, *rd = NULL, *ns;
list *slist = sa_list(sql->sa);
 
diff --git a/sql/test/BugTracker-2024/Tests/merge-into-gh-7503.test 
b/sql/test/BugTracker-2024/Tests/merge-into-gh-7503.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/merge-into-gh-7503.test
@@ -0,0 +1,14 @@
+statement ok
+CREATE TABLE logs(id int, activity varchar(255) NOT NULL)
+
+statement ok
+CREATE TABLE stats(activity varchar(255) NOT NULL, absolute_reworks int)
+
+statement ok
+WITH rework_stats AS (SELECT activity, count(*) AS frequency FROM (SELECT 
activity,count(*) AS reworks FROM logs GROUP BY  activity HAVING count(*) > 
1) AS case_reworks GROUP BY activity) MERGE INTO stats USING rework_stats 
on rework_stats.activity = stats.activity WHEN MATCHED THEN UPDATE SET 
absolute_reworks = rework_stats.frequency
+
+statement ok
+DROP TABLE logs
+
+statement ok
+DROP TABLE stats
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - fixed #7506 , properly give an error on incor...

2024-05-01 Thread Niels Nes via checkin-list
Changeset: 1ca42bba0338 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1ca42bba0338
Added Files:
sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test
Modified Files:
sql/server/rel_select.c
sql/test/BugTracker-2024/Tests/All
Branch: Dec2023
Log Message:

fixed #7506 , properly give an error on incorrect inputs for the field function.


diffs (27 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -3534,6 +3534,8 @@ rel_nop(sql_query *query, sql_rel **rel,
char *sname = qname_schema(l->data.lval);
 
if (!sname && strcmp(fname, "field") == 0) { /* map into join */
+   if (err)
+   return NULL;
sql_exp *le = exps->h->data;
set_freevar(le, 1);
list_remove_data(exps, NULL, le);
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -51,3 +51,4 @@ sql_init_subtype-Bug-7487
 orderby-max-over-rows-Bug-7488
 rel2bin_select-Bug-7496
 multicolumn_IN_value_list-Bug-7497
+field-arg-error-Bug-7506
diff --git a/sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test 
b/sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test
@@ -0,0 +1,2 @@
+statement error
+SELECT FIELD(x, '', '', '', '', '', '', '', '', '', '', '', '', '')
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - fixed issue #7499, ie keep default schema in ...

2024-04-28 Thread Niels Nes via checkin-list
Changeset: b86245e5174a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b86245e5174a
Added Files:
sql/test/transactions/Tests/rollback_and_schema-Bug-7499.test
Modified Files:
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_user.c
sql/include/sql_catalog.h
sql/storage/store.c
sql/test/transactions/Tests/All
Branch: Dec2023
Log Message:

fixed issue #7499, ie keep default schema in the session, on missing default 
schema give an error.


diffs (110 lines):

diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -821,7 +821,7 @@ SQLtrans(mvc *m)
}
s = m->session;
if (!s->schema) {
-   switch (monet5_user_get_def_schema(m, m->user_id, 
>schema_name)) {
+   switch (monet5_user_get_def_schema(m, m->user_id, 
>def_schema_name)) {
case -1:
mvc_cancel_session(m);
throw(SQL, "sql.trans", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
@@ -834,6 +834,7 @@ SQLtrans(mvc *m)
default:
break;
}
+   s->schema_name = s->def_schema_name;
if (!(s->schema = find_sql_schema(s->tr, 
s->schema_name))) {
mvc_cancel_session(m);
throw(SQL, "sql.trans", SQLSTATE(42000) "The 
session's schema was not found, this session is going to terminate");
diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c
--- a/sql/backends/monet5/sql_user.c
+++ b/sql/backends/monet5/sql_user.c
@@ -849,6 +849,8 @@ monet5_user_set_def_schema(mvc *m, oid u
}
 
/* while getting the session's schema, set the search path as well */
+   /* new default schema */
+   m->session->def_schema_name = schema;
if (!(ok = mvc_set_schema(m, schema)) || (path_err = 
parse_schema_path_str(m, schema_path, true)) != MAL_SUCCEED) {
if (m->session->tr->active && (other = mvc_rollback(m, 0, NULL, 
false)) != MAL_SUCCEED)
freeException(other);
diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h
--- a/sql/include/sql_catalog.h
+++ b/sql/include/sql_catalog.h
@@ -750,6 +750,7 @@ typedef struct sql_session {
sql_allocator *sa;
sql_trans *tr;  /* active transaction */
 
+   char *def_schema_name; /* users default schema name */
char *schema_name; /* transaction's schema name */
sql_schema *schema;
 
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -7214,13 +7214,11 @@ sql_session_destroy(sql_session *s)
 int
 sql_session_reset(sql_session *s, int ac)
 {
-   char *def_schema_name = SA_STRDUP(s->sa, "sys");
-
-   if (!s->tr || !def_schema_name)
+   if (!s->tr)
return 0;
 
assert(s->tr && s->tr->active == 0);
-   s->schema_name = def_schema_name;
+   s->schema_name = s->def_schema_name;
s->schema = NULL;
s->auto_commit = s->ac_on_commit = ac;
s->level = tr_serializable;
@@ -7236,7 +7234,11 @@ sql_trans_begin(sql_session *s)
store_lock(store);
TRC_DEBUG(SQL_STORE, "Enter sql_trans_begin for transaction: " ULLFMT 
"\n", tr->tid);
tr->ts = store_timestamp(store);
-   if (!(s->schema = find_sql_schema(tr, s->schema_name))) {
+   if (s->schema_name && !(s->schema = find_sql_schema(tr, 
s->schema_name)))
+   s->schema_name = s->def_schema_name;
+   if (!s->schema_name)
+   s->schema_name = "sys";
+   if (s->schema_name && !(s->schema = find_sql_schema(tr, 
s->schema_name))) {
TRC_DEBUG(SQL_STORE, "Exit sql_trans_begin for transaction: " 
ULLFMT " with error, the schema %s was not found\n", tr->tid, s->schema_name);
store_unlock(store);
return -3;
@@ -7268,6 +7270,7 @@ sql_trans_end(sql_session *s, int ok)
s->tr->active = 0;
s->tr->status = 0;
s->auto_commit = s->ac_on_commit;
+   s->schema = NULL;
list_remove_data(store->active, NULL, s->tr);
ATOMIC_SET(>lastactive, GDKusec());
ATOMIC_DEC(>nr_active);
diff --git a/sql/test/transactions/Tests/All b/sql/test/transactions/Tests/All
--- a/sql/test/transactions/Tests/All
+++ b/sql/test/transactions/Tests/All
@@ -10,3 +10,4 @@ truncate-insert-restart
 update_drop_crash
 update_drop_crash2
 insert_drop_crash
+rollback_and_schema-Bug-7499
diff --git a/sql/test/transactions/Tests/rollback_and_schema-Bug-7499.test 
b/sql/test/transactions/Tests/rollback_and_schema-Bug-7499.test
new file mode 100644
--- /dev/null
+++ 

MonetDB: default - merged

2024-04-28 Thread Niels Nes via checkin-list
Changeset: 9c38920fe185 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9c38920fe185
Branch: default
Log Message:

merged


diffs (125 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
@@ -1518,8 +1518,13 @@ exp_bin(backend *be, sql_exp *e, stmt *l
}
if (!l)
return NULL;
-   s = stmt_convert(be, l, (!push&>nrcols==0)?NULL:sel, from, 
to);
-   }   break;
+   if (from->type->eclass == EC_SEC && to->type->eclass == EC_SEC) 
{
+   // trivial conversion because EC_SEC is always in 
milliseconds
+   s = l;
+   } else {
+   s = stmt_convert(be, l, (!push&>nrcols==0)?NULL:sel, 
from, to);
+   }
+   }   break;
case e_func: {
node *en;
list *l = sa_list(sql->sa), *exps = e->l;
diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c
--- a/sql/common/sql_types.c
+++ b/sql/common/sql_types.c
@@ -421,22 +421,29 @@ subtype_cmp(sql_subtype *t1, sql_subtype
 {
if (!t1->type || !t2->type)
return -1;
+   if (t1->type->eclass != t2->type->eclass)
+   return -1;
+   switch (t1->type->eclass) {
+   case EC_SEC:
+   case EC_MONTH:
+   if (t1->digits != t2->digits)
+   return -1;
+   return 0;
+   case EC_NUM:
+   break;
+   case EC_FLT:
+   if (t1->digits != t2->digits)
+   return -1;
+   break;
+   default:
+   if (t1->digits != t2->digits)
+   return -1;
+   if (t1->scale != t2->scale)
+   return -1;
+   break;
+   }
 
-   if (t1->type->eclass == t2->type->eclass && t1->type->eclass == EC_SEC)
-   return 0;
-   if (t1->type->eclass == t2->type->eclass && t1->type->eclass == 
EC_MONTH)
-   return 0;
-   if ( !(t1->type->eclass == t2->type->eclass &&
- (EC_INTERVAL(t1->type->eclass) || t1->type->eclass == EC_NUM)) &&
- (t1->digits != t2->digits ||
- (!(t1->type->eclass == t2->type->eclass &&
-  t1->type->eclass == EC_FLT) &&
-  t1->scale != t2->scale)) )
-   return -1;
-
-   /* subtypes are only equal iff
-  they map onto the same systemtype */
-   return (type_cmp(t1->type, t2->type));
+   return type_cmp(t1->type, t2->type);
 }
 
 int
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
@@ -2964,7 +2964,7 @@ exp_scale_algebra(mvc *sql, sql_subfunc 
sql_subtype *lt = exp_subtype(l);
sql_subtype *rt = exp_subtype(r);
 
-   if (lt->type->scale == SCALE_FIX && (lt->scale || rt->scale) &&
+   if (!EC_INTERVAL(lt->type->eclass) && lt->type->scale == SCALE_FIX && 
(lt->scale || rt->scale) &&
strcmp(sql_func_imp(f->func), "/") == 0) {
sql_subtype *res = f->res->h->data;
unsigned int scale, digits, digL, scaleL;
diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -2133,17 +2133,7 @@ exp_physical_types(visitor *v, sql_rel *
if (!e || (e->type != e_func && e->type != e_convert) || !e->l)
return e;
 
-   if (e->type == e_convert) {
-   sql_subtype *ft = exp_fromtype(e);
-   sql_subtype *tt = exp_totype(e);
-
-   /* complex conversion matrix */
-   if (ft->type->eclass == EC_SEC && tt->type->eclass == EC_SEC && 
ft->type->digits > tt->type->digits) {
-   /* no conversion needed, just time adjustment */
-   ne = e->l;
-   ne->tpe = *tt; // ugh
-   }
-   } else {
+   if (e->type != e_convert) {
list *args = e->l;
sql_subfunc *f = e->f;
 
diff --git a/sql/test/BugTracker-2023/Tests/All 
b/sql/test/BugTracker-2023/Tests/All
--- a/sql/test/BugTracker-2023/Tests/All
+++ b/sql/test/BugTracker-2023/Tests/All
@@ -25,3 +25,4 @@ orderby-debug-crash-7416
 newurl-issue-7417
 rel_order_by-assertion-7418
 HAVE_LIBPY3?aggregate-vararg.Bug-7422
+interval-day-and-second.Bug-7353
diff --git 
a/sql/test/BugTracker-2023/Tests/interval-day-and-second.Bug-7353.test 
b/sql/test/BugTracker-2023/Tests/interval-day-and-second.Bug-7353.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2023/Tests/interval-day-and-second.Bug-7353.test
@@ -0,0 +1,11 @@
+query TTI nosort
+SELECT
+CAST(CAST(value AS TEXT) AS INTERVAL HOUR)AS 

MonetDB: default - implement feature request bug #7500

2024-04-28 Thread Niels Nes via checkin-list
Changeset: a5c4bc890a89 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a5c4bc890a89
Modified Files:
sql/server/rel_psm.c
sql/server/sql_parser.y
Branch: default
Log Message:

implement feature request bug #7500


diffs (237 lines):

diff --git a/sql/server/rel_psm.c b/sql/server/rel_psm.c
--- a/sql/server/rel_psm.c
+++ b/sql/server/rel_psm.c
@@ -614,6 +614,69 @@ has_return( list *l )
 }
 
 static list *
+psm_analyze(sql_query *query, dlist *qname, dlist *columns)
+{
+   mvc *sql = query->sql;
+   const char *sname = qname_schema(qname), *tname = 
qname_schema_object(qname);
+   list *tl = sa_list(sql->sa), *exps = sa_list(sql->sa), *analyze_calls = 
sa_list(sql->sa);
+   sql_subfunc *f = NULL;
+   sql_subtype tpe;
+
+   if (!sql_find_subtype(, "varchar", 1024, 0))
+   return sql_error(sql, 02, SQLSTATE(HY013) "varchar type 
missing?");
+
+   if (sname && tname) {
+   sql_table *t = NULL;
+
+   if (!(t = find_table_or_view_on_scope(sql, NULL, sname, tname, 
"ANALYZE", false)))
+   return NULL;
+   if (isDeclaredTable(t))
+   return sql_error(sql, 02, SQLSTATE(42000) "Cannot 
analyze a declared table");
+   sname = t->s->base.name;
+   }
+   /* call analyze( [schema, [ table ]] ) */
+   if (sname) {
+   sql_exp *sname_exp = exp_atom_str(sql->sa, sname, );
+
+   list_append(exps, sname_exp);
+   list_append(tl, exp_subtype(sname_exp));
+   }
+   if (tname) {
+   sql_exp *tname_exp = exp_atom_str(sql->sa, tname, );
+
+   list_append(exps, tname_exp);
+   list_append(tl, exp_subtype(tname_exp));
+
+   if (columns)
+   list_append(tl, exp_subtype(tname_exp));
+   }
+   if (!columns) {
+   if (!(f = sql_bind_func_(sql, "sys", "analyze", tl, F_PROC, 
true, false)))
+   return sql_error(sql, ERR_NOTFOUND, SQLSTATE(42000) 
"Analyze procedure missing");
+   if (!execute_priv(sql, f->func))
+   return sql_error(sql, 02, SQLSTATE(42000) "No privilege 
to call analyze procedure");
+   list_append(analyze_calls, exp_op(sql->sa, exps, f));
+   } else {
+   if (!sname || !tname)
+   return sql_error(sql, ERR_NOTFOUND, SQLSTATE(42000) 
"Analyze schema or table name missing");
+   if (!(f = sql_bind_func_(sql, "sys", "analyze", tl, F_PROC, 
true, false)))
+   return sql_error(sql, ERR_NOTFOUND, SQLSTATE(42000) 
"Analyze procedure missing");
+   if (!execute_priv(sql, f->func))
+   return sql_error(sql, 02, SQLSTATE(42000) "No privilege 
to call analyze procedure");
+   for(dnode *n = columns->h; n; n = n->next) {
+   const char *cname = n->data.sval;
+   list *nexps = list_dup(exps, NULL);
+   sql_exp *cname_exp = exp_atom_str(sql->sa, cname, );
+
+   list_append(nexps, cname_exp);
+   /* call analyze( opt_minmax, opt_sample_size, sname, 
tname, cname) */
+   list_append(analyze_calls, exp_op(sql->sa, nexps, f));
+   }
+   }
+   return analyze_calls;
+}
+
+static list *
 sequential_block(sql_query *query, sql_subtype *restype, list *restypelist, 
dlist *blk, char *opt_label, int is_func)
 {
mvc *sql = query->sql;
@@ -654,6 +717,11 @@ sequential_block(sql_query *query, sql_s
case SQL_CASE:
res = rel_psm_case(query, restype, restypelist, 
s->data.lval->h, is_func);
break;
+   case SQL_ANALYZE: {
+   dlist *l = s->data.lval;
+
+   reslist = psm_analyze(query, l->h->data.lval /* 
qualified table name */, l->h->next->data.lval /* opt list of column */);
+   }   break;
case SQL_CALL:
assert(s->type == type_symbol);
res = rel_psm_call(query, s->data.sym);
@@ -1427,69 +1495,6 @@ drop_trigger(mvc *sql, dlist *qname, int
return rel_drop_trigger(sql, tr->t->s->base.name, tname, if_exists);
 }
 
-static sql_rel *
-psm_analyze(sql_query *query, dlist *qname, dlist *columns)
-{
-   mvc *sql = query->sql;
-   const char *sname = qname_schema(qname), *tname = 
qname_schema_object(qname);
-   list *tl = sa_list(sql->sa), *exps = sa_list(sql->sa), *analyze_calls = 
sa_list(sql->sa);
-   sql_subfunc *f = NULL;
-   sql_subtype tpe;
-
-   if (!sql_find_subtype(, "varchar", 1024, 0))
-   return sql_error(sql, 02, SQLSTATE(HY013) "varchar type 
missing?");
-
-   if (sname && tname) {
-   sql_table *t = NULL;
-
-   if (!(t = find_table_or_view_on_scope(sql, NULL, sname, 

MonetDB: default - add simple optimizer to rewrite column expres...

2024-04-28 Thread Niels Nes via checkin-list
Changeset: 8c7d4e3a2133 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8c7d4e3a2133
Added Files:
sql/test/miscellaneous/Tests/anti_join_plan.test
Modified Files:
sql/server/rel_optimize_proj.c
sql/storage/bat/bat_storage.c
sql/test/Tests/select_window_pushdown.test
sql/test/mergetables/Tests/mergequery.test
sql/test/miscellaneous/Tests/All
sql/test/miscellaneous/Tests/simple_plans.test
sql/test/miscellaneous/Tests/unique_keys.test
sql/test/prepare/Tests/prepare-utf8.Bug-3930.stable.out
sql/test/prepare/Tests/prepared-statement-with-udf.Bug-6650.stable.out
Branch: default
Log Message:

add simple optimizer to rewrite column expressions into constants when there is 
a col=constant select unter the project


diffs (truncated from 383 to 300 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
@@ -2983,10 +2983,41 @@ rel_groupjoin(visitor *v, sql_rel *rel)
return rel;
 }
 
+/* select k1 from bla where k1 = const -> select const from bla where k1 = 
const */
+static sql_rel *
+rel_project_select_exp(visitor *v, sql_rel *rel)
+{
+   if (is_simple_project(rel->op) && rel->exps && rel->l) {
+   sql_rel *l = rel->l;
+   if (is_select(l->op) && l->exps) {
+   for(node *n = rel->exps->h; n; n = n->next) {
+   sql_exp *col = n->data;
+   if (col->type == e_column) {
+   for(node *m = l->exps->h; m; m = 
m->next) {
+   sql_exp *cmp = m->data;
+   if (cmp->type == e_cmp && 
cmp->flag == cmp_equal && !is_anti(cmp) && !is_semantics(cmp) && 
exp_is_atom(cmp->r)) {
+   sql_exp *l = cmp->l;
+   if(l->type == e_column 
&& ((!col->l && !l->l) || (col->l && l->l && strcmp(col->l, l->l) == 0)) && 
strcmp(col->r, l->r) == 0) {
+   /* replace 
column with the constant */
+   sql_exp *e = 
n->data = exp_copy(v->sql, cmp->r);
+   
exp_setname(v->sql->sa, e, exp_relname(col), exp_name(col));
+   
exp_propagate(v->sql->sa, e, col);
+   
list_hash_clear(rel->exps);
+   }
+   }
+   }
+   }
+   }
+   }
+   }
+   return rel;
+}
+
 static sql_rel *
 rel_optimize_projections_(visitor *v, sql_rel *rel)
 {
rel = rel_project_cse(v, rel);
+   rel = rel_project_select_exp(v, rel);
 
if (!rel || !is_groupby(rel->op))
return rel;
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -493,6 +493,8 @@ segs_end( segments *segs, sql_trans *tr,
 {
size_t cnt = 0;
 
+   /* because a table can grow rows over the time a transaction is 
running, we need to find the last valid segment, to
+* keep all of the parts aligned */
lock_table(tr->store, table->base.id);
segment *s = segs->h, *l = NULL;
 
diff --git a/sql/test/Tests/select_window_pushdown.test 
b/sql/test/Tests/select_window_pushdown.test
--- a/sql/test/Tests/select_window_pushdown.test
+++ b/sql/test/Tests/select_window_pushdown.test
@@ -26,11 +26,11 @@ project (
 | | | | | select (
 | | | | | | table("sys"."test") [ "test"."k" NOT NULL, "test"."v" NOT NULL 
UNIQUE ]
 | | | | | ) [ ("test"."k" NOT NULL) = (int(31) "10") ]
-| | | | ) [ "test"."k" NOT NULL as "t1"."k", "test"."v" NOT NULL UNIQUE as 
"t1"."v", "sys"."mod"("test"."v" NOT NULL UNIQUE, int(2) "2") NOT NULL as 
"%1"."%1", "sys"."="("%1"."%1" NOT NULL, int(31) "0") NOT NULL as "t1"."flag" ]
+| | | | ) [ int(31) "10" as "t1"."k", "test"."v" NOT NULL UNIQUE as "t1"."v", 
"sys"."mod"("test"."v" NOT NULL UNIQUE, int(2) "2") NOT NULL as "%1"."%1", 
"sys"."="("%1"."%1" NOT NULL, int(31) "0") NOT NULL as "t1"."flag" ]
 | | | ) [ "t1"."k" NOT NULL, "t1"."v" NOT NULL UNIQUE, "t1"."flag" NOT NULL ] 
[ "t1"."k" ASC NOT NULL, "t1"."v" NULLS LAST NOT NULL UNIQUE ]
-| | ) [ "t1"."k" NOT NULL, "t1"."v" NOT NULL UNIQUE, "t1"."flag" NOT NULL, 
"sys"."rank"(varchar["sys"."star"()], "sys"."diff"("t1"."k" NOT NULL), 
"sys"."diff"("t1"."v" NOT NULL UNIQUE)) as "t2"."rank" ]
+| | ) [ "t1"."v" NOT NULL UNIQUE, "t1"."flag" NOT NULL, 
"sys"."rank"(varchar["sys"."star"()], 

MonetDB: Dec2023 - fixing some leaks

2024-04-26 Thread Niels Nes via checkin-list
Changeset: 7fe74806fa4b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7fe74806fa4b
Modified Files:
sql/storage/bat/bat_storage.c
Branch: Dec2023
Log Message:

fixing some leaks


diffs (59 lines):

diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -4468,10 +4468,10 @@ tc_gc_col( sql_store Store, sql_change *
return LOG_OK; /* cannot cleanup yet */
 
// d is oldest reachable delta
-   if (d->cs.merged && d->next) // Unreachable can immediately be 
destroyed.
+   if (d->cs.merged && d->next) { // Unreachable can immediately 
be destroyed.
destroy_delta(d->next, true);
-
-   d->next = NULL;
+   d->next = NULL;
+   }
lock_column(store, c->base.id); /* lock for concurrent updates 
(appends) */
merge_delta(d);
unlock_column(store, c->base.id);
@@ -4508,10 +4508,10 @@ tc_gc_upd_col( sql_store Store, sql_chan
return LOG_OK; /* cannot cleanup yet */
 
// d is oldest reachable delta
-   if (d->cs.merged && d->next) // Unreachable can immediately be 
destroyed.
+   if (d->cs.merged && d->next) { // Unreachable can immediately 
be destroyed.
destroy_delta(d->next, true);
-
-   d->next = NULL;
+   d->next = NULL;
+   }
lock_column(store, c->base.id); /* lock for concurrent updates 
(appends) */
merge_delta(d);
unlock_column(store, c->base.id);
@@ -4548,10 +4548,10 @@ tc_gc_idx( sql_store Store, sql_change *
return LOG_OK; /* cannot cleanup yet */
 
// d is oldest reachable delta
-   if (d->cs.merged && d->next) // Unreachable can immediately be 
destroyed.
+   if (d->cs.merged && d->next) { // Unreachable can immediately 
be destroyed.
destroy_delta(d->next, true);
-
-   d->next = NULL;
+   d->next = NULL;
+   }
lock_column(store, i->base.id); /* lock for concurrent updates 
(appends) */
merge_delta(d);
unlock_column(store, i->base.id);
@@ -4588,10 +4588,10 @@ tc_gc_upd_idx( sql_store Store, sql_chan
return LOG_OK; /* cannot cleanup yet */
 
// d is oldest reachable delta
-   if (d->cs.merged && d->next) // Unreachable can immediately be 
destroyed.
+   if (d->cs.merged && d->next) { // Unreachable can immediately 
be destroyed.
destroy_delta(d->next, true);
-
-   d->next = NULL;
+   d->next = NULL;
+   }
lock_column(store, i->base.id); /* lock for concurrent updates 
(appends) */
merge_delta(d);
unlock_column(store, i->base.id);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: jun-order - closing branch (counts are set in the stati...

2024-04-26 Thread Niels Nes via checkin-list
Changeset: a93e012778a4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a93e012778a4
Branch: jun-order
Log Message:

closing branch (counts are set in the statistics, todo reorder join based on 
those)

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


MonetDB: strimps2 - closing branch, a new ngrams branch will be ...

2024-04-26 Thread Niels Nes via checkin-list
Changeset: f31cdc3dd8fe for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f31cdc3dd8fe
Branch: strimps2
Log Message:

closing branch, a new ngrams branch will be created

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


MonetDB: nilmask - merged with default

2024-04-26 Thread Niels Nes via checkin-list
Changeset: e41a45943665 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e41a45943665
Modified Files:
monetdb5/modules/mal/tablet.c
sql/backends/monet5/rel_bin.c
sql/common/sql_types.c
sql/storage/bat/bat_storage.c
Branch: nilmask
Log Message:

merged with default


diffs (288 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -48,7 +48,12 @@ jobs:
   ref: ${{ github.ref }}
 
   - name: install pymonetdb cryptography
-run: pip3 install pymonetdb cryptography
+run: pip3 install --user --upgrade pymonetdb cryptography
+if: runner.os != 'macOS'
+
+  - name: install pymonetdb cryptography
+run: pip3 install --user --break-system-packages --upgrade pymonetdb 
cryptography
+if: runner.os == 'macOS'
 
   - name: make MonetDB on linux
 run: |
@@ -83,7 +88,23 @@ jobs:
 -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison \
 -DCMAKE_SUMMARY=ON
   make install -j3
-if: runner.os == 'macOS'
+if: runner.os == 'macOS' && runner.arch == 'x64'
+
+  - name: make MonetDB on macos
+run: |
+  mkdir build
+  cd build 
+  cmake .. \
+-DCMAKE_INSTALL_PREFIX=$HOME/MDB \
+-DPY3INTEGRATION=OFF \
+-DRINTEGRATION=OFF  \
+-DCMAKE_BUILD_TYPE=Release \
+-DASSERT=OFF \
+-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
+-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison \
+-DCMAKE_SUMMARY=ON
+  make install -j3
+if: runner.os == 'macOS' && runner.arch == 'arm64'
 
   - name: choco packages
 run: |
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4065,6 +4065,33 @@ BBPsync(int cnt, bat *restrict subcommit
if (lock)
MT_lock_set((bid));
}
+   if (subcommit) {
+   /* move any tail/theap files we find for this bat that
+* are in the BACKUP directory to the SUBCOMMIT
+* directory */
+   char fname[16]; /* plenty big enough */
+   if (snprintf(fname, sizeof(fname), "%o", i) < 16) {
+   /* the snprintf never fails, any of the
+* below may fail */
+   if (GDKmove(0, BAKDIR, fname, "tail", SUBDIR, 
fname, "tail", false) == GDK_SUCCEED)
+   TRC_DEBUG(BAT_, "moved %s.tail from %s 
to %s\n",
+ fname, BAKDIR, SUBDIR);
+   if (GDKmove(0, BAKDIR, fname, "tail1", SUBDIR, 
fname, "tail1", false) == GDK_SUCCEED)
+   TRC_DEBUG(BAT_, "moved %s.tail1 from %s 
to %s\n",
+ fname, BAKDIR, SUBDIR);
+   if (GDKmove(0, BAKDIR, fname, "tail2", SUBDIR, 
fname, "tail2", false) == GDK_SUCCEED)
+   TRC_DEBUG(BAT_, "moved %s.tail2 from %s 
to %s\n",
+ fname, BAKDIR, SUBDIR);
+#if SIZEOF_VAR_T == 8
+   if (GDKmove(0, BAKDIR, fname, "tail4", SUBDIR, 
fname, "tail4", false) == GDK_SUCCEED)
+   TRC_DEBUG(BAT_, "moved %s.tail4 from %s 
to %s\n",
+ fname, BAKDIR, SUBDIR);
+#endif
+   if (GDKmove(0, BAKDIR, fname, "theap", SUBDIR, 
fname, "theap", false) == GDK_SUCCEED)
+   TRC_DEBUG(BAT_, "moved %s.theap from %s 
to %s\n",
+ fname, BAKDIR, SUBDIR);
+   }
+   }
BAT *b = dirty_bat(, subcommit != NULL);
if (i <= 0)
ret = GDK_FAIL;
diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c
--- a/monetdb5/modules/mal/tablet.c
+++ b/monetdb5/modules/mal/tablet.c
@@ -1958,8 +1958,7 @@ SQLload_file(Client cntxt, Tablet *as, b
return BUN_NONE;
 }
 
-/* return the latest reject table, to be on the safe side we should
- * actually create copies within a critical section. Ignored for now. */
+/* return the latest reject table */
 str
 COPYrejects(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
@@ -1971,10 +1970,27 @@ COPYrejects(Client cntxt, MalBlkPtr mb, 
create_rejects_table(cntxt);
if (cntxt->error_row == NULL)
throw(MAL, "sql.rejects", "No reject table available");
-   BBPretain(*row = cntxt->error_row->batCacheid);
-   BBPretain(*fld = cntxt->error_fld->batCacheid);
-   

MonetDB: new-avg - closing branch

2024-04-26 Thread Niels Nes via checkin-list
Changeset: e24a0eda02f4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e24a0eda02f4
Branch: new-avg
Log Message:

closing branch

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


MonetDB: groupjoin - closing branch

2024-04-26 Thread Niels Nes via checkin-list
Changeset: 68d9fb2bdc0c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/68d9fb2bdc0c
Branch: groupjoin
Log Message:

closing branch

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


MonetDB: interval-day-second - closing branch

2024-04-26 Thread Niels Nes via checkin-list
Changeset: 4ba20314af21 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4ba20314af21
Branch: interval-day-second
Log Message:

closing branch

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


MonetDB: unoptimized-antijoin - closing branch. the 2 anti joins...

2024-04-26 Thread Niels Nes via checkin-list
Changeset: 71e4272f2081 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/71e4272f2081
Branch: unoptimized-antijoin
Log Message:

closing branch. the 2 anti joins aren't the same, ie cannot apply exact same 
optimizations.

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


MonetDB: monetdburl - closing branch

2024-04-26 Thread Niels Nes via checkin-list
Changeset: bf5b7bb576f4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bf5b7bb576f4
Branch: monetdburl
Log Message:

closing branch

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


MonetDB: copyparpipe - closing branch

2024-04-26 Thread Niels Nes via checkin-list
Changeset: d3689f05b9e7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d3689f05b9e7
Branch: copyparpipe
Log Message:

closing branch

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


MonetDB: directappend - closing branch

2024-04-26 Thread Niels Nes via checkin-list
Changeset: 7280fd3e3c1a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7280fd3e3c1a
Branch: directappend
Log Message:

closing branch

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


MonetDB: nilmask - merged with default

2024-04-26 Thread Niels Nes via checkin-list
+if: runner.os == 'Windows'
+
   - name: ctest 
 run: |
   cd build 
-  cmake --build . --target test
-  - name: install pymonetdb
-run: pip3 install pymonetdb
-  - name: which python
-run: 
-  head -n 1 $HOME/${{ matrix.branch }}/bin/Mtest.py 
+  cmake --build . --target ${{ runner.os == 'Windows' && 'RUN_TESTS' 
|| 'test' }}
+if: runner.os != 'Windows'
+
   - name: mtest 
 run: |
-  #cd build 
-  #cmake --build . --target mtest
-  PATH=$HOME/${{ matrix.branch }}/bin:$PATH $HOME/${{ matrix.branch 
}}/bin/Mtest.py -r --debug=0 --ci --no-html
+  PATH=$HOME/MDB/bin:$PATH $HOME/MDB/bin/Mtest.py -r --debug=0 --ci 
--no-html --TSTTRGBASE=.
+if: runner.os != 'Windows'
+
+  - name: ctest 
+shell: pwsh
+run: |
+  $env:PATH = 
'C:\MDB\lib;C:\MDB\lib\monetdb5;C:\MDB\bin;C:\vcpkg\installed\x64-windows\bin;C:\vcpkg\installed\x64-windows\debug\bin;'
 + $env:PATH
+  cd build 
+  cmake --build . --target ${{ runner.os == 'Windows' && 'RUN_TESTS' 
|| 'test' }}
+if: runner.os == 'Windows'
+
+  - name: mtest 
+shell: pwsh
+run: |
+  $env:PATH = 
'C:\MDB\lib;C:\MDB\lib\monetdb5;C:\MDB\bin;C:\vcpkg\installed\x64-windows\bin;C:\vcpkg\installed\x64-windows\debug\bin;'
 + $env:PATH
+  python C:\MDB\bin\Mtest.py -r --debug=0 --ci --no-html --TSTTRGBASE=.
+if: runner.os == 'Windows'
+
+  - name: Tar files
+run: tar -cvf mtests.tar mTests
   - name: Publish mtest results
-uses: actions/upload-artifact@v3
+uses: actions/upload-artifact@v4
 with:
-  name: mtest-${{ matrix.branch }}
-  path: ${{ matrix.branch }}/mTests/*
+  name: mtest-${{ github.sha }}-${{ matrix.os }}-${{ matrix.c_compiler 
}}
+  path: mtests.tar
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -813,3 +813,15 @@ ce63ebe9a78c52ef0cbe8fd6f2159d2637f0387c
 1efa83c6409769d13b2ee30e497d5f7ab42fa955 Jun2023_9
 6f88424ebfd9d82c072cf21d89070e04321983da Jun2023_11
 6f88424ebfd9d82c072cf21d89070e04321983da Jun2023_SP2_release
+e6eb06773c17035954ac5d001cfe1f09ff3425cc Jun2023_13
+5683fd900f28d65ad7c98d1ed1efd992023a7fa4 Jun2023_15
+c5b17681b55e6ca155db28be59913699e561502a Dec2023_root
+c9e6096e7519636a4e840c7a0c2e27cccb7dc0fe Jun2023_17
+c9e6096e7519636a4e840c7a0c2e27cccb7dc0fe Jun2023_SP3_release
+1230526af30f40eeea30fb87c47c3e414920561f Dec2023_1
+1230526af30f40eeea30fb87c47c3e414920561f Dec2023_release
+95d8feaa1167b5ba87bd99253c3f4e62ebf528a1 Dec2023_3
+dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_5
+dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_SP1_release
+d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_7
+d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_SP2_release
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,9 @@
 # License, v. 2.0.  If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
-# Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V.
+# Copyright 2024 MonetDB Foundation;
+# Copyright August 2008 - 2023 MonetDB B.V.;
+# Copyright 1997 - July 2008 CWI.
 #]]
 
 cmake_minimum_required(VERSION 3.12)
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,20 +1,3 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
-* Mon Oct 30 2023 Sjoerd Mullender 
-- The ranges of merge partitions are now pushed down into the low
-  level GDK operations, giving them a handle to sometimes execute more
-  efficiently.
-
-* Thu Jul 27 2023 Niels Nes 
-- Removed the PYTHON MAP external language option, as after a fork the
-  synchronization primitives could be in any state, leading to deadlocks.
-  During the upgrade function definitions will fallback to the normal
-  PYTHON language option.
-
-* Mon Jul 17 2023 Panagiotis Koutsourakis 
-- Implemented direct masking for strimp construction. The strimps
-  datastructure now keeps an array of 65K 64-bit integers that is zero
-  everywhere except at the indexes that correspond to header pairs. The
-  entry for the nth pair in order has the nth bit of the bitstring
-  on. These can be used to quickly construct bitstrings.
diff --git a/ChangeLog-Archive b/ChangeLog-Archive
--- a/ChangeLog-Archive
+++ b/ChangeLog-Archive
@@ -1,6 +1,34 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Thu Jan 11 2024 Sjoerd Mullender  - 11.49.3-20240304
+- The copyright for the MonetDB software has been transferred to the newly
+  established MonetDB Foundation, a not-for-profit foundation with the
+  express goal of furthering the MonetDB database system.  The license
+  for the software does not change: MonetDB remains fully open source.
+
+* Fri Dec  1 2023 Sjoerd Mullender  - 11.49.1-20231221
+- All binary package

MonetDB: parappend - closing branch

2024-04-26 Thread Niels Nes via checkin-list
Changeset: 7d2123b4b4b5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7d2123b4b4b5
Branch: parappend
Log Message:

closing branch

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


MonetDB: Dec2023 - fix install of pymonetdb on windows

2024-04-25 Thread Niels Nes via checkin-list
Changeset: dcdc1852b47a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/dcdc1852b47a
Modified Files:
.github/workflows/linux.yml
Branch: Dec2023
Log Message:

fix install of pymonetdb on windows


diffs (12 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -49,7 +49,7 @@ jobs:
 
   - name: install pymonetdb cryptography
 run: pip3 install --user --upgrade pymonetdb cryptography
-if: runner.os == 'Linux'
+if: runner.os != 'macOS'
 
   - name: install pymonetdb cryptography
 run: pip3 install --user --break-system-packages --upgrade pymonetdb 
cryptography
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: efficient-pending-changes - closing branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: b04563fc7bba for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b04563fc7bba
Branch: efficient-pending-changes
Log Message:

closing branch

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


MonetDB: nospare-aris - closing branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: bb76f217a675 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bb76f217a675
Branch: nospare-aris
Log Message:

closing branch

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


MonetDB: async-heap-remove - closing experimental branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 3b93b67e65b4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3b93b67e65b4
Branch: async-heap-remove
Log Message:

closing experimental branch

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


MonetDB: sphload-onclient - close branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 9aef789204e8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9aef789204e8
Branch: sphload-onclient
Log Message:

close branch

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


MonetDB: multi-cachelock - closing branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 8cac7b7befd8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8cac7b7befd8
Branch: multi-cachelock
Log Message:

closing branch

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


MonetDB: ir_imprints - close branch we did implement like/ilike ...

2024-04-25 Thread Niels Nes via checkin-list
Changeset: e9d52d1b9a73 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e9d52d1b9a73
Branch: ir_imprints
Log Message:

close branch we did implement like/ilike using strimps later

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


MonetDB: opt_pushoptimizer - closing branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 77ec5c2e79ea for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/77ec5c2e79ea
Branch: opt_pushoptimizer
Log Message:

closing branch

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


MonetDB: trails - closing old ... branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: c1f59951b6af for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c1f59951b6af
Branch: trails
Log Message:

closing old ... branch

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


MonetDB: monetdbe-keywords - closing branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: adcf02e6b734 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/adcf02e6b734
Branch: monetdbe-keywords
Log Message:

closing branch

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


MonetDB: monetdbe_prepare - closing branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 3a1195d3fc1f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3a1195d3fc1f
Branch: monetdbe_prepare
Log Message:

closing branch

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


MonetDB: Dec2023 - use proper and in github action

2024-04-25 Thread Niels Nes via checkin-list
Changeset: ca187134460b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ca187134460b
Modified Files:
.github/workflows/linux.yml
Branch: Dec2023
Log Message:

use proper and in github action


diffs (21 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -88,7 +88,7 @@ jobs:
 -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison \
 -DCMAKE_SUMMARY=ON
   make install -j3
-if: runner.os == 'macOS' and runner.arch == 'x64'
+if: runner.os == 'macOS' && runner.arch == 'x64'
 
   - name: make MonetDB on macos
 run: |
@@ -104,7 +104,7 @@ jobs:
 -DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison \
 -DCMAKE_SUMMARY=ON
   make install -j3
-if: runner.os == 'macOS' and runner.arch == 'arm64'
+if: runner.os == 'macOS' && runner.arch == 'arm64'
 
   - name: choco packages
 run: |
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - change bison on arm hardware

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 886471cf6769 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/886471cf6769
Modified Files:
.github/workflows/linux.yml
Branch: Dec2023
Log Message:

change bison on arm hardware


diffs (40 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -49,6 +49,11 @@ jobs:
 
   - name: install pymonetdb cryptography
 run: pip3 install --user --upgrade pymonetdb cryptography
+if: runner.os == 'Linux'
+
+  - name: install pymonetdb cryptography
+run: pip3 install --user --break-system-packages --upgrade pymonetdb 
cryptography
+if: runner.os == 'macOS'
 
   - name: make MonetDB on linux
 run: |
@@ -83,7 +88,23 @@ jobs:
 -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison \
 -DCMAKE_SUMMARY=ON
   make install -j3
-if: runner.os == 'macOS'
+if: runner.os == 'macOS' and runner.arch == 'x64'
+
+  - name: make MonetDB on macos
+run: |
+  mkdir build
+  cd build 
+  cmake .. \
+-DCMAKE_INSTALL_PREFIX=$HOME/MDB \
+-DPY3INTEGRATION=OFF \
+-DRINTEGRATION=OFF  \
+-DCMAKE_BUILD_TYPE=Release \
+-DASSERT=OFF \
+-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
+-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison \
+-DCMAKE_SUMMARY=ON
+  make install -j3
+if: runner.os == 'macOS' and runner.arch == 'arm64'
 
   - name: choco packages
 run: |
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - lets first try to get ubuntu back..

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 55038940fa7e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/55038940fa7e
Modified Files:
.github/workflows/linux.yml
Branch: Dec2023
Log Message:

lets first try to get ubuntu back..


diffs (12 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -48,7 +48,7 @@ jobs:
   ref: ${{ github.ref }}
 
   - name: install pymonetdb cryptography
-run: pip3 install --user --break-system-packages --upgrade pymonetdb 
cryptography
+run: pip3 install --user --upgrade pymonetdb cryptography
 
   - name: make MonetDB on linux
 run: |
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: urlfuncs - closing branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 0ac1ab4d08c8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0ac1ab4d08c8
Branch: urlfuncs
Log Message:

closing branch

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


MonetDB: Dec2023 - now with --user

2024-04-25 Thread Niels Nes via checkin-list
Changeset: e2d60b79a2dd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e2d60b79a2dd
Modified Files:
.github/workflows/linux.yml
Branch: Dec2023
Log Message:

now with --user


diffs (12 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -48,7 +48,7 @@ jobs:
   ref: ${{ github.ref }}
 
   - name: install pymonetdb cryptography
-run: pip3 install --break-system-packages pymonetdb cryptography
+run: pip3 install --user --break-system-packages --upgrade pymonetdb 
cryptography
 
   - name: make MonetDB on linux
 run: |
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - only free delta's once the parent is merged. ...

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 780c378dd100 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/780c378dd100
Modified Files:
sql/storage/bat/bat_storage.c
Branch: Dec2023
Log Message:

only free delta's once the parent is merged. This makes sure other threads one 
access those older deltas.


diffs (39 lines):

diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -4468,7 +4468,7 @@ tc_gc_col( sql_store Store, sql_change *
return LOG_OK; /* cannot cleanup yet */
 
// d is oldest reachable delta
-   if (d->next) // Unreachable can immediately be destroyed.
+   if (d->cs.merged && d->next) // Unreachable can immediately be 
destroyed.
destroy_delta(d->next, true);
 
d->next = NULL;
@@ -4508,7 +4508,7 @@ tc_gc_upd_col( sql_store Store, sql_chan
return LOG_OK; /* cannot cleanup yet */
 
// d is oldest reachable delta
-   if (d->next) // Unreachable can immediately be destroyed.
+   if (d->cs.merged && d->next) // Unreachable can immediately be 
destroyed.
destroy_delta(d->next, true);
 
d->next = NULL;
@@ -4548,7 +4548,7 @@ tc_gc_idx( sql_store Store, sql_change *
return LOG_OK; /* cannot cleanup yet */
 
// d is oldest reachable delta
-   if (d->next) // Unreachable can immediately be destroyed.
+   if (d->cs.merged && d->next) // Unreachable can immediately be 
destroyed.
destroy_delta(d->next, true);
 
d->next = NULL;
@@ -4588,7 +4588,7 @@ tc_gc_upd_idx( sql_store Store, sql_chan
return LOG_OK; /* cannot cleanup yet */
 
// d is oldest reachable delta
-   if (d->next) // Unreachable can immediately be destroyed.
+   if (d->cs.merged && d->next) // Unreachable can immediately be 
destroyed.
destroy_delta(d->next, true);
 
d->next = NULL;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ci_overhaul - close ci_overhaul branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 6ea2849ab919 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6ea2849ab919
Branch: ci_overhaul
Log Message:

close ci_overhaul branch

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


MonetDB: faster_segs_end - close branch faster_segs_end.

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 607ce6f9aaf3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/607ce6f9aaf3
Branch: faster_segs_end
Log Message:

close branch faster_segs_end.
Can only be done once we change the segments into a double linked list, we
need to return the end of the for this transaction last 'valid' segment.
Any new segements cannot be included else we get un-aligned columns.

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


MonetDB: smapi - closing smapi branch, tls on server side will b...

2024-04-25 Thread Niels Nes via checkin-list
Changeset: de081c3d4230 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/de081c3d4230
Branch: smapi
Log Message:

closing smapi branch, tls on server side will be done by stunnel.
Clients mapi, python and java are extended with tls via other branches

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


MonetDB: no_type_bat - close no_type_bat branch

2024-04-25 Thread Niels Nes via checkin-list
Changeset: 9e2a84d0e2e4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9e2a84d0e2e4
Branch: no_type_bat
Log Message:

close no_type_bat branch

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


MonetDB: Dec2023 - use the pip option --break-system-packages wh...

2024-04-25 Thread Niels Nes via checkin-list
Changeset: a341020b810a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a341020b810a
Modified Files:
.github/workflows/linux.yml
Branch: Dec2023
Log Message:

use the pip option --break-system-packages when we are installing our own 
pymonetdb and cryptography python packages


diffs (12 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -48,7 +48,7 @@ jobs:
   ref: ${{ github.ref }}
 
   - name: install pymonetdb cryptography
-run: pip3 install pymonetdb cryptography
+run: pip3 install --break-system-packages pymonetdb cryptography
 
   - name: make MonetDB on linux
 run: |
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: new-avg - approved output

2024-04-16 Thread Niels Nes via checkin-list
Changeset: 422380651016 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/422380651016
Modified Files:

sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-having-avg.Bug-6428.test
Branch: new-avg
Log Message:

approved output


diffs (14 lines):

diff --git 
a/sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-having-avg.Bug-6428.test
 
b/sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-having-avg.Bug-6428.test
--- 
a/sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-having-avg.Bug-6428.test
+++ 
b/sql/test/BugTracker-2017/Tests/sqlitelogictest-aggregation-having-avg.Bug-6428.test
@@ -20,8 +20,8 @@ project (
 | | | group by (
 | | | | select (
 | | | | | table("sys"."tab0") [ "tab0"."col0" UNIQUE as "cor0"."col0", 
"tab0"."col1" UNIQUE as "cor0"."col1" ]
-| | | | ) [ ("cor0"."col0" UNIQUE) * = (int(32) NULL) ]
-| | | ) [ "cor0"."col1" UNIQUE, "cor0"."col0" UNIQUE ] [ "cor0"."col1" UNIQUE, 
"cor0"."col0" UNIQUE, "sys"."count" unique  no nil ("cor0"."col0" UNIQUE) NOT 
NULL as "%2"."%2", "sys"."sum" unique  no nil ("cor0"."col0" UNIQUE) as 
"%3"."%3" ]
+| | | | ) [ ("cor0"."col0" UNIQUE) * = (int(31) NULL) ]
+| | | ) [ "cor0"."col1" UNIQUE, "cor0"."col0" UNIQUE ] [ "cor0"."col1" UNIQUE, 
"cor0"."col0" UNIQUE, "sys"."count" unique  no nil ("cor0"."col0" UNIQUE) NOT 
NULL as "%2"."%2", "sys"."sum" no nil ("cor0"."col0" UNIQUE) as "%3"."%3" ]
 | | ) [ "cor0"."col1" UNIQUE, "cor0"."col0" UNIQUE, 
"sys"."sql_div"(double(53)["%3"."%3"], double(53)["%2"."%2" NOT NULL] NOT NULL) 
as "%1"."%1" ]
 | ) [ ("sys"."sql_add"(double(53)["sys"."sql_neg"("cor0"."col1" UNIQUE)], 
"%1"."%1")) ! * = (double(53) NULL) ]
 ) [ "sys"."sql_neg"("cor0"."col0" UNIQUE) as "col1" ]
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: new-avg - approved output

2024-04-16 Thread Niels Nes via checkin-list
Changeset: f1675565cb3a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f1675565cb3a
Modified Files:
clients/Tests/MAL-signatures-hge.test
Branch: new-avg
Log Message:

approved output


diffs (69 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -29385,27 +29385,27 @@ CMDbatNOT;
 Unary bitwise not over the tail of the bat with candidates list
 batcalc
 num_div
-pattern batcalc.num_div(X_0:bat[:bte], X_1:bat[:lng]):bat[:bte] 
+pattern batcalc.num_div(X_0:bat[:bte], X_1:bat[:lng]):bat[:bte]
 CMDbatDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 batcalc
 num_div
-pattern batcalc.num_div(X_0:bat[:hge], X_1:bat[:lng]):bat[:hge] 
+pattern batcalc.num_div(X_0:bat[:hge], X_1:bat[:lng]):bat[:hge]
 CMDbatDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 batcalc
 num_div
-pattern batcalc.num_div(X_0:bat[:int], X_1:bat[:lng]):bat[:int] 
+pattern batcalc.num_div(X_0:bat[:int], X_1:bat[:lng]):bat[:int]
 CMDbatDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 batcalc
 num_div
-pattern batcalc.num_div(X_0:bat[:lng], X_1:bat[:lng]):bat[:lng] 
+pattern batcalc.num_div(X_0:bat[:lng], X_1:bat[:lng]):bat[:lng]
 CMDbatDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 batcalc
 num_div
-pattern batcalc.num_div(X_0:bat[:sht], X_1:bat[:lng]):bat[:sht] 
+pattern batcalc.num_div(X_0:bat[:sht], X_1:bat[:lng]):bat[:sht]
 CMDbatDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 batcalc
@@ -43970,27 +43970,27 @@ CMDvarNOT;
 Unary bitwise not of V
 calc
 num_div
-pattern calc.num_div(X_0:bte, X_1:lng):bte 
+pattern calc.num_div(X_0:bte, X_1:lng):bte
 CMDvarDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 calc
 num_div
-pattern calc.num_div(X_0:hge, X_1:lng):hge 
+pattern calc.num_div(X_0:hge, X_1:lng):hge
 CMDvarDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 calc
 num_div
-pattern calc.num_div(X_0:int, X_1:lng):int 
+pattern calc.num_div(X_0:int, X_1:lng):int
 CMDvarDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 calc
 num_div
-pattern calc.num_div(X_0:lng, X_1:lng):lng 
+pattern calc.num_div(X_0:lng, X_1:lng):lng
 CMDvarDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 calc
 num_div
-pattern calc.num_div(X_0:sht, X_1:lng):sht 
+pattern calc.num_div(X_0:sht, X_1:lng):sht
 CMDvarDIV2;
 Return (V1+(V2-1)/2) / V2, nil on divide by zero
 calc
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: new-avg - fixed compilation after merge

2024-04-16 Thread Niels Nes via checkin-list
Changeset: d549a187149a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d549a187149a
Modified Files:
sql/server/rel_optimize_proj.c
Branch: new-avg
Log Message:

fixed compilation after merge


diffs (38 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
@@ -2949,7 +2949,7 @@ find_func( mvc *sql, char *name, list *e
 
for(n = exps->h; n; n = n->next)
append(l, exp_subtype(n->data));
-   return sql_bind_func_(sql, "sys", name, l, F_FUNC, false);
+   return sql_bind_func_(sql, "sys", name, l, F_FUNC, false, true);
 }
 
 static sql_exp *
@@ -3047,14 +3047,14 @@ rel_avg_rewrite(visitor *v, sql_rel *rel
 
/* create nsum/cnt exp */
if (!cnt) {
-   sql_subfunc *cf = sql_bind_func_(sql, "sys", 
"count", append(sa_list(sql->sa), avg_input_t), F_AGGR, false);
+   sql_subfunc *cf = sql_bind_func(sql, "sys", 
"count", avg_input_t, NULL, F_AGGR, true, true);
sql_exp *e = exp_aggr(sql->sa, list_dup(avg->l, 
(fdup)NULL), cf, need_distinct(avg), need_no_nil(avg), avg->card, has_nil(avg));
 
append(nexps, e);
cnt = exp_ref(sql, e);
}
if (!sum) {
-   sql_subfunc *sf = sql_bind_func_(sql, "sys", 
"sum", append(sa_list(sql->sa), avg_input_t), F_AGGR, false);
+   sql_subfunc *sf = sql_bind_func(sql, "sys", 
"sum", avg_input_t, NULL, F_AGGR, true, true);
sql_exp *e = exp_aggr(sql->sa, list_dup(avg->l, 
(fdup)NULL), sf, need_distinct(avg), need_no_nil(avg), avg->card, has_nil(avg));
 
append(nexps, e);
@@ -3075,7 +3075,7 @@ rel_avg_rewrite(visitor *v, sql_rel *rel
 
args = new_exp_list(sql->sa);
append(args, cond);
-   append(args, exp_atom(sql->sa, 
atom_general(sql->sa, exp_subtype(cnt_d), NULL)));
+   append(args, exp_atom(sql->sa, 
atom_general(sql->sa, exp_subtype(cnt_d), NULL, 0)));
/* TODO only ifthenelse if value column may 
have nil's*/
append(args, cnt_d);
ifthen = find_func(sql, "ifthenelse", args);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: new-avg - merged with default

2024-04-16 Thread Niels Nes via checkin-list
--target mtest
-  PATH=$HOME/${{ matrix.branch }}/bin:$PATH $HOME/${{ matrix.branch 
}}/bin/Mtest.py -r --debug=0 --ci --no-html
+  PATH=$HOME/MDB/bin:$PATH $HOME/MDB/bin/Mtest.py -r --debug=0 --ci 
--no-html --TSTTRGBASE=.
+if: runner.os != 'Windows'
+
+  - name: ctest 
+shell: pwsh
+run: |
+  $env:PATH = 
'C:\MDB\lib;C:\MDB\lib\monetdb5;C:\MDB\bin;C:\vcpkg\installed\x64-windows\bin;C:\vcpkg\installed\x64-windows\debug\bin;'
 + $env:PATH
+  cd build 
+  cmake --build . --target ${{ runner.os == 'Windows' && 'RUN_TESTS' 
|| 'test' }}
+if: runner.os == 'Windows'
+
+  - name: mtest 
+shell: pwsh
+run: |
+  $env:PATH = 
'C:\MDB\lib;C:\MDB\lib\monetdb5;C:\MDB\bin;C:\vcpkg\installed\x64-windows\bin;C:\vcpkg\installed\x64-windows\debug\bin;'
 + $env:PATH
+  python C:\MDB\bin\Mtest.py -r --debug=0 --ci --no-html --TSTTRGBASE=.
+if: runner.os == 'Windows'
+
+  - name: Tar files
+run: tar -cvf mtests.tar mTests
   - name: Publish mtest results
-uses: actions/upload-artifact@v3
+uses: actions/upload-artifact@v4
 with:
-  name: mtest-${{ matrix.branch }}
-  path: ${{ matrix.branch }}/mTests/*
+  name: mtest-${{ github.sha }}-${{ matrix.os }}-${{ matrix.c_compiler 
}}
+  path: mtests.tar
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -813,3 +813,15 @@ ce63ebe9a78c52ef0cbe8fd6f2159d2637f0387c
 1efa83c6409769d13b2ee30e497d5f7ab42fa955 Jun2023_9
 6f88424ebfd9d82c072cf21d89070e04321983da Jun2023_11
 6f88424ebfd9d82c072cf21d89070e04321983da Jun2023_SP2_release
+e6eb06773c17035954ac5d001cfe1f09ff3425cc Jun2023_13
+5683fd900f28d65ad7c98d1ed1efd992023a7fa4 Jun2023_15
+c5b17681b55e6ca155db28be59913699e561502a Dec2023_root
+c9e6096e7519636a4e840c7a0c2e27cccb7dc0fe Jun2023_17
+c9e6096e7519636a4e840c7a0c2e27cccb7dc0fe Jun2023_SP3_release
+1230526af30f40eeea30fb87c47c3e414920561f Dec2023_1
+1230526af30f40eeea30fb87c47c3e414920561f Dec2023_release
+95d8feaa1167b5ba87bd99253c3f4e62ebf528a1 Dec2023_3
+dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_5
+dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_SP1_release
+d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_7
+d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_SP2_release
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,9 @@
 # License, v. 2.0.  If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
-# Copyright 1997 - July 2008 CWI, August 2008 - 2023 MonetDB B.V.
+# Copyright 2024 MonetDB Foundation;
+# Copyright August 2008 - 2023 MonetDB B.V.;
+# Copyright 1997 - July 2008 CWI.
 #]]
 
 cmake_minimum_required(VERSION 3.12)
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,20 +1,3 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
-* Mon Oct 30 2023 Sjoerd Mullender 
-- The ranges of merge partitions are now pushed down into the low
-  level GDK operations, giving them a handle to sometimes execute more
-  efficiently.
-
-* Thu Jul 27 2023 Niels Nes 
-- Removed the PYTHON MAP external language option, as after a fork the
-  synchronization primitives could be in any state, leading to deadlocks.
-  During the upgrade function definitions will fallback to the normal
-  PYTHON language option.
-
-* Mon Jul 17 2023 Panagiotis Koutsourakis 
-- Implemented direct masking for strimp construction. The strimps
-  datastructure now keeps an array of 65K 64-bit integers that is zero
-  everywhere except at the indexes that correspond to header pairs. The
-  entry for the nth pair in order has the nth bit of the bitstring
-  on. These can be used to quickly construct bitstrings.
diff --git a/ChangeLog-Archive b/ChangeLog-Archive
--- a/ChangeLog-Archive
+++ b/ChangeLog-Archive
@@ -1,6 +1,34 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Thu Jan 11 2024 Sjoerd Mullender  - 11.49.3-20240304
+- The copyright for the MonetDB software has been transferred to the newly
+  established MonetDB Foundation, a not-for-profit foundation with the
+  express goal of furthering the MonetDB database system.  The license
+  for the software does not change: MonetDB remains fully open source.
+
+* Fri Dec  1 2023 Sjoerd Mullender  - 11.49.1-20231221
+- All binary packages are now signed with a new key with key fingerprint
+  DBCE 5625 94D7 1959 7B54  CE85 3F1A D47F 5521 A603.
+
+* Mon Oct 30 2023 Sjoerd Mullender  - 11.49.1-20231221
+- The ranges of merge partitions are now pushed down into the low
+  level GDK operations, giving them a handle to sometimes execute more
+  efficiently.
+
+* Thu Jul 27 2023 Niels Nes  - 11.49.1-20231221
+- Removed the PYTHON MAP external language option, as after a fork the
+  synchronization primitives could be in any state, leading to deadlocks.
+  During the 

MonetDB: resource_management - create new branch for resource_ma...

2024-04-15 Thread Niels Nes via checkin-list
Changeset: af12610859ae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/af12610859ae
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk.h
gdk/gdk_aggr.c
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_calc_convert.c
gdk/gdk_string.c
gdk/gdk_utils.c
gdk/gdk_value.c
monetdb5/extras/rapi/rapi.c
monetdb5/mal/mal.h
monetdb5/mal/mal_builder.c
monetdb5/mal/mal_client.c
monetdb5/mal/mal_client.h
monetdb5/mal/mal_function.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_instruction.h
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_profiler.c
monetdb5/mal/mal_session.c
monetdb5/mal/mal_stack.c
monetdb5/modules/mal/calc.c
monetdb5/modules/mal/iterator.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/manifold.c
monetdb5/modules/mal/remote.c
monetdb5/optimizer/opt_aliases.c
monetdb5/optimizer/opt_coercion.c
monetdb5/optimizer/opt_commonTerms.c
monetdb5/optimizer/opt_constants.c
monetdb5/optimizer/opt_costModel.c
monetdb5/optimizer/opt_dataflow.c
monetdb5/optimizer/opt_deadcode.c
monetdb5/optimizer/opt_dict.c
monetdb5/optimizer/opt_emptybind.c
monetdb5/optimizer/opt_evaluate.c
monetdb5/optimizer/opt_for.c
monetdb5/optimizer/opt_garbageCollector.c
monetdb5/optimizer/opt_generator.c
monetdb5/optimizer/opt_inline.c
monetdb5/optimizer/opt_inline.h
monetdb5/optimizer/opt_matpack.c
monetdb5/optimizer/opt_mergetable.c
monetdb5/optimizer/opt_mitosis.c
monetdb5/optimizer/opt_multiplex.c
monetdb5/optimizer/opt_prelude.c
monetdb5/optimizer/opt_prelude.h
monetdb5/optimizer/opt_profiler.c
monetdb5/optimizer/opt_projectionpath.c
monetdb5/optimizer/opt_pushselect.c
monetdb5/optimizer/opt_querylog.c
monetdb5/optimizer/opt_remap.c
monetdb5/optimizer/opt_remoteQueries.c
monetdb5/optimizer/opt_reorder.c
monetdb5/optimizer/opt_support.h
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/UDF/pyapi3/pyapi3.c
sql/backends/monet5/generator/generator.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_rank.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/sql_statement.h
sql/common/sql_hash.c
sql/common/sql_list.c
sql/include/sql_hash.h
sql/include/sql_list.h
sql/include/sql_mem.h
sql/scripts/23_skyserver.sql
sql/server/rel_basetable.c
sql/server/rel_optimizer.c
sql/server/sql_parser.y
sql/server/sql_var.c
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_utils.c
sql/storage/sql_catalog.c
sql/storage/store.c
sql/test/prepare/Tests/sqlancer_prepare.sql
sql/test/prepare/Tests/sqlancer_prepare.stable.err
sql/test/prepare/Tests/sqlancer_prepare.stable.err.int128
Branch: resource_management
Log Message:

create new branch for resource_management improvements

first steps:
use allocators in mal interpreter (therefor also the VAL* functions can 
now optionaly have an allocator as first argument)
use temp - allocators instead of temp GDKmalloc's in optimizers


diffs (truncated from 4354 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
@@ -416,11 +416,11 @@ gdk_return TMsubcommit_list(bat *restric
 void VALclear(ValPtr v);
 int VALcmp(const ValRecord *p, const ValRecord *q);
 void *VALconvert(int typ, ValPtr t);
-ValPtr VALcopy(ValPtr dst, const ValRecord *src);
+ValPtr VALcopy(allocator *va, ValPtr dst, const ValRecord *src);
 void VALempty(ValPtr v);
 char *VALformat(const ValRecord *res) __attribute__((__warn_unused_result__));
 void *VALget(ValPtr v);
-ValPtr VALinit(ValPtr d, int tpe, const void *s);
+ValPtr VALinit(allocator *va, ValPtr d, int tpe, const void *s);
 bool VALisnil(const ValRecord *v);
 ValPtr VALset(ValPtr v, int t, void *p);
 gdk_return VARcalcabsolute(ValPtr ret, const ValRecord *v);
@@ -580,8 +580,10 @@ const ptr ptr_nil;
 struct dirent *readdir(DIR *dir);
 void rewinddir(DIR *dir);
 void *sa_alloc(allocator *sa, size_t sz);
+void sa_close(allocator *sa);
 allocator *sa_create(allocator *pa);
 void sa_destroy(allocator *sa);
+void sa_open(allocator *sa);
 void *sa_realloc(allocator *sa, void *ptr, size_t sz, size_t osz);
 allocator *sa_reset(allocator *sa);
 size_t sa_size(allocator *sa);
@@ -880,8 +882,8 @@ char *concatErrors(char *err1, const cha
 const char *connectRef;
 const char 

MonetDB: default - on missing value continue

2024-04-14 Thread Niels Nes via checkin-list
Changeset: d08a1d528d45 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d08a1d528d45
Modified Files:
sql/server/rel_unnest.c
Branch: default
Log Message:

on missing value continue


diffs (12 lines):

diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -2361,6 +2361,8 @@ rel_set_type(visitor *v, sql_rel *rel)
if (l->type == e_column) {
sql_rel *sl = rel->l;
sql_exp *e = 
rel_find_exp(sl, l);
+   if (!e)
+   continue;
if (is_groupby(sl->op) 
&& exp_equal(e, l) == 0) {
sql_exp *e2 = 
list_find_exp(sl->r, l);
if (e2) {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - small code layout change

2024-04-14 Thread Niels Nes via checkin-list
Changeset: 5cac5abf2acd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5cac5abf2acd
Modified Files:
sql/server/rel_optimize_sel.c
Branch: default
Log Message:

small code layout change


diffs (13 lines):

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
@@ -3493,8 +3493,7 @@ rel_push_select_down(visitor *v, sql_rel
/* the column in 'like' 
filters is stored inside a list */
if (e->flag == 
cmp_filter) {
column = 
((list*)e->l)->h->data;
-   }
-   else {
+   } else {
column = e->l;
}
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - some more simplified versions too test

2024-04-14 Thread Niels Nes via checkin-list
Changeset: 7c9853c5bd45 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7c9853c5bd45
Modified Files:
sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
Branch: default
Log Message:

some more simplified versions too test


diffs (19 lines):

diff --git a/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test 
b/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
--- a/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
+++ b/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
@@ -1,4 +1,15 @@
+query I nosort
+SELECT ( SELECT ( SELECT ( NULLIF ( 9.00 , 0 ) ) FROM GENERATE_SERIES ( 1 
, x )) FROM ( SELECT DISTINCT SUM ( 1 ) ) x (x)) FROM ( SELECT 1 ) x (x)
+
+9
+
+query I nosort
+SELECT ( SELECT ( SELECT ( SELECT ( NULLIF ( 9.00 , 0 ) ) FROM 
GENERATE_SERIES ( 1 , x )) FROM ( SELECT DISTINCT SUM ( 1 ) ) x (x)) FROM ( 
SELECT 1 ) x (x))
+
+9
+
 query I nosort
 SELECT ( WITH x ( x ) AS ( SELECT 1 ) SELECT ( WITH x ( x ) AS ( SELECT 
DISTINCT SUM ( 1 ) ) SELECT ( SELECT ( NULLIF ( 9.00 , 0 ) ) FROM 
GENERATE_SERIES ( 1 , x ) ) FROM x ) FROM x )
 
 9
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - fix output after merged fixes

2024-04-14 Thread Niels Nes via checkin-list
Changeset: 677917fc722e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/677917fc722e
Modified Files:
sql/test/pg_regress/Tests/int8.test
Branch: default
Log Message:

fix output after merged fixes


diffs (26 lines):

diff --git a/sql/test/pg_regress/Tests/int8.test 
b/sql/test/pg_regress/Tests/int8.test
--- a/sql/test/pg_regress/Tests/int8.test
+++ b/sql/test/pg_regress/Tests/int8.test
@@ -261,22 +261,10 @@ statement error 42000!SELECT: no such bi
 SELECT '' AS to_char_2, to_char(q1, '9G999G999G999G999G999D999G999'), 
to_char(q2, '9,999,999,999,999,999.999,999')
FROM INT8_TBL
 
-onlyif has-hugeint
-statement error 42000!SELECT: no such binary operator 
'to_char'(hugeint,varchar)
-SELECT '' AS to_char_3, to_char( (q1 * -1), 'PR'), to_char( 
(q2 * -1), '.999PR')
-   FROM INT8_TBL
-
-skipif has-hugeint
 statement error 42000!SELECT: no such binary operator 'to_char'(bigint,varchar)
 SELECT '' AS to_char_3, to_char( (q1 * -1), 'PR'), to_char( 
(q2 * -1), '.999PR')
FROM INT8_TBL
 
-onlyif has-hugeint
-statement error 42000!SELECT: no such binary operator 
'to_char'(hugeint,varchar)
-SELECT '' AS to_char_4, to_char( (q1 * -1), 'S'), to_char( (q2 
* -1), 'S')
-   FROM INT8_TBL
-
-skipif has-hugeint
 statement error 42000!SELECT: no such binary operator 'to_char'(bigint,varchar)
 SELECT '' AS to_char_4, to_char( (q1 * -1), 'S'), to_char( (q2 
* -1), 'S')
FROM INT8_TBL
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - merged with dec2023

2024-04-14 Thread Niels Nes via checkin-list
Changeset: 7713c2fcac34 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7713c2fcac34
Modified Files:
sql/server/rel_optimize_proj.c
sql/server/rel_select.c
sql/server/rel_unnest.c
sql/test/BugTracker-2023/Tests/All
Branch: default
Log Message:

merged with dec2023


diffs (255 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
@@ -691,7 +691,7 @@ rel_push_project_up_(visitor *v, sql_rel
for (n = rel->exps->h; n && !fnd; n = n->next) {
sql_exp *e = n->data;
 
-   if (e->type != e_aggr && e->type != e_column && e->type 
!= e_atom) {
+   if (e->type != e_aggr && e->type != e_column && e->type 
!= e_atom && e->card > CARD_ATOM) {
fnd = 1;
}
}
@@ -1370,6 +1370,7 @@ rel_project_cse(visitor *v, sql_rel *rel
sql_exp *ne = 
exp_alias(v->sql->sa, exp_relname(e1), exp_name(e1), exp_relname(e2), 
exp_name(e2), exp_subtype(e2), e2->card, has_nil(e2), is_unique(e2), 
is_intern(e1));
 
ne = exp_propagate(v->sql->sa, 
ne, e1);
+   set_selfref(ne);
exp_prop_alias(v->sql->sa, ne, 
e1);
e1 = ne;
break;
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4143,7 +4143,7 @@ rel_groupings(sql_query *query, sql_rel 
if (e->type != e_column) { /* 
store group by expressions in the stack */
if 
(is_sql_group_totals(f))
return 
sql_error(sql, 02, SQLSTATE(42000) "GROUP BY: grouping expressions not possible 
with ROLLUP, CUBE and GROUPING SETS");
-   if 
(!frame_push_groupby_expression(sql, grp, e))
+   if (!exp_has_rel(e) && 
!frame_push_groupby_expression(sql, grp, e))
return NULL;
}
list_append(next_tuple, e);
@@ -5188,36 +5188,34 @@ group_merge_exps(mvc *sql, list *gexps, 
 {
int nexps = list_length(gexps) + list_length(exps);
 
-   if (nexps < 5) {
-   return list_distinct(list_merge(gexps, exps, (fdup) NULL), 
(fcmp) exp_equal, (fdup) NULL);
-   } else { /* for longer lists, use hashing */
-   sql_hash *ht = hash_new(sql->ta, nexps, (fkeyvalue)_key);
-
-   for (node *n = gexps->h; n ; n = n->next) { /* first add 
grouping expressions */
-   sql_exp *e = n->data;
-   int key = ht->key(e);
-
-   hash_add(ht, key, e);
-   }
-
-   for (node *n = exps->h; n ; n = n->next) { /* then test if the 
new grouping expressions are already there */
-   sql_exp *e = n->data;
-   int key = ht->key(e);
-   sql_hash_e *he = ht->buckets[key&(ht->size-1)];
-   bool duplicates = false;
-
-   for (; he && !duplicates; he = he->chain) {
-   sql_exp *f = he->value;
-
-   if (!exp_equal(e, f))
-   duplicates = true;
-   }
-   hash_add(ht, key, e);
-   if (!duplicates)
-   list_append(gexps, e);
-   }
-   return gexps;
-   }
+   sql_hash *ht = hash_new(sql->ta, nexps, (fkeyvalue)_key);
+
+   for (node *n = gexps->h; n ; n = n->next) { /* first add grouping 
expressions */
+   sql_exp *e = n->data;
+   int key = ht->key(e);
+
+   hash_add(ht, key, e);
+   }
+
+   for (node *n = exps->h; n ; n = n->next) { /* then test if the new 
grouping expressions are already there */
+   sql_exp *e = n->data;
+   int key = ht->key(e);
+   sql_hash_e *he = ht->buckets[key&(ht->size-1)];
+   bool duplicates = false;
+
+   for (; he && !duplicates; he = he->chain) {
+   sql_exp *f = he->value;
+
+   if (!exp_equal(e, f))
+   duplicates = true;
+   }
+   hash_add(ht, key, e);
+   if (!duplicates) {
+   list_append(gexps, e);
+   

MonetDB: Dec2023 - in group_merge_exps create proper referencing...

2024-04-14 Thread Niels Nes via checkin-list
Changeset: 191efb7c655b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/191efb7c655b
Modified Files:
sql/server/rel_optimize_proj.c
sql/server/rel_select.c
sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test
Branch: Dec2023
Log Message:

in group_merge_exps create proper referencing expressions in the projection
in rel_push_project_up_ don't remove simple (single value) expressions in the 
expression list of the group by operator
this solves bug #7478


diffs (96 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
@@ -691,7 +691,7 @@ rel_push_project_up_(visitor *v, sql_rel
for (n = rel->exps->h; n && !fnd; n = n->next) {
sql_exp *e = n->data;
 
-   if (e->type != e_aggr && e->type != e_column && e->type 
!= e_atom) {
+   if (e->type != e_aggr && e->type != e_column && e->type 
!= e_atom && e->card > CARD_ATOM) {
fnd = 1;
}
}
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -5651,36 +5651,34 @@ group_merge_exps(mvc *sql, list *gexps, 
 {
int nexps = list_length(gexps) + list_length(exps);
 
-   if (nexps < 5) {
-   return list_distinct(list_merge(gexps, exps, (fdup) NULL), 
(fcmp) exp_equal, (fdup) NULL);
-   } else { /* for longer lists, use hashing */
-   sql_hash *ht = hash_new(sql->ta, nexps, (fkeyvalue)_key);
-
-   for (node *n = gexps->h; n ; n = n->next) { /* first add 
grouping expressions */
-   sql_exp *e = n->data;
-   int key = ht->key(e);
-
-   hash_add(ht, key, e);
-   }
-
-   for (node *n = exps->h; n ; n = n->next) { /* then test if the 
new grouping expressions are already there */
-   sql_exp *e = n->data;
-   int key = ht->key(e);
-   sql_hash_e *he = ht->buckets[key&(ht->size-1)];
-   bool duplicates = false;
-
-   for (; he && !duplicates; he = he->chain) {
-   sql_exp *f = he->value;
-
-   if (!exp_equal(e, f))
-   duplicates = true;
-   }
-   hash_add(ht, key, e);
-   if (!duplicates)
-   list_append(gexps, e);
-   }
-   return gexps;
-   }
+   sql_hash *ht = hash_new(sql->ta, nexps, (fkeyvalue)_key);
+
+   for (node *n = gexps->h; n ; n = n->next) { /* first add grouping 
expressions */
+   sql_exp *e = n->data;
+   int key = ht->key(e);
+
+   hash_add(ht, key, e);
+   }
+
+   for (node *n = exps->h; n ; n = n->next) { /* then test if the new 
grouping expressions are already there */
+   sql_exp *e = n->data;
+   int key = ht->key(e);
+   sql_hash_e *he = ht->buckets[key&(ht->size-1)];
+   bool duplicates = false;
+
+   for (; he && !duplicates; he = he->chain) {
+   sql_exp *f = he->value;
+
+   if (!exp_equal(e, f))
+   duplicates = true;
+   }
+   hash_add(ht, key, e);
+   if (!duplicates) {
+   list_append(gexps, e);
+   n->data = exp_ref(sql, e);
+   }
+   }
+   return gexps;
 }
 
 static list *
diff --git a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test 
b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test
--- a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test
+++ b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test
@@ -1,10 +1,10 @@
-skipif knownfail
 query T nosort
 WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x GROUP BY 'x' )
 
+NULL
 
-skipif knownfail
 query T nosort
 SELECT ( WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x GROUP BY 
'x' ) )
 
+NULL
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - correct test output

2024-04-14 Thread Niels Nes via checkin-list
Changeset: 1158d6d8419c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1158d6d8419c
Modified Files:
sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
Branch: Dec2023
Log Message:

correct test output


diffs (9 lines):

diff --git a/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test 
b/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
--- a/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
+++ b/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
@@ -1,4 +1,4 @@
 query I nosort
 SELECT ( WITH x ( x ) AS ( SELECT 1 ) SELECT ( WITH x ( x ) AS ( SELECT 
DISTINCT SUM ( 1 ) ) SELECT ( SELECT ( NULLIF ( 9.00 , 0 ) ) FROM 
GENERATE_SERIES ( 1 , x ) ) FROM x ) FROM x )
 
-1
+9
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - bind variables after push_up_table.

2024-04-14 Thread Niels Nes via checkin-list
Changeset: dc820ea55775 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/dc820ea55775
Modified Files:
sql/server/rel_unnest.c
sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
Branch: Dec2023
Log Message:

bind variables after push_up_table.
This solves bug #7473


diffs (91 lines):

diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -1591,6 +1591,8 @@ push_up_table(mvc *sql, sql_rel *rel, li
id = exp_ref(sql, id);
} else {
l->l = rel_dup(d);
+   if (is_project(l->op))
+   rel_bind_vars(sql, l, l->exps);
}
} else {
tf->l = rel_dup(d);
@@ -4257,23 +4259,58 @@ rel_simplify_exp_and_rank(visitor *v, sq
return e;
 }
 
+static inline sql_rel *
+run_exp_rewriter(visitor *v, sql_rel *rel, exp_rewrite_fptr rewriter, bool 
direction, const char *name)
+{
+   (void)name;
+   /*
+#ifndef NDEBUG
+   int changes = v->changes;
+   lng clk = GDKusec();
+   rel = rel_exp_visitor_bottomup(v, rel, rewriter, direction);
+   printf("%s %d " LLFMT "\n", name, (v->changes - changes), (GDKusec() - 
clk));
+   return rel;
+#else
+*/
+   return rel_exp_visitor_bottomup(v, rel, rewriter, direction);
+//#endif
+}
+
+static inline sql_rel *
+run_rel_rewriter(visitor *v, sql_rel *rel, rel_rewrite_fptr rewriter, const 
char *name)
+{
+   (void)name;
+   /*
+#ifndef NDEBUG
+   int changes = v->changes;
+   lng clk = GDKusec();
+   rel = rel_visitor_bottomup(v, rel, rewriter);
+   printf("%s %d " LLFMT "\n", name, (v->changes - changes), (GDKusec() - 
clk));
+   return rel;
+#else
+*/
+   return rel_visitor_bottomup(v, rel, rewriter);
+//#endif
+}
+
 sql_rel *
 rel_unnest(mvc *sql, sql_rel *rel)
 {
visitor v = { .sql = sql };
 
-   rel = rel_exp_visitor_bottomup(, rel, _simplify_exp_and_rank, 
false);
-   rel = rel_visitor_bottomup(, rel, _unnest_simplify);
-
-   rel = rel_exp_visitor_bottomup(, rel, _complex, true);
-   rel = rel_exp_visitor_bottomup(, rel, _ifthenelse, false);
/* add isnull handling */
-   rel = rel_exp_visitor_bottomup(, rel, _exp_rel, true);
-
-   rel = rel_visitor_bottomup(, rel, _unnest_comparison_rewriters);
-   rel = rel_visitor_bottomup(, rel, &_rel_unnest);
-   rel = rel_visitor_bottomup(, rel, _fix_count);/* fix 
count inside a left join (adds a project (if (cnt IS null) then (0) else (cnt)) 
*/
-   rel = rel_visitor_bottomup(, rel, _unnest_projects);
-   rel = rel_exp_visitor_bottomup(, rel, 
_reset_card_and_freevar_set_physical_type, false);
+   rel = run_exp_rewriter(, rel, _simplify_exp_and_rank, false, 
"simplify_exp_and_rank");
+   rel = run_rel_rewriter(, rel, _unnest_simplify, 
"unnest_simplify");
+//if (0) {
+   rel = run_exp_rewriter(, rel, _complex, true, 
"rewrite_complex");
+   rel = run_exp_rewriter(, rel, _ifthenelse, false, 
"rewrite_ifthenelse"); /* add isnull handling */
+   rel = run_exp_rewriter(, rel, _exp_rel, true, 
"rewrite_exp_rel");
+
+   rel = run_rel_rewriter(, rel, _unnest_comparison_rewriters, 
"unnest_comparison_rewriters");
+   rel = run_rel_rewriter(, rel, &_rel_unnest, "unnest");
+   rel = run_rel_rewriter(, rel, _fix_count, "fix_count");   
/* fix count inside a left join (adds a project (if (cnt IS null) then (0) else 
(cnt)) */
+   rel = run_rel_rewriter(, rel, _unnest_projects, 
"unnest_projects");
+//}
+   rel = run_exp_rewriter(, rel, 
_reset_card_and_freevar_set_physical_type, false, 
"exp_reset_card_and_freevar_set_physical_type");
rel = rel_visitor_topdown(, rel, _set_type);
return rel;
 }
diff --git a/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test 
b/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
--- a/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
+++ b/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test
@@ -1,4 +1,3 @@
-skipif knownfail
 query I nosort
 SELECT ( WITH x ( x ) AS ( SELECT 1 ) SELECT ( WITH x ( x ) AS ( SELECT 
DISTINCT SUM ( 1 ) ) SELECT ( SELECT ( NULLIF ( 9.00 , 0 ) ) FROM 
GENERATE_SERIES ( 1 , x ) ) FROM x ) FROM x )
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Don't do group by expression matching when th...

2024-04-14 Thread Niels Nes via checkin-list
Changeset: df584735e3a3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/df584735e3a3
Modified Files:
sql/server/rel_select.c
sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test
Branch: Dec2023
Log Message:

Don't do group by expression matching when the group by expression has freevars.
This solves bug #7472


diffs (23 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4594,7 +4594,7 @@ rel_groupings(sql_query *query, sql_rel 
if (e->type != e_column) { /* 
store group by expressions in the stack */
if 
(is_sql_group_totals(f))
return 
sql_error(sql, 02, SQLSTATE(42000) "GROUP BY: grouping expressions not possible 
with ROLLUP, CUBE and GROUPING SETS");
-   if 
(!frame_push_groupby_expression(sql, grp, e))
+   if (!exp_has_rel(e) && 
!frame_push_groupby_expression(sql, grp, e))
return NULL;
}
list_append(next_tuple, e);
diff --git a/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test 
b/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test
--- a/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test
+++ b/sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test
@@ -3,7 +3,6 @@ SELECT ( WITH x AS ( SELECT 1 x ) SELECT
 
 NULL
 
-skipif knownfail
 query I nosort
 SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x ) WHERE x 
NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY ( SELECT 1 ) ) )
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - handle aggregates with variable number of arg...

2024-04-13 Thread Niels Nes via checkin-list
Changeset: bc3b13d59fc0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bc3b13d59fc0
Added Files:
sql/test/BugTracker-2023/Tests/aggregate-vararg.Bug-7422.test
Modified Files:
sql/server/rel_select.c
sql/test/BugTracker-2023/Tests/All
sql/test/BugTracker-2023/Tests/SingleServer
Branch: Dec2023
Log Message:

handle aggregates with variable number of arguments, fixes bug #7422
Also added a test


diffs (51 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4099,7 +4099,8 @@ static sql_exp *
found = true; /* something was found */
} else {
a = sf;
-   exps = nexps;
+   if (!sf->func->vararg)
+   exps = nexps;
}
}
} else {
diff --git a/sql/test/BugTracker-2023/Tests/All 
b/sql/test/BugTracker-2023/Tests/All
--- a/sql/test/BugTracker-2023/Tests/All
+++ b/sql/test/BugTracker-2023/Tests/All
@@ -22,3 +22,4 @@ insert-delete-insert-crash-7415
 orderby-debug-crash-7416
 newurl-issue-7417
 rel_order_by-assertion-7418
+HAVE_LIBPY3?aggregate-vararg.Bug-7422
diff --git a/sql/test/BugTracker-2023/Tests/SingleServer 
b/sql/test/BugTracker-2023/Tests/SingleServer
--- a/sql/test/BugTracker-2023/Tests/SingleServer
+++ b/sql/test/BugTracker-2023/Tests/SingleServer
@@ -0,0 +1,1 @@
+--set embedded_py=3
diff --git a/sql/test/BugTracker-2023/Tests/aggregate-vararg.Bug-7422.test 
b/sql/test/BugTracker-2023/Tests/aggregate-vararg.Bug-7422.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2023/Tests/aggregate-vararg.Bug-7422.test
@@ -0,0 +1,20 @@
+statement ok
+CREATE OR REPLACE AGGREGATE python_aggregate (*)
+RETURNS INTEGER
+LANGUAGE PYTHON
+{
+try:
+   unique = numpy.unique(aggr_group)
+   x = numpy.zeros(shape=(unique.size))
+   for i in range(0, unique.size):
+   x[i] = numpy.sum(val[aggr_group==unique[i]])
+except NameError:
+# aggr_group doesn't exist. no groups, aggregate on all data
+   x = numpy.sum(arg2)
+return (x)
+}
+
+query I nosort
+select python_aggregate(5,2);
+
+2
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - merged

2024-04-13 Thread Niels Nes via checkin-list
Changeset: c49727ef7caa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c49727ef7caa
Branch: Dec2023
Log Message:

merged


diffs (truncated from 965 to 300 lines):

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 11.49.6
+current_version = 11.49.8
 commit = False
 tag = False
 
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -823,3 +823,4 @@ 1230526af30f40eeea30fb87c47c3e414920561f
 95d8feaa1167b5ba87bd99253c3f4e62ebf528a1 Dec2023_3
 dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_5
 dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_SP1_release
+d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_7
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -9,7 +9,7 @@
 # Copyright 1997 - July 2008 CWI.
 
 %global name MonetDB
-%global version 11.49.6
+%global version 11.49.8
 %{!?buildno: %global buildno %(date +%Y%m%d)}
 
 # Use bcond_with to add a --with option; i.e., "without" is default.
@@ -91,7 +91,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/Dec2023-SP1/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP2/%{name}-%{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
@@ -922,6 +922,31 @@ fi
 %endif
 
 %changelog
+* Tue Apr 09 2024 Sjoerd Mullender  - 11.49.7-20240409
+- Rebuilt.
+- GH#7469: Crash when using `CONTAINS`
+- GH#7479: MonetDB server crashes in `exp_ref`
+- GH#7490: commonTerms optimizer no longer works
+- GH#7495: Crash when simultaneously querying and updating a string column.
+
+* Thu Mar 28 2024 Sjoerd Mullender  - 11.49.7-20240409
+- gdk: Threads have their own list of free bats.  The list was not returned
+  to the system when a thread exited, meaning that the free bats that
+  were in the list would not be reused by any thread.  This has been
+  fixed.
+
+* Tue Mar 19 2024 Sjoerd Mullender  - 11.49.7-20240409
+- monetdb5: Fixed interaction between mserver5 and remote mserver5 when only 
one
+  of the two has 128 bit integer support.
+
+* Tue Mar 19 2024 Sjoerd Mullender  - 11.49.7-20240409
+- sql: Fixed issue where equal column aliases were created. When those
+  aliases were parsed on the remote side it could give crashes.
+
+* Mon Mar 18 2024 Sjoerd Mullender  - 11.49.7-20240409
+- gdk: Fixed a couple of deadlock situations, one actually observed, one
+  never observed.
+
 * Tue Mar 12 2024 Sjoerd Mullender  - 11.49.5-20240312
 - Rebuilt.
 - GH#7390: Some MonetDB Server crashes found
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,49,6)
-  PRODUCTVERSION version(11,49,6)
+  FILEVERSION version(11,49,8)
+  PRODUCTVERSION version(11,49,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,49,6)
+  VALUE "FileVersion", sversion(11,49,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,49,6)
+  VALUE "ProductVersion", sversion(11,49,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,49,6)
-  PRODUCTVERSION version(11,49,6)
+  FILEVERSION version(11,49,8)
+  PRODUCTVERSION version(11,49,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,49,6)
+  VALUE "FileVersion", sversion(11,49,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 SQL Server\0"
-  

MonetDB: Dec2023 - add missing set_selfref fixes bug #7496

2024-04-13 Thread Niels Nes via checkin-list
Changeset: 10974c00a23d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/10974c00a23d
Modified Files:
sql/server/rel_optimize_proj.c
Branch: Dec2023
Log Message:

add missing set_selfref fixes bug #7496


diffs (11 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
@@ -1370,6 +1370,7 @@ rel_project_cse(visitor *v, sql_rel *rel
sql_exp *ne = 
exp_alias(v->sql->sa, exp_relname(e1), exp_name(e1), exp_relname(e2), 
exp_name(e2), exp_subtype(e2), e2->card, has_nil(e2), is_unique(e2), 
is_intern(e1));
 
ne = exp_propagate(v->sql->sa, 
ne, e1);
+   set_selfref(ne);
exp_prop_alias(v->sql->sa, ne, 
e1);
e1 = ne;
break;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - return null and cleanup instead of asserts

2024-04-10 Thread Niels Nes via checkin-list
Changeset: a690a976581c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a690a976581c
Modified Files:
sql/storage/bat/bat_storage.c
Branch: default
Log Message:

return null and cleanup instead of asserts


diffs (51 lines):

diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -1136,7 +1136,8 @@ dict_append_bat(sql_trans *tr, sql_delta
return NULL;
BUN max_cnt = (BATcount(u) < 256)?256:64*1024;
if (DICTprepare4append(, i, u) < 0) {
-   assert(0);
+   bat_destroy(u);
+   return NULL;
} else {
int new = 0;
/* returns new offset bat (ie to be appended), possibly with 
larger type ! */
@@ -1255,7 +1256,8 @@ for_append_bat(column_storage *cs, BAT *
return NULL;
 
if (FORprepare4append(, i, offsetval, b->ttype) < 0) {
-   assert(0);
+   bat_destroy(b);
+   return NULL;
} else {
/* returns new offset bat if values within min/max, else 
decompress */
if (!newoffsets) { /* decompress */
@@ -1707,7 +1709,8 @@ dict_append_val(sql_trans *tr, sql_delta
return NULL;
BUN max_cnt = (BATcount(u) < 256)?256:64*1024;
if (DICTprepare4append_vals(, i, cnt, u) < 0) {
-   assert(0);
+   bat_destroy(u);
+   return NULL;
} else {
int new = 0;
/* returns new offset bat (ie to be appended), possibly with 
larger type ! */
@@ -1810,7 +1813,8 @@ for_append_val(column_storage *cs, void 
return NULL;
 
if (FORprepare4append_vals(, i, cnt, offsetval, tt, 
b->ttype) < 0) {
-   assert(0);
+   bat_destroy(b);
+   return NULL;
} else {
/* returns new offset bat if values within min/max, else 
decompress */
if (!newoffsets) {
@@ -4348,7 +4352,6 @@ static storage *
 savepoint_commit_storage( storage *dbat, ulng commit_ts)
 {
if (dbat && dbat->cs.ts == commit_ts && dbat->next) {
-   assert(0);
storage *od = dbat->next;
if (od->cs.ts == commit_ts) {
storage t = *od, *n = od->next;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - no more TYPE_bat

2024-04-10 Thread Niels Nes via checkin-list
Changeset: 430e06cc7ace for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/430e06cc7ace
Modified Files:
monetdb5/optimizer/opt_for.c
Branch: default
Log Message:

no more TYPE_bat


diffs (33 lines):

diff --git a/monetdb5/optimizer/opt_for.c b/monetdb5/optimizer/opt_for.c
--- a/monetdb5/optimizer/opt_for.c
+++ b/monetdb5/optimizer/opt_for.c
@@ -15,9 +15,9 @@
 
 #if 0
 static InstrPtr
-ReplaceWithNil(MalBlkPtr mb, InstrPtr p, int pos, int tpe)
+ReplaceWithNil(MalBlkPtr mb, InstrPtr p, int pos)
 {
-   p = pushNil(mb, p, tpe);/* push at end */
+   p = pushNilBat(mb, p);  /* push at end */
getArg(p, pos) = getArg(p, p->argc - 1);
p->argc--;
return p;
@@ -239,7 +239,7 @@ OPTforImplementation(Client cntxt, MalBl
}
getArg(r, j) = vardictvalue[k];
if (cand)
-   r = ReplaceWithNil(mb, r, j + 
1, TYPE_bat); /* no candidate list */
+   r = ReplaceWithNil(mb, r, j + 
1);   /* no candidate list */
pushInstruction(mb, r);
 
int tpe = getVarType(mb, varisdict[k]);
@@ -263,7 +263,7 @@ OPTforImplementation(Client cntxt, MalBl
t = pushArgument(mb, t, varisdict[k]);
t = pushArgument(mb, t, getArg(s, 0));
t = pushArgument(mb, t, cand);
-   t = pushNil(mb, t, TYPE_bat);
+   t = pushNilBat(mb, t);
t = pushBit(mb, t, TRUE);   /* nil 
matches */
t = pushBit(mb, t, TRUE);   /* 
max_one */
t = pushNil(mb, t, TYPE_lng);   /* 
estimate */
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


  1   2   3   4   5   6   7   8   9   10   >