MonetDB: default - Merge with Dec2023 branch.

2024-05-17 Thread Sjoerd Mullender via checkin-list
Changeset: 8a06076b4de2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8a06076b4de2
Modified Files:
gdk/gdk_logger.c
monetdb5/modules/mal/mal_mapi.c
sql/backends/monet5/sql.c
sql/server/rel_optimize_proj.c
sql/server/rel_select.c
sql/storage/bat/bat_storage.c
sql/storage/store.c
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (165 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -3458,6 +3458,12 @@ log_tstart(logger *lg, bool flushnow, ul
 {
rotation_lock(lg);
if (flushnow) {
+   if (file_id == NULL) {
+   /* special case: ask store_manager to rotate log file */
+   lg->file_age = 0;
+   rotation_unlock(lg);
+   return GDK_SUCCEED;
+   }
/* I am now the exclusive flusher */
if (ATOMIC_GET(>nr_flushers)) {
/* I am waiting until all existing flushers are done */
@@ -3512,7 +3518,6 @@ log_printinfo(logger *lg)
rotation_lock(lg);
printf("current log file "ULLFMT", last handled log file "ULLFMT"\n",
   lg->id, lg->saved_id);
-   rotation_unlock(lg);
printf("current transaction id %d, saved transaction id %d\n",
   lg->tid, lg->saved_tid);
printf("number of flushers: %d\n", (int) ATOMIC_GET(>nr_flushers));
@@ -3525,4 +3530,5 @@ log_printinfo(logger *lg)
buf[0] = 0;
printf("pending range "ULLFMT": drops %"PRIu64", last_ts 
%"PRIu64", flushed_ts %"PRIu64", refcount %"PRIu64"%s%s\n", p->id, (uint64_t) 
ATOMIC_GET(>drops), (uint64_t) ATOMIC_GET(>last_ts), (uint64_t) 
ATOMIC_GET(>flushed_ts), (uint64_t) ATOMIC_GET(>refcount), buf, p == 
lg->current ? " (current)" : "");
}
+   rotation_unlock(lg);
 }
diff --git a/monetdb5/modules/atoms/xml.c b/monetdb5/modules/atoms/xml.c
--- a/monetdb5/modules/atoms/xml.c
+++ b/monetdb5/modules/atoms/xml.c
@@ -735,9 +735,9 @@ XMLxml2str(str *s, const xml *x)
 }
 
 str
-XMLstr2xml(xml *x, const char **s)
+XMLstr2xml(xml *x, const char *const*val)
 {
-   (void) s;
+   (void) val;
(void) x;
return createException(MAL, "xml.xml2str", SQLSTATE(HY005) 
NO_LIBXML_FATAL);
 }
diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -527,7 +527,7 @@ start_listen(SOCKET *sockp, int *portp, 
hints.ai_family = AF_INET6;
ipv6_vs6only = 0;
}
-   char sport[8];  /* max "65535" */
+   char sport[16]; /* max "65535", but compiler 
doesn't know */
snprintf(sport, sizeof(sport), "%d", *portp);
for (;;) {  /* max twice */
int check = getaddrinfo(listenaddr, sport, , );
diff --git a/sql/ChangeLog.Dec2023 b/sql/ChangeLog.Dec2023
--- a/sql/ChangeLog.Dec2023
+++ b/sql/ChangeLog.Dec2023
@@ -1,3 +1,12 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
+* Wed May 15 2024 Sjoerd Mullender 
+- When sys.persist_unlogged is called for a table, it may return that
+  zero rows were persisted.  If this is because the call was done too
+  early, i.e. the table was recently created and the write-ahead log
+  where this was logged has not been processed yet, the call will
+  request an immediate write-ahead log rotation.  This means that the
+  WAL will be processed as soon as possible and a new call to
+  sys.persist_unlogged soon after will likely return a positive result.
+
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
@@ -4471,6 +4471,16 @@ SQLpersist_unlogged(Client cntxt, MalBlk
GDKfree(sizes);
}
count = d_bi.count;
+   } else {
+   /* special case of log_tstart: third arg == NULL with second arg
+* true is request to rotate log file ASAP */
+   store->logger_api.log_tstart(store, true, NULL);
+   /* special case for sql->debug: if 1024 bit is set,
+* store_manager doesn't wait for 30 seconds of idle time before
+* attempting to rotate */
+   MT_lock_set(>flush);
+   store->debug |= 1024;
+   MT_lock_unset(>flush);
}
 
bat_iterator_end(_bi);
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
@@ -907,7 +907,7 @@ rel_split_project_(visitor *v, sql_rel *
}
if (is_set(rel->op) || is_basetable(rel->op))
return rel;
-   if (rel->l) {
+   if (rel->l && (rel->op != op_table || rel->flag != 

MonetDB: Dec2023 - UNLOGGED tables do have to be logged when the...

2024-05-17 Thread Sjoerd Mullender via checkin-list
Changeset: 1cc64810035e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1cc64810035e
Modified Files:
sql/storage/bat/bat_storage.c
Branch: Dec2023
Log Message:

UNLOGGED tables do have to be logged when they are dropped.
Fixes #7517.


diffs (30 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
@@ -3734,7 +3734,7 @@ drop_del(sql_trans *tr, sql_table *t)
 
if (!isNew(t)) {
storage *bat = ATOMIC_PTR_GET(>data);
-   trans_add_obj(tr, >base, bat, _gc_del, 
_destroy_del, NOT_TO_BE_LOGGED(t) ? NULL : _destroy_del);
+   trans_add_obj(tr, >base, bat, _gc_del, 
_destroy_del, isTempTable(t) ? NULL : _destroy_del);
}
return ok;
 }
@@ -3744,7 +3744,7 @@ drop_col(sql_trans *tr, sql_column *c)
 {
assert(!isNew(c));
sql_delta *d = ATOMIC_PTR_GET(>data);
-   trans_add(tr, >base, d, _gc_col, _destroy_del, 
NOT_TO_BE_LOGGED(c->t) ? NULL : _destroy_col);
+   trans_add(tr, >base, d, _gc_col, _destroy_del, 
isTempTable(c->t) ? NULL : _destroy_col);
return LOG_OK;
 }
 
@@ -3753,7 +3753,7 @@ drop_idx(sql_trans *tr, sql_idx *i)
 {
assert(!isNew(i));
sql_delta *d = ATOMIC_PTR_GET(>data);
-   trans_add(tr, >base, d, _gc_idx, _destroy_del, 
NOT_TO_BE_LOGGED(i->t) ? NULL : _destroy_idx);
+   trans_add(tr, >base, d, _gc_idx, _destroy_del, 
isTempTable(i->t) ? NULL : _destroy_idx);
return LOG_OK;
 }
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Compiler doesn't know we're only formatting a...

2024-05-17 Thread Sjoerd Mullender via checkin-list
Changeset: 387817f692f7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/387817f692f7
Modified Files:
monetdb5/modules/mal/mal_mapi.c
Branch: Dec2023
Log Message:

Compiler doesn't know we're only formatting an unsigned short value.


diffs (12 lines):

diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -525,7 +525,7 @@ start_listen(SOCKET *sockp, int *portp, 
hints.ai_family = AF_INET6;
ipv6_vs6only = 0;
}
-   char sport[8];  /* max "65535" */
+   char sport[16]; /* max "65535", but compiler 
doesn't know */
snprintf(sport, sizeof(sport), "%d", *portp);
for (;;) {  /* max twice */
int check = getaddrinfo(listenaddr, sport, , );
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Approve tests.

2024-05-17 Thread Sjoerd Mullender via checkin-list
Changeset: d5c6125facb1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d5c6125facb1
Modified Files:
sql/backends/monet5/generator/Tests/generator03.test
Branch: default
Log Message:

Approve tests.


diffs (27 lines):

diff --git a/sql/backends/monet5/generator/Tests/generator03.test 
b/sql/backends/monet5/generator/Tests/generator03.test
--- a/sql/backends/monet5/generator/Tests/generator03.test
+++ b/sql/backends/monet5/generator/Tests/generator03.test
@@ -22,6 +22,7 @@ 2008-03-02 16:00:00
 2008-03-03 02:00:00
 2008-03-03 12:00:00
 2008-03-03 22:00:00
+2008-03-04 08:00:00
 
 query T rowsort
 select * from generate_series(
@@ -32,6 +33,7 @@ select * from generate_series(
 2008-03-01 00:00:00
 2008-03-02 00:00:00
 2008-03-03 00:00:00
+2008-03-04 00:00:00
 
 query T rowsort
 select * from generate_series(
@@ -39,6 +41,7 @@ select * from generate_series(
timestamp '2008-03-01 00:00',
cast( '-1' as interval day))
 
+2008-03-01 12:00:00
 2008-03-02 12:00:00
 2008-03-03 12:00:00
 2008-03-04 12:00:00
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Don't make output BAT too large.

2024-05-17 Thread Sjoerd Mullender via checkin-list
Changeset: c6b24bb1671a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c6b24bb1671a
Modified Files:
sql/backends/monet5/generator/generator.c
Branch: default
Log Message:

Don't make output BAT too large.


diffs (39 lines):

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
@@ -248,7 +248,8 @@ VLTgenerator_table_(BAT **result, Client
if (bn == NULL)
throw(MAL, "generator.table", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
v = (date *) Tloc(bn, 0);
-   for (BUN c = 0; c < n && f < l; c++) {
+   BUN c;
+   for (c = 0; c < n && f < l; c++) {
*v++ = f;
f = date_add_month(f, s);
if (is_date_nil(f)) {
@@ -256,6 +257,7 @@ VLTgenerator_table_(BAT **result, Client
throw(MAL, "generator.table", 
SQLSTATE(22003) "overflow in calculation");
}
}
+   n = c;
bn->tsorted = s > 0 || n <= 1;
bn->trevsorted = s < 0 || n <= 1;
} else if (tpe == TYPE_date) { /* days */
@@ -282,7 +284,8 @@ VLTgenerator_table_(BAT **result, Client
if (bn == NULL)
throw(MAL, "generator.table", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
v = (date *) Tloc(bn, 0);
-   for (BUN c = 0; c < n && f < l; c++) {
+   BUN c;
+   for (c = 0; c < n && f < l; c++) {
*v++ = f;
f = date_add_day(f, (int) s);
if (is_date_nil(f)) {
@@ -290,6 +293,7 @@ VLTgenerator_table_(BAT **result, Client
throw(MAL, "generator.table", 
SQLSTATE(22003) "overflow in calculation");
}
}
+   n = c;
bn->tsorted = s > 0 || n <= 1;
bn->trevsorted = s < 0 || n <= 1;
} else if (tpe == TYPE_timestamp) {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Don't shadow variable.

2024-05-17 Thread Sjoerd Mullender via checkin-list
Changeset: b175905caa97 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b175905caa97
Modified Files:
sql/backends/monet5/generator/generator.c
Branch: default
Log Message:

Don't shadow variable.


diffs (12 lines):

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
@@ -176,7 +176,7 @@ VLTgenerator_noop(Client cntxt, MalBlkPt
if (s == 0 || (s > 0 && f > l) || (s < 0 && f < l) || 
is_##TPE##_nil(f) || is_##TPE##_nil(l)) \
throw(MAL, "generator.table",   
\
  SQLSTATE(42000) "Illegal generator range");   
\
-   BUN n = (BUN) ((l - f) / s);
\
+   n = (BUN) ((l - f) / s);
\
if ((TPE) (n * s + f) != l) 
\
n++;
\
bn = COLnew(0, TYPE_##TPE, n, TRANSIENT);   
\
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Do not recurse if we're dealing with a trigge...

2024-05-16 Thread Sjoerd Mullender via checkin-list
Changeset: 3b20ed670167 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3b20ed670167
Modified Files:
sql/server/rel_optimize_proj.c
Branch: Dec2023
Log Message:

Do not recurse if we're dealing with a trigger wrapper.


diffs (12 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
@@ -907,7 +907,7 @@ rel_split_project_(visitor *v, sql_rel *
}
if (is_set(rel->op) || is_basetable(rel->op))
return rel;
-   if (rel->l) {
+   if (rel->l && (rel->op != op_table || rel->flag != TRIGGER_WRAPPER)) {
rel->l = rel_split_project_(v, rel->l, 
(is_topn(rel->op)||is_sample(rel->op)||is_ddl(rel->op)||is_modify(rel->op))?top:0);
if (!rel->l)
return NULL;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Niels says, we need to dup some pointers (lik...

2024-05-16 Thread Sjoerd Mullender via checkin-list
Changeset: d96c23f0856d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d96c23f0856d
Modified Files:
sql/server/rel_select.c
Branch: Dec2023
Log Message:

Niels says, we need to dup some pointers (like in the other case in this file).


diffs (15 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
@@ -1404,9 +1404,9 @@ rel_column_ref(sql_query *query, sql_rel
return sql_error(sql, ERR_AMBIGUOUS, 
SQLSTATE(42000) "SELECT: identifier '%s.%s' ambiguous", tname, cname);
if (v && !exp) {
if (*rel)
-   *rel = rel_crossproduct(sql->sa, *rel, 
v, op_join);
+   *rel = rel_crossproduct(sql->sa, *rel, 
rel_dup(v), op_join);
else
-   *rel = v;
+   *rel = rel_dup(v);
if (!(exp = rel_bind_column3(sql, *rel, sname, 
tname, cname, f)) && sql->session->status == -ERR_AMBIGUOUS)
return NULL;
}
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Improved overflow check when materializing ge...

2024-05-16 Thread Sjoerd Mullender via checkin-list
Changeset: e662b1463c8e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e662b1463c8e
Modified Files:
sql/backends/monet5/generator/generator.c
Branch: default
Log Message:

Improved overflow check when materializing generator series.


diffs (258 lines):

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;
\
+   else
\
+   s =  *getArgReference_##TPE(stk,pci, 3);
\
+   if (s == 0 || is_##TPE##_nil(f) || is_##TPE##_nil(l) || 
is_##TPE##_nil(s)) \
throw(MAL, "generator.table",   
\
  SQLSTATE(42000) "Illegal 

MonetDB: default - In Debian build, remove files from versioned ...

2024-05-16 Thread Sjoerd Mullender via checkin-list
Changeset: 6504d15c154f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6504d15c154f
Modified Files:
debian/rules
Branch: default
Log Message:

In Debian build, remove files from versioned directory.


diffs (16 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
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Compilation issue when compiling without XML ...

2024-05-15 Thread Sjoerd Mullender via checkin-list
Changeset: d0d83af809d1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d0d83af809d1
Modified Files:
monetdb5/modules/atoms/xml.c
Branch: Dec2023
Log Message:

Compilation issue when compiling without XML support.


diffs (15 lines):

diff --git a/monetdb5/modules/atoms/xml.c b/monetdb5/modules/atoms/xml.c
--- a/monetdb5/modules/atoms/xml.c
+++ b/monetdb5/modules/atoms/xml.c
@@ -735,9 +735,9 @@ XMLxml2str(str *s, const xml *x)
 }
 
 str
-XMLstr2xml(xml *x, const char **s)
+XMLstr2xml(xml *x, const char *const*val)
 {
-   (void) s;
+   (void) val;
(void) x;
return createException(MAL, "xml.xml2str", SQLSTATE(HY005) 
NO_LIBXML_FATAL);
 }
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - When persiste_unlogged finds table is not yet...

2024-05-15 Thread Sjoerd Mullender via checkin-list
Changeset: d3f43b823539 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d3f43b823539
Modified Files:
gdk/gdk_logger.c
sql/ChangeLog.Dec2023
sql/backends/monet5/sql.c
sql/storage/store.c
Branch: Dec2023
Log Message:

When persiste_unlogged finds table is not yet persistent, it requests log 
rotation.


diffs (67 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -3474,6 +3474,12 @@ log_tstart(logger *lg, bool flushnow, ul
 {
rotation_lock(lg);
if (flushnow) {
+   if (file_id == NULL) {
+   /* special case: ask store_manager to rotate log file */
+   lg->file_age = 0;
+   rotation_unlock(lg);
+   return GDK_SUCCEED;
+   }
/* I am now the exclusive flusher */
if (ATOMIC_GET(>nr_flushers)) {
/* I am waiting until all existing flushers are done */
diff --git a/sql/ChangeLog.Dec2023 b/sql/ChangeLog.Dec2023
--- a/sql/ChangeLog.Dec2023
+++ b/sql/ChangeLog.Dec2023
@@ -1,3 +1,12 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
+* Wed May 15 2024 Sjoerd Mullender 
+- When sys.persist_unlogged is called for a table, it may return that
+  zero rows were persisted.  If this is because the call was done too
+  early, i.e. the table was recently created and the write-ahead log
+  where this was logged has not been processed yet, the call will
+  request an immediate write-ahead log rotation.  This means that the
+  WAL will be processed as soon as possible and a new call to
+  sys.persist_unlogged soon after will likely return a positive result.
+
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
@@ -4436,6 +4436,16 @@ SQLpersist_unlogged(Client cntxt, MalBlk
GDKfree(sizes);
}
count = d_bi.count;
+   } else {
+   /* special case of log_tstart: third arg == NULL with second arg
+* true is request to rotate log file ASAP */
+   store->logger_api.log_tstart(store, true, NULL);
+   /* special case for sql->debug: if 1024 bit is set,
+* store_manager doesn't wait for 30 seconds of idle time before
+* attempting to rotate */
+   MT_lock_set(>flush);
+   store->debug |= 1024;
+   MT_lock_unset(>flush);
}
 
bat_iterator_end(_bi);
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -2420,7 +2420,10 @@ store_manager(sqlstore *store)
 
for (;;) {
const int idle = ATOMIC_GET() & FORCEMITOMASK ? 5000 : 
IDLE_TIME * 100;
-   if (store->debug&128 || ATOMIC_GET(>lastactive) + idle < 
(ATOMIC_BASE_TYPE) GDKusec()) {
+   /* if debug bit 1024 is set, attempt immediate log activation
+* and clear the bit */
+   if (store->debug&(128|1024) || ATOMIC_GET(>lastactive) + 
idle < (ATOMIC_BASE_TYPE) GDKusec()) {
+   store->debug &= ~1024;
MT_lock_unset(>flush);
store_lock(store);
if (ATOMIC_GET(>nr_active) == 0) {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Use clever UTF-8 decode function and put it i...

2024-05-15 Thread Sjoerd Mullender via checkin-list
Changeset: 48eb20c82ba6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/48eb20c82ba6
Added Files:
common/utils/mutf8.c
common/utils/mutf8.h
Modified Files:
clients/mapiclient/CMakeLists.txt
clients/mapiclient/mclient.c
common/utils/CMakeLists.txt
monetdb5/modules/atoms/CMakeLists.txt
monetdb5/modules/atoms/str.c
monetdb5/modules/mal/CMakeLists.txt
monetdb5/modules/mal/txtsim.c
monetdb5/tools/CMakeLists.txt
Branch: default
Log Message:

Use clever UTF-8 decode function and put it in a central location.


diffs (truncated from 1182 to 300 lines):

diff --git a/clients/mapiclient/CMakeLists.txt 
b/clients/mapiclient/CMakeLists.txt
--- a/clients/mapiclient/CMakeLists.txt
+++ b/clients/mapiclient/CMakeLists.txt
@@ -54,6 +54,7 @@ target_link_libraries(mclient
   mprompt
   moptions
   mutils
+  mutf8
   mapi
   stream
   $<$:Readline::Readline>
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -169,53 +169,7 @@ static char *nullstring = default_nullst
 
 #include 
 #include "mhelp.h"
-
-/* The code starting here, and up to and including the function decode
- * below are copyright Bjoern Hoehrmann per the below notice.
- *
- * The function decode provides a fast way to check for valid UTF-8
- * sequences and returns the value of the codepoint as well.  */
-
-// Copyright (c) 2008-2009 Bjoern Hoehrmann 
-// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
-
-#define UTF8_ACCEPT 0
-#define UTF8_REJECT 12
-
-static const uint8_t utf8d[] = {
-   // The first part of the table maps bytes to character classes that
-   // to reduce the size of the transition table and create bitmasks.
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
-7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
-8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
-   10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
-
-   // The second part is a transition table that maps a combination
-   // of a state of the automaton and a character class to a state.
-0,12,24,36,60,96,84,12,12,12,48,72, 
12,12,12,12,12,12,12,12,12,12,12,12,
-   12, 0,12,12,12,12,12, 0,12, 0,12,12, 
12,24,12,12,12,12,12,24,12,24,12,12,
-   12,12,12,12,12,12,12,24,12,12,12,12, 
12,24,12,12,12,12,12,12,12,24,12,12,
-   12,12,12,12,12,12,12,36,12,36,12,12, 
12,36,12,12,12,12,12,36,12,36,12,12,
-   12,36,12,12,12,12,12,12,12,12,12,12,
-};
-
-static inline uint32_t
-decode(uint32_t *state, uint32_t *codep, uint32_t byte)
-{
-   uint32_t type = utf8d[byte];
-
-   *codep = (*state != UTF8_ACCEPT) ?
-   (byte & 0x3fu) | (*codep << 6) :
-   (0xff >> type) & (byte);
-
-   *state = utf8d[256 + *state + type];
-   return *state;
-}
-/* end code copyright by Bjoern Hoehrmann */
+#include "mutf8.h"
 
 static timertype
 gettime(void)
@@ -366,217 +320,6 @@ timerHuman(int64_t sqloptimizer, int64_t
return;
 }
 
-struct interval {
-   uint32_t first;
-   uint32_t last;
-   int width;
-};
-
-static const struct interval intervals[] = {
-   /* sorted list of non-overlapping ranges;
-* ranges with width==0 represent all codepoints with
-* general_category Me, Mn or Cf except U+00AD (SOFT HYPHEN), all
-* codepoints \U+1160 through U+11FF (Hangul Jamo medial vowels and
-* final consonants) -- see
-* https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c from which this is
-* derived;
-* ranges with width==2 represent all codepoints in the East Asian
-* Wide (W) or East Asian Full-width (F) category as defined in the
-* EastAsianWidth.txt file;
-* also see monetdb5/modules/atoms/str.c which has a copy of this */
-   { 0x0300, 0x036F, 0 }, { 0x0483, 0x0489, 0 }, { 0x0591, 0x05BD, 0 },
-   { 0x05BF, 0x05BF, 0 }, { 0x05C1, 0x05C2, 0 }, { 0x05C4, 0x05C5, 0 },
-   { 0x05C7, 0x05C7, 0 }, { 0x0600, 0x0605, 0 }, { 0x0610, 0x061A, 0 },
-   { 0x061C, 0x061C, 0 }, { 0x064B, 0x065F, 0 }, { 0x0670, 0x0670, 0 },
-   { 0x06D6, 0x06DD, 0 }, { 0x06DF, 0x06E4, 0 }, { 0x06E7, 0x06E8, 0 },
-   { 0x06EA, 0x06ED, 0 }, { 0x070F, 0x070F, 0 }, { 0x0711, 0x0711, 0 },
-   { 0x0730, 0x074A, 0 }, { 0x07A6, 0x07B0, 0 }, { 0x07EB, 0x07F3, 0 },
-   { 0x07FD, 0x07FD, 0 }, { 0x0816, 0x0819, 0 }, { 0x081B, 0x0823, 0 },
-   { 0x0825, 0x0827, 0 }, { 0x0829, 0x082D, 0 }, { 0x0859, 0x085B, 0 },
-   { 0x0890, 0x0891, 0 }, { 0x0898, 0x089F, 0 }, 

MonetDB: Dec2023 - Keep rotation lock for the duration of printi...

2024-05-15 Thread Sjoerd Mullender via checkin-list
Changeset: 32a1eb24e340 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/32a1eb24e340
Modified Files:
gdk/gdk_logger.c
Branch: Dec2023
Log Message:

Keep rotation lock for the duration of printing log info with SIGUSR1.


diffs (17 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -3528,7 +3528,6 @@ log_printinfo(logger *lg)
rotation_lock(lg);
printf("current log file "ULLFMT", last handled log file "ULLFMT"\n",
   lg->id, lg->saved_id);
-   rotation_unlock(lg);
printf("current transaction id %d, saved transaction id %d\n",
   lg->tid, lg->saved_tid);
printf("number of flushers: %d\n", (int) ATOMIC_GET(>nr_flushers));
@@ -3541,4 +3540,5 @@ log_printinfo(logger *lg)
buf[0] = 0;
printf("pending range "ULLFMT": drops %"PRIu64", last_ts 
%"PRIu64", flushed_ts %"PRIu64", refcount %"PRIu64"%s%s\n", p->id, (uint64_t) 
ATOMIC_GET(>drops), (uint64_t) ATOMIC_GET(>last_ts), (uint64_t) 
ATOMIC_GET(>flushed_ts), (uint64_t) ATOMIC_GET(>refcount), buf, p == 
lg->current ? " (current)" : "");
}
+   rotation_unlock(lg);
 }
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Fix tiny memory leak.

2024-05-15 Thread Sjoerd Mullender via checkin-list
Changeset: b93871d52277 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b93871d52277
Modified Files:
clients/mapiclient/iconv-stream.h
Branch: default
Log Message:

Fix tiny memory leak.


diffs (18 lines):

diff --git a/clients/mapiclient/iconv-stream.h 
b/clients/mapiclient/iconv-stream.h
--- a/clients/mapiclient/iconv-stream.h
+++ b/clients/mapiclient/iconv-stream.h
@@ -195,12 +195,14 @@ ic_close(void *private)
if (ic->cd != (iconv_t) -1)
iconv_close(ic->cd);
ic->cd = (iconv_t) -1;
+   mnstr_close(ic->s);
 }
 
 static void
 ic_destroy(void *private)
 {
ic_close(private);
+   mnstr_destroy(((struct ic_priv_t *) private)->s);
free(private);
 }
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Approve non-hge tests.

2024-05-15 Thread Sjoerd Mullender via checkin-list
Changeset: 60b8d7104db5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/60b8d7104db5
Modified Files:
clients/Tests/MAL-signatures.test
sql/test/emptydb/Tests/check.stable.out
Branch: default
Log Message:

Approve non-hge tests.


diffs (99 lines):

diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -33510,6 +33510,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)
@@ -33570,6 +33580,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)
@@ -33610,6 +33625,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)
@@ -33680,6 +33705,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)
@@ -33740,6 +33775,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)
diff --git a/sql/test/emptydb/Tests/check.stable.out 
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -1693,7 +1693,7 @@ select 'null in fkeys.delete_action', de
 % .%1, .s, .f, .,  .,  .f, .fl,.,  .f, .f, 
.f, .f, .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  . # table_name
 % %1,  name,   name,   system, query,  mod,language_name,  func_type,  
side_effect,varres, vararg, semantics,  comment,name0,  type0,  
type_digits0,   type_scale0,inout0, name1,  type1,  type_digits1,   
type_scale1,inout1, name2,  type2,  type_digits2,   type_scale2,inout2, 
name3,  type3,  type_digits3,   type_scale3,inout3, name4,  type4,  
type_digits4,   type_scale4,inout4, name5,  type5,  type_digits5,   
type_scale5,inout5, name6,  type6,  type_digits6,   type_scale6,inout6, 
name7,  type7,  type_digits7,   type_scale7,inout7, name8,  type8,  
type_digits8,   type_scale8,inout8, name9,  type9,  type_digits9,   
type_scale9,inout9, name10, type10, type_digits10,  type_scale10,   
inout10,name11, type11, type_digits11,  type_scale11,   inout11,
name12, type12, type_digits12,  type_scale12,   inout12,name13, type13, 
type_digits13,  type_scale13,   inout13,name14, type14, type_digits14,  
type_scale14,   inout14,name15, type15, type_digits15,  type_scale15,   
inout15 # name
 % varchar, varchar,varchar,varchar,varchar,
varchar,varchar,varchar,boolean,boolean,
boolean,boolean,varchar,varchar,varchar, 

MonetDB: default - Merge with Dec2023 branch.

2024-05-14 Thread Sjoerd Mullender via checkin-list
Changeset: 1c9d7fbe4bc0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1c9d7fbe4bc0
Modified Files:
gdk/gdk_calc_convert.c
gdk/gdk_hash.c
monetdb5/optimizer/opt_mergetable.c
sql/backends/monet5/sql_upgrades.c

sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.SQL.py

sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (truncated from 650 to 300 lines):

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
@@ -821,6 +821,7 @@ convert_str_fix(BATiter *bi, int tp, voi
return 0;
}
 
+   int (*atomcmp)(const void *, const void *) = ATOMcompare(tp);
TIMEOUT_LOOP(ci->ncand, qry_ctx) {
oid x = canditer_next(ci) - candoff;
const char *s = BUNtvar(*bi, x);
@@ -834,7 +835,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
@@ -873,7 +873,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, qry_ctx) {
const void *restrict v = BUNtail(bi, o - 
b->hseqbase);
c = hash_any(h, v);
@@ -887,8 +888,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;
}
@@ -902,6 +902,7 @@ BAThash_impl(BAT *restrict b, struct can
  GOTO_LABEL_TIMEOUT_HANDLER(bailout, 
qry_ctx));
break;
}
+   }
TRC_DEBUG_IF(ACCELERATOR) if (p < cnt1)
TRC_DEBUG_ENDIF(ACCELERATOR,
"%s: abort starthash with "
@@ -949,7 +950,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, qry_ctx) {
const void *restrict v = BUNtail(bi, o - b->hseqbase);
c = hash_any(h, 

MonetDB: default - Remove assert. Fixes #7516.

2024-05-14 Thread Sjoerd Mullender via checkin-list
Changeset: 4316a7af79b3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4316a7af79b3
Modified Files:
sql/server/sql_semantic.c
Branch: default
Log Message:

Remove assert.  Fixes #7516.


diffs (11 lines):

diff --git a/sql/server/sql_semantic.c b/sql/server/sql_semantic.c
--- a/sql/server/sql_semantic.c
+++ b/sql/server/sql_semantic.c
@@ -121,7 +121,6 @@ tmp_schema(mvc *sql)
do { \
sql_schema *next = NULL; \
  \
-   assert(objstr); \
if (sname) { /* user has explicitly typed the schema, so either 
the object is there or we return error */ \
if (!(next = mvc_bind_schema(sql, sname))) \
return sql_error(sql, ERR_NOTFOUND, 
SQLSTATE(3F000) "%s: no such schema '%s'", error, sname); \
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Fix an old upgrade error where triggers were ...

2024-05-14 Thread Sjoerd Mullender via checkin-list
Changeset: ad9b188058a3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ad9b188058a3
Modified Files:
sql/backends/monet5/sql_upgrades.c
sql/test/emptydb-previous-upgrade-chain-hge/Tests/All

sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-chain/Tests/All
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/All
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.SQL.py

sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: Dec2023
Log Message:

Fix an old upgrade error where triggers were left with bad table_id values.


diffs (truncated from 436 to 300 lines):

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
@@ -6616,17 +6616,24 @@ sql_update_dec2023_sp4(Client c, mvc *sq
b = BATdescriptor(output->cols[0].b);
if (b) {
if (BATcount(b) > 0) {
-   const char query[] = "delete from sys.dependencies 
where (id, depend_id) in (select c.id, f.id from sys.functions f, sys._tables 
t, sys._columns c, sys.dependencies d where c.table_id = t.id and f.id = 
d.depend_id and c.id = d.id and f.schema_id = 2000 and t.schema_id = 2000 and 
(f.name, t.name, c.name) in (values ('describe_columns', '_columns', 
'storage'), ('describe_function', 'function_languages', 'language_name'), 
('describe_function', 'function_types', 'function_type_name'), 
('describe_function', 'functions', 'func'), ('describe_function', 'functions', 
'mod'), ('describe_function', 'functions', 'semantics'), ('describe_function', 
'functions', 'side_effect'), ('describe_function', 'functions', 'system'), 
('describe_function', 'functions', 'vararg'), ('describe_function', 
'functions', 'varres'), ('describe_function', 'schemas', 'authorization'), 
('describe_function', 'schemas', 'owner'), ('describe_function', 'schemas', 
'system'), ('describe_table', '_tables', 'access'), ('de
 scribe_table', '_tables', 'commit_action'), ('describe_table', '_tables', 
'system')));\n"
+   const char query[] =
+   "delete from sys.dependencies where (id, 
depend_id) in (select c.id, f.id from sys.functions f, sys._tables t, 
sys._columns c, sys.dependencies d where c.table_id = t.id and f.id = 
d.depend_id and c.id = d.id and f.schema_id = 2000 and t.schema_id = 2000 and 
(f.name, t.name, c.name) in (values ('describe_columns', '_columns', 
'storage'), ('describe_function', 'function_languages', 'language_name'), 
('describe_function', 'function_types', 'function_type_name'), 
('describe_function', 'functions', 'func'), ('describe_function', 'functions', 
'mod'), ('describe_function', 'functions', 'semantics'), ('describe_function', 
'functions', 'side_effect'), ('describe_function', 'functions', 'system'), 
('describe_function', 'functions', 'vararg'), ('describe_function', 
'functions', 'varres'), ('describe_function', 'schemas', 'authorization'), 
('describe_function', 'schemas', 'owner'), ('describe_function', 'schemas', 
'system'), ('describe_table', '_tables', 'access'), ('describe_table', '_tab
 les', 'commit_action'), ('describe_table', '_tables', 'system')));\n"
"delete from sys.dependencies where (id, 
depend_id) in (select c.id, v.id 

MonetDB: default - Turn constant pointers to constant string int...

2024-05-14 Thread Sjoerd Mullender via checkin-list
Changeset: dc85db7d9402 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/dc85db7d9402
Modified Files:
clients/mapiclient/dump.c
clients/odbc/winsetup/install.c
common/stream/stdio_stream.c
geom/monetdb5/geom.c
monetdb5/mal/mal_session.c
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_bincopy.c
sql/backends/monet5/sql_bincopyconvert.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/vaults/csv/csv.c
sql/server/sql_semantic.c
sql/storage/store.c
tools/monetdbe/monetdbe.c
Branch: default
Log Message:

Turn constant pointers to constant string into constant arrays.


diffs (truncated from 519 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -2654,9 +2654,9 @@ bailout:
 int
 dump_database(Mapi mid, stream *sqlf, const char *ddir, const char *ext, bool 
describe, bool useInserts, bool noescape)
 {
-   const char *start_trx = "START TRANSACTION";
-   const char *end = "ROLLBACK";
-   const char *types =
+   const char start_trx[] = "START TRANSACTION";
+   const char end[] = "ROLLBACK";
+   const char types[] =
"SELECT s.name, "
   "t.systemname, "
   "t.sqlname "
@@ -2708,13 +2708,13 @@ dump_database(Mapi mid, stream *sqlf, co
  "AND ui.name <> 'monetdb' "
  "AND ui.name <> '.snapshot' "
"ORDER BY ui.name";
-   const char *roles =
+   const char roles[] =
"SELECT name "
"FROM sys.auths "
"WHERE name NOT IN (SELECT name FROM sys.db_user_info) "
  "AND grantor <> 0 "
"ORDER BY name";
-   const char *grants =
+   const char grants[] =
/* all grants granting roles to users excepting the default 
role */
"SELECT a1.name, "
   "a2.name "
@@ -2727,7 +2727,7 @@ dump_database(Mapi mid, stream *sqlf, co
  "AND a1.name = ui.name "
  "AND a2.id <> ui.default_role "
"ORDER BY a1.name, a2.name";
-   const char *table_grants =
+   const char table_grants[] =
"SELECT s.name, t.name, "
   "a.name, "
   "sum(p.privileges), "
@@ -2744,7 +2744,7 @@ dump_database(Mapi mid, stream *sqlf, co
  "AND p.grantable = go.id "
"GROUP BY s.name, t.name, a.name, g.name, go.opt "
"ORDER BY s.name, t.name, a.name, g.name, go.opt";
-   const char *column_grants =
+   const char column_grants[] =
"SELECT s.name, t.name, "
   "c.name, a.name, "
   "pc.privilege_code_name, "
@@ -2766,7 +2766,7 @@ dump_database(Mapi mid, stream *sqlf, co
  "AND p.privileges = pc.privilege_code_id "
  "AND p.grantable = go.id "
"ORDER BY s.name, t.name, c.name, a.name, g.name, p.grantable";
-   const char *function_grants =
+   const char function_grants[] =
"SELECT f.id, "
   "s.name, "
   "f.name, "
@@ -2803,7 +2803,7 @@ dump_database(Mapi mid, stream *sqlf, co
 "f.id, "
 "a.inout DESC, "
 "a.number";
-   const char *global_grants =
+   const char global_grants[] =
"SELECT a.name, pc.grnt, g.name, go.opt "
"FROM sys.privileges p, "
 "sys.auths a, "
@@ -2816,22 +2816,22 @@ dump_database(Mapi mid, stream *sqlf, co
  "AND p.privileges = pc.id "
  "AND p.grantable = go.id "
"ORDER BY a.name, g.name, go.opt";
-   const char *schemas =
+   const char schemas[] =
"SELECT s.name, a.name, rem.remark "
"FROM sys.schemas s LEFT OUTER JOIN sys.comments rem ON s.id = 
rem.id, "
 "sys.auths a "
"WHERE s.\"authorization\" = a.id "
  "AND s.system = FALSE "
"ORDER BY s.name";
-   const char *sequences1 =
+   const char sequences1[] =
"SELECT sch.name, seq.name, rem.remark "
"FROM sys.schemas sch, "
 "sys.sequences seq LEFT OUTER JOIN sys.comments rem ON 
seq.id = rem.id "
"WHERE sch.id = seq.schema_id "
"ORDER BY sch.name, seq.name";
-   const char *sequences2 =
+   const char sequences2[] =
"SELECT * FROM sys.describe_sequences ORDER BY sch, seq";
-   const char *tables =
+   const char tables[] =
"SELECT t.id AS id, "
   "s.name AS sname, "
 

MonetDB: default - Upgrade: add new generate_series functions.

2024-05-14 Thread Sjoerd Mullender via checkin-list
Changeset: 9a60c2693323 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9a60c2693323
Modified Files:
sql/backends/monet5/sql_upgrades.c

sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/check.stable.out.int128

sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Upgrade: add new generate_series functions.


diffs (truncated from 610 to 300 lines):

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
@@ -327,7 +327,7 @@ static str
 sql_create_shp(Client c)
 {
//Create the new SHPload procedures
-   const char *query = "create procedure SHPLoad(fname string, schemaname 
string, tablename string) external name shp.load;\n"
+   const char query[] = "create procedure SHPLoad(fname string, schemaname 
string, tablename string) external name shp.load;\n"
"create procedure SHPLoad(fname string, tablename string) 
external name shp.load;\n"
"update sys.functions set system = true where schema_id = 2000 
and name in ('shpload');";
printf("Running database upgrade commands:\n%s\n", query);
@@ -340,7 +340,7 @@ static str
 sql_drop_shp(Client c)
 {
//Drop the old SHP procedures (upgrade from version before shpload 
upgrade)
-   const char *query = "drop procedure if exists SHPattach(string) 
cascade;\n"
+   const char query[] = "drop procedure if exists SHPattach(string) 
cascade;\n"
"drop procedure if exists SHPload(integer) cascade;\n"
"drop procedure if exists SHPload(integer, geometry) 
cascade;\n";
printf("Running database upgrade commands:\n%s\n", query);
@@ -351,7 +351,7 @@ sql_drop_shp(Client c)
 static str
 sql_update_generator(Client c)
 {
-   const char *query = "update sys.args set name = 'limit' where name = 
'last' and func_id in (select id from sys.functions where schema_id = 2000 and 
name = 'generate_series' and func like '% last %');\n"
+   const char query[] = "update sys.args set name = 'limit' where name = 
'last' and func_id in (select id from sys.functions where schema_id = 2000 and 
name = 'generate_series' and func like '% last %');\n"
"update sys.functions set func = replace(func, ' last ', ' 
\"limit\" ') where schema_id = 2000 and name = 'generate_series' and func like 
'% last %';\n";
return SQLstatementIntern(c, query, "update", true, false, NULL);
 }
@@ -3287,7 +3287,7 @@ sql_update_jan2022(Client c, mvc *sql)
list_append(l, );
if (sql_bind_func_(sql, s->base.name, "strimp_create", 
l, F_PROC, true, true)) {
/* do the upgrade by removing the two functions 
*/
-   const char *query =
+   const char query[] =
"drop filter function 
sys.strimp_filter(string, string) cascade;\n"
"drop procedure 
sys.strimp_create(string, string, string) cascade;\n";
printf("Running database upgrade 
commands:\n%s\n", query);
@@ -5198,7 +5198,7 @@ sql_update_jun2023(Client c, mvc *sql, s
if (wr)
wr->system = 

MonetDB: default - Add a minus to the module search path.

2024-05-14 Thread Sjoerd Mullender via checkin-list
Changeset: 65d4616042ef for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/65d4616042ef
Modified Files:
monetdb5/extras/rapi/rapi.R
Branch: default
Log Message:

Add a minus to the module search path.


diffs (12 lines):

diff --git a/monetdb5/extras/rapi/rapi.R b/monetdb5/extras/rapi/rapi.R
--- a/monetdb5/extras/rapi/rapi.R
+++ b/monetdb5/extras/rapi/rapi.R
@@ -57,7 +57,7 @@ rewireFunc("q", quit, "base")
 rm(rewireFunc)
 
 loopback_query <- function(query) {
-   dyn.load(file.path(MONETDB_LIBDIR, paste0("monetdb5", MONETDB_VERSION), 
"lib_rapi.so"))
+   dyn.load(file.path(MONETDB_LIBDIR, paste0("monetdb5-", 
MONETDB_VERSION), "lib_rapi.so"))
res <- .Call("RAPIloopback", paste0(query, "\n;"), package="lib_rapi")
if (is.character(res)) {
stop(res)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Add missing minus in path name.

2024-05-14 Thread Sjoerd Mullender via checkin-list
Changeset: 6e1d39ce866c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6e1d39ce866c
Modified Files:
tools/mserver/mserver5.c
Branch: default
Log Message:

Add missing minus in path name.


diffs (12 lines):

diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -681,7 +681,7 @@ main(int argc, char **av)
*p = '\0';
for (int i = 0; libdirs[i] != NULL; i++) {
int len = snprintf(prmodpath, 
sizeof(prmodpath),
-  
"%s%c%s%cmonetdb5%s",
+  
"%s%c%s%cmonetdb5-%s",
   
binpath, DIR_SEP, libdirs[i], DIR_SEP,
   
MONETDB_VERSION);
if (len == -1 || len >= FILENAME_MAX)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Use CMake target property to create versioned...

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 27d52e3434e7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/27d52e3434e7
Modified Files:
MonetDB.spec
NT/mkodbcwxs.py
NT/mksqlwxs.py
clients/NT/mclient.bat.in
clients/NT/msqldump.bat.in
clients/mapiclient/CMakeLists.txt
clients/mapilib/CMakeLists.txt
clients/mapilib/monetdb-mapi.pc.in
common/stream/CMakeLists.txt
common/stream/monetdb-stream.pc.in
gdk/CMakeLists.txt
gdk/monetdb-gdk.pc.in
geom/monetdb5/CMakeLists.txt
monetdb5/NT/M5server.bat.in
monetdb5/extras/mal_optimizer_template/CMakeLists.txt
monetdb5/extras/rapi/CMakeLists.txt
monetdb5/modules/kernel/CMakeLists.txt
monetdb5/tools/CMakeLists.txt
monetdb5/tools/monetdb5.pc.in
sql/backends/monet5/CMakeLists.txt
sql/backends/monet5/UDF/capi/CMakeLists.txt
sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
sql/backends/monet5/UDF/udf/CMakeLists.txt
sql/backends/monet5/generator/CMakeLists.txt
sql/backends/monet5/vaults/csv/CMakeLists.txt
sql/backends/monet5/vaults/fits/CMakeLists.txt
sql/backends/monet5/vaults/netcdf/CMakeLists.txt
sql/backends/monet5/vaults/shp/CMakeLists.txt
tools/merovingian/client/CMakeLists.txt
tools/merovingian/daemon/CMakeLists.txt
tools/merovingian/daemon/config/monetdbd.service.in
tools/mserver/CMakeLists.txt
Branch: default
Log Message:

Use CMake target property to create versioned binary + symlink.
Also, add a dash to the .so names before the version number so that they
look like the names CMake uses for the binaries.


diffs (truncated from 584 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -548,7 +548,7 @@ embedded library (%{name}-embedded).
 %defattr(-,root,root)
 %{_libdir}/libmonetdb5*.so.*
 %{_libdir}/libmonetdbsql*.so*
-%dir %{_libdir}/monetdb5%{version}
+%dir %{_libdir}/monetdb5-%{version}
 %if %{with cintegration}
 %{_libdir}/monetdb5*/lib_capi.so
 %endif
@@ -939,11 +939,6 @@ rm -f %{buildroot}%{_libdir}/monetdb5*/l
 rm -f %{buildroot}%{_bindir}/monetdb_mtest.sh
 rm -rf %{buildroot}%{_datadir}/monetdb # /cmake
 
-for f in monetdbd monetdb mserver5 mclient msqldump; do
-mv %{buildroot}%{_bindir}/${f} %{buildroot}%{_bindir}/${f}%{version}
-ln -s ${f}%{version} %{buildroot}%{_bindir}/${f}
-done
-
 if [ -x /usr/sbin/hardlink ]; then
 /usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
 else
diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py
--- a/NT/mkodbcwxs.py
+++ b/NT/mkodbcwxs.py
@@ -89,10 +89,10 @@ def main():
 id = 1
 print(r'')
 id = comp(features, id, 14,
-  [rf'bin\mapi{version}.dll', rf'lib\mapi{version}.pdb',
+  [rf'bin\mapi-{version}.dll', rf'lib\mapi-{version}.pdb',
r'lib\MonetODBC.dll', r'lib\MonetODBC.pdb',
r'lib\MonetODBCs.dll', r'lib\MonetODBCs.pdb',
-   rf'bin\stream{version}.dll', rf'lib\stream{version}.pdb',
+   rf'bin\stream-{version}.dll', rf'lib\stream-{version}.pdb',
vcpkg.format(r'bin\iconv-2.dll'),
vcpkg.format(r'bin\bz2.dll'),
vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll
diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py
--- a/NT/mksqlwxs.py
+++ b/NT/mksqlwxs.py
@@ -102,12 +102,12 @@ def main():
 print(r'  ')
 print(r'')
 print(r'')
-print(rf'  ')
+print(rf'  ')
 print(r'')
 print(r'  ')
 print(r'')
 print(r'')
-print(rf'  ')
+print(rf'  ')
 print(r'')
 print(r'  ')
 print(r'')
@@ -153,12 +153,12 @@ def main():
   [r'bin\mclient.exe',
r'bin\mserver5.exe',
r'bin\msqldump.exe',
-   rf'bin\bat{version}.dll',
-   rf'bin\mapi{version}.dll',
-   rf'bin\monetdb5{version}.dll',
+   rf'bin\bat-{version}.dll',
+   rf'bin\mapi-{version}.dll',
+   rf'bin\monetdb5-{version}.dll',
r'bin\monetdbe.dll',
-   rf'bin\monetdbsql{version}.dll',
-   rf'bin\stream{version}.dll',
+   rf'bin\monetdbsql-{version}.dll',
+   rf'bin\stream-{version}.dll',
vcpkg.format(r'bin\iconv-2.dll'),
vcpkg.format(r'bin\bz2.dll'),
vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll
@@ -174,11 +174,11 @@ def main():
   [r'bin\mclient.pdb',
r'bin\mserver5.pdb',
r'bin\msqldump.pdb',
-   rf'lib\bat{version}.pdb',
-   rf'lib\mapi{version}.pdb',
-   rf'lib\monetdb5{version}.pdb',
-   rf'lib\monetdbsql{version}.pdb',
-   rf'lib\stream{version}.pdb'])
+   rf'lib\bat-{version}.pdb',
+   

MonetDB: default - Add some casts.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 65d648432f63 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/65d648432f63
Modified Files:
sql/backends/monet5/generator/generator.c
Branch: default
Log Message:

Add some casts.


diffs (39 lines):

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
@@ -275,7 +275,7 @@ VLTgenerator_table_(BAT **result, Client
v = (date *) Tloc(bn, 0);
for (c = 0; c < n && f < l; c++) {
*v++ = f;
-   f = date_add_day(f, s);
+   f = date_add_day(f, (int) s);
if (is_date_nil(f)) {
BBPreclaim(bn);
throw(MAL, "generator.table", 
SQLSTATE(22003) "overflow in calculation");
@@ -635,7 +635,7 @@ VLTgenerator_subselect(Client cntxt, Mal
n++;
}
}
-   tsf = date_add_day(tsf, tss);
+   tsf = date_add_day(tsf, (int) tss);
if (is_date_nil(tsf)) {
BBPreclaim(cand);
BBPreclaim(bn);
@@ -1052,7 +1052,7 @@ str VLTgenerator_thetasubselect(Client c
c++;
}
}
-   val = date_add_day(val, s);
+   val = date_add_day(val, (int) s);
if (is_date_nil(val)) {
BBPreclaim(cand);
BBPreclaim(bn);
@@ -1308,7 +1308,7 @@ str VLTgenerator_projection(Client cntxt
 
for(; cnt-- > 0; o++){
t = ((int) (ol == NULL ? o : ol[o])) * s;
-   val = date_add_day(f, t);
+   val = date_add_day(f, (int) t);
if (is_date_nil(val)) {
BBPunfix(b->batCacheid);
BBPreclaim(bn);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Updated spec file so that we can build compat...

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: b08535a1b139 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b08535a1b139
Modified Files:
MonetDB.spec
Branch: default
Log Message:

Updated spec file so that we can build compat packages (--with compat).


diffs (232 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -8,8 +8,12 @@
 # Copyright August 2008 - 2023 MonetDB B.V.;
 # Copyright 1997 - July 2008 CWI.
 
-%global name MonetDB
 %global version 11.50.0
+
+%bcond_with compat
+
+%global name MonetDB%{?with_compat:%version}
+
 %{!?buildno: %global buildno %(date +%Y%m%d)}
 
 # Use bcond_with to add a --with option; i.e., "without" is default.
@@ -91,7 +95,7 @@ Group: Applications/Databases
 License: MPL-2.0
 URL: https://www.monetdb.org/
 BugURL: https://github.com/MonetDB/MonetDB/issues
-Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP3/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP3/MonetDB-%{version}.tar.bz2
 
 # The Fedora packaging document says we need systemd-rpm-macros for
 # the _unitdir and _tmpfilesdir macros to exist; however on RHEL 7
@@ -117,7 +121,9 @@ BuildRequires: unixODBC-devel
 BuildRequires: readline-devel
 %else
 BuildRequires: pkgconfig(bzip2)
+%if %{without compat}
 BuildRequires: pkgconfig(odbc)
+%endif
 BuildRequires: pkgconfig(readline)
 %endif
 %if %{with fits}
@@ -178,6 +184,7 @@ more client packages.
 %defattr(-,root,root)
 %{_libdir}/libbat*.so.*
 
+%if %{without compat}
 %package devel
 Summary: MonetDB development files
 Group: Applications/Databases
@@ -204,6 +211,7 @@ functionality of MonetDB.
 %{_includedir}/monetdb/monet*.h
 %{_libdir}/libbat*.so
 %{_libdir}/pkgconfig/monetdb-gdk.pc
+%endif
 
 %package stream
 Summary: MonetDB stream library
@@ -225,6 +233,7 @@ various other components.
 %defattr(-,root,root)
 %{_libdir}/libstream*.so.*
 
+%if %{without compat}
 %package stream-devel
 Summary: MonetDB stream library
 Group: Applications/Databases
@@ -249,6 +258,7 @@ library.
 %{_includedir}/monetdb/stream.h
 %{_includedir}/monetdb/stream_socket.h
 %{_libdir}/pkgconfig/monetdb-stream.pc
+%endif
 
 %package client-lib
 Summary: MonetDB - Monet Database Management System Client Programs
@@ -300,9 +310,12 @@ MonetDB, you will very likely need this 
 %defattr(-,root,root)
 %{_bindir}/mclient*
 %{_bindir}/msqldump*
+%if %{without compat}
 %{_mandir}/man1/mclient.1*
 %{_mandir}/man1/msqldump.1*
+%endif
 
+%if %{without compat}
 %package client-devel
 Summary: MonetDB - Monet Database Management System Client Programs
 Group: Applications/Databases
@@ -325,7 +338,9 @@ This package contains the files needed t
 %{_includedir}/monetdb/mapi*.h
 %{_includedir}/monetdb/msettings.h
 %{_libdir}/pkgconfig/monetdb-mapi.pc
+%endif
 
+%if %{without compat}
 %package client-odbc
 Summary: MonetDB ODBC driver
 Group: Applications/Databases
@@ -364,7 +379,9 @@ fi
 %defattr(-,root,root)
 %{_libdir}/libMonetODBC.so
 %{_libdir}/libMonetODBCs.so
+%endif
 
+%if %{without compat}
 %package client-tests
 Summary: MonetDB Client tests package
 Group: Applications/Databases
@@ -412,6 +429,7 @@ developer.
 %{_bindir}/malsample.pl
 %{_bindir}/sqlsample.php
 %{_bindir}/sqlsample.pl
+%endif
 
 %if %{with geos}
 %package geom
@@ -586,16 +604,21 @@ exit 0
 
 %files server
 %defattr(-,root,root)
+%if %{without compat}
 %{_sysusersdir}/monetdb.conf
 %attr(2750,monetdb,monetdb) %dir %{_localstatedir}/lib/monetdb
 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5
 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5/dbfarm
+%endif
 %{_bindir}/mserver5*
+%if %{without compat}
 %{_mandir}/man1/mserver5.1*
 %dir %{_datadir}/doc/MonetDB
 %docdir %{_datadir}/doc/MonetDB
 %{_datadir}/doc/MonetDB/*
+%endif
 
+%if %{without compat}
 %package server-devel
 Summary: MonetDB development files
 Group: Applications/Databases
@@ -620,6 +643,7 @@ used from the MAL level.
 %{_includedir}/monetdb/mel.h
 %{_libdir}/libmonetdb5*.so
 %{_libdir}/pkgconfig/monetdb5.pc
+%endif
 
 %package SQL
 Summary: MonetDB SQL server modules
@@ -654,6 +678,7 @@ configuration.
 %files SQL
 %defattr(-,root,root)
 %{_bindir}/monetdb*
+%if %{without compat}
 %dir %attr(775,monetdb,monetdb) %{_localstatedir}/log/monetdb
 %dir %attr(775,monetdb,monetdb) %{_rundir}/monetdb
 # RHEL >= 7, and all current Fedora
@@ -667,7 +692,9 @@ configuration.
 %dir %{_datadir}/doc/MonetDB-SQL
 %docdir %{_datadir}/doc/MonetDB-SQL
 %{_datadir}/doc/MonetDB-SQL/*
+%endif
 
+%if %{without compat}
 %package SQL-devel
 Summary: MonetDB SQL server modules development files
 Group: Applications/Databases
@@ -688,7 +715,9 @@ This package contains files needed to de
 %{_includedir}/monetdb/rel_*.h
 %{_includedir}/monetdb/sql*.h
 %{_includedir}/monetdb/store_*.h
+%endif
 
+%if %{without compat}
 %package embedded
 Summary: MonetDB as an embedded library
 Group: Applications/Databases
@@ -754,7 +783,9 @@ Group: Applications/Databases
 Requires: %{name}-client-tests = %{version}-%{release}
 

MonetDB: Dec2023 - Move looking up function pointer out of the i...

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: efc00e7b6e61 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/efc00e7b6e61
Modified Files:
gdk/gdk_calc_convert.c
gdk/gdk_hash.c
Branch: Dec2023
Log Message:

Move looking up function pointer out of the inner loop.


diffs (78 lines):

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 */
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Closing branch ascii-flag.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 772d4d7ddbd5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/772d4d7ddbd5
Branch: ascii-flag
Log Message:

Closing branch ascii-flag.

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


MonetDB: default - Merge branch ascii-flag into default.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 3b2c82d4448b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3b2c82d4448b
Branch: default
Log Message:

Merge branch ascii-flag into default.


diffs (truncated from 19798 to 300 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
@@ -34319,6 +34319,16 @@ pattern batstr.asciify(X_0:bat[:str], X_
 BATSTRasciify;
 Transform BAT of strings from UTF8 to ASCII
 batstr
+caseFold
+pattern batstr.caseFold(X_0:bat[:str]):bat[:str]
+STRbatCaseFold;
+Fold the case of a string.
+batstr
+caseFold
+pattern batstr.caseFold(X_0:bat[:str], X_1:bat[:oid]):bat[:str]
+STRbatCaseFold;
+Fold the case of a string.
+batstr
 contains
 pattern batstr.contains(X_0:bat[:str], X_1:bat[:str]):bat[:bit]
 BATSTRcontains;
@@ -50299,6 +50309,11 @@ command str.asciify(X_0:str):str
 STRasciify;
 Transform string from UTF8 to ASCII
 str
+caseFold
+command str.caseFold(X_0:str):str
+STRcasefold;
+Fold the case of a string.
+str
 contains
 pattern str.contains(X_0:str, X_1:str):bit
 STRcontains;
@@ -50379,11 +50394,6 @@ pattern str.endswithselect(X_0:bat[:str]
 STRendswithselect;
 Select all head values of the first input BAT for which the@tail value end 
with the given suffix + icase.
 str
-epilogue
-command str.epilogue():void
-STRepilogue;
-(empty)
-str
 insert
 command str.insert(X_0:str, X_1:int, X_2:int, X_3:str):str
 STRinsert;
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -25409,6 +25409,16 @@ pattern batstr.asciify(X_0:bat[:str], X_
 BATSTRasciify;
 Transform BAT of strings from UTF8 to ASCII
 batstr
+caseFold
+pattern batstr.caseFold(X_0:bat[:str]):bat[:str]
+STRbatCaseFold;
+Fold the case of a string.
+batstr
+caseFold
+pattern batstr.caseFold(X_0:bat[:str], X_1:bat[:oid]):bat[:str]
+STRbatCaseFold;
+Fold the case of a string.
+batstr
 contains
 pattern batstr.contains(X_0:bat[:str], X_1:bat[:str]):bat[:bit]
 BATSTRcontains;
@@ -38664,6 +38674,11 @@ command str.asciify(X_0:str):str
 STRasciify;
 Transform string from UTF8 to ASCII
 str
+caseFold
+command str.caseFold(X_0:str):str
+STRcasefold;
+Fold the case of a string.
+str
 contains
 pattern str.contains(X_0:str, X_1:str):bit
 STRcontains;
@@ -38744,11 +38759,6 @@ pattern str.endswithselect(X_0:bat[:str]
 STRendswithselect;
 Select all head values of the first input BAT for which the@tail value end 
with the given suffix + icase.
 str
-epilogue
-command str.epilogue():void
-STRepilogue;
-(empty)
-str
 insert
 command str.insert(X_0:str, X_1:int, X_2:int, X_3:str):str
 STRinsert;
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
@@ -16,6 +16,7 @@ BAT *BATallnotequal_grp2(BAT *l, BAT *r,
 BAT *BATanyequal_grp(BAT *l, BAT *r, BAT *g, BAT *e, BAT *s);
 BAT *BATanyequal_grp2(BAT *l, BAT *r, BAT *rid, BAT *g, BAT *e, BAT *s);
 gdk_return BATappend(BAT *b, BAT *n, BAT *s, bool force) 
__attribute__((__warn_unused_result__));
+BAT *BATasciify(BAT *b, BAT *s);
 void BATassertProps(BAT *b);
 atomDesc BATatoms[MAXATOMS];
 BAT *BATattach(int tt, const char *heapfile, role_t role);
@@ -108,6 +109,7 @@ dbl BATcalcvariance_population(dbl *avgp
 dbl BATcalcvariance_sample(dbl *avgp, BAT *b);
 BAT *BATcalcxor(BAT *b1, BAT *b2, BAT *s1, BAT *s2);
 BAT *BATcalcxorcst(BAT *b, const ValRecord *v, BAT *s);
+BAT *BATcasefold(BAT *b, BAT *s);
 bool BATcheckorderidx(BAT *b);
 gdk_return BATclear(BAT *b, bool force);
 void BATcommit(BAT *b, BUN size);
@@ -204,6 +206,8 @@ gdk_return BATsum(void *res, int tp, BAT
 const char *BATtailname(const BAT *b);
 gdk_return BATthetajoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT 
*sr, int op, bool nil_matches, BUN estimate) 
__attribute__((__warn_unused_result__));
 BAT *BATthetaselect(BAT *b, BAT *s, const void *val, const char *op);
+BAT *BATtolower(BAT *b, BAT *s);
+BAT *BATtoupper(BAT *b, BAT *s);
 void BATtseqbase(BAT *b, oid o);
 BAT *BATunique(BAT *b, BAT *s);
 BAT *BATunmask(BAT *b);
@@ -265,7 +269,9 @@ gdk_return GDKanalyticalntile(BAT *r, BA
 gdk_return GDKanalyticalprod(BAT *r, BAT *p, BAT *o, BAT *b, BAT *s, BAT *e, 
int tp1, int tp2, int frame_type);
 gdk_return GDKanalyticalsum(BAT *r, BAT *p, BAT *o, BAT *b, BAT *s, BAT *e, 
int tp1, int tp2, int frame_type);
 gdk_return GDKanalyticalwindowbounds(BAT *r, BAT *b, BAT *p, BAT *l, const 
void *restrict bound, int tp1, int tp2, int unit, bool preceding, oid 
first_half);
+gdk_return GDKasciify(char **restrict buf, size_t *restrict buflen, const char 
*restrict s);
 int GDKatomcnt;
+gdk_return GDKcasefold(char **restrict buf, size_t *restrict buflen, const 
char *restrict s);
 void GDKclrerr(void);
 gdk_return GDKcopyenv(BAT **key, BAT **val, bool writable);
 gdk_return GDKcreatedir(const char *nme);
@@ -317,8 +323,13 @@ 

MonetDB: ascii-flag - Merge with default branch.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: 48157ba5cd44 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/48157ba5cd44
Modified Files:
common/stream/CMakeLists.txt
common/stream/monetdb-stream.pc.in
Branch: ascii-flag
Log Message:

Merge with default branch.


diffs (truncated from 2231 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/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 # This file is updated with Maddlog
 
 * Wed May  8 2024 Sjoerd Mullender 
+- The shared library (.dll aka .so files) now have the version number
+  as part of the name.  This should allow the building of compatibility
+  versions that can be installed in parallel to the latest version.
 - Some of the Debian/Ubuntu packages have been renamed.  The old monetdb5
   names have been changed to plain monetdb, and libmonetdb5-server-*
   packages have been renamed monetdb-*.
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -176,7 +176,7 @@ more client packages.
 %files
 %license COPYING
 %defattr(-,root,root)
-%{_libdir}/libbat.so.*
+%{_libdir}/libbat*.so.*
 
 %package devel
 Summary: MonetDB development files
@@ -202,7 +202,7 @@ functionality of MonetDB.
 %{_includedir}/monetdb/mstring.h
 %exclude %{_includedir}/monetdb/monetdbe.h
 %{_includedir}/monetdb/monet*.h
-%{_libdir}/libbat.so
+%{_libdir}/libbat*.so
 %{_libdir}/pkgconfig/monetdb-gdk.pc
 
 %package stream
@@ -223,7 +223,7 @@ various other components.
 %files stream
 %license COPYING
 %defattr(-,root,root)
-%{_libdir}/libstream.so.*
+%{_libdir}/libstream*.so.*
 
 %package stream-devel
 Summary: MonetDB stream library
@@ -245,7 +245,7 @@ library.
 %files stream-devel
 %defattr(-,root,root)
 %dir %{_includedir}/monetdb
-%{_libdir}/libstream.so
+%{_libdir}/libstream*.so
 %{_includedir}/monetdb/stream.h
 %{_includedir}/monetdb/stream_socket.h
 %{_libdir}/pkgconfig/monetdb-stream.pc
@@ -273,7 +273,7 @@ you will very likely need this package.
 %files client-lib
 %license COPYING
 %defattr(-,root,root)
-%{_libdir}/libmapi.so.*
+%{_libdir}/libmapi*.so.*
 
 %package client
 Summary: MonetDB - Monet Database Management System Client Programs
@@ -298,8 +298,8 @@ MonetDB, you will very likely need this 
 %files client
 %license COPYING
 %defattr(-,root,root)
-%{_bindir}/mclient
-%{_bindir}/msqldump
+%{_bindir}/mclient*
+%{_bindir}/msqldump*
 %{_mandir}/man1/mclient.1*
 %{_mandir}/man1/msqldump.1*
 
@@ -321,7 +321,7 @@ This package contains the files needed t
 %files client-devel
 %defattr(-,root,root)
 %dir %{_includedir}/monetdb
-%{_libdir}/libmapi.so
+%{_libdir}/libmapi*.so
 %{_includedir}/monetdb/mapi*.h
 %{_includedir}/monetdb/msettings.h
 %{_libdir}/pkgconfig/monetdb-mapi.pc
@@ -433,7 +433,7 @@ extensions for %{name}-server.
 
 %files geom
 %defattr(-,root,root)
-%{_libdir}/monetdb5/lib_geom.so
+%{_libdir}/monetdb5*/lib_geom.so
 %endif
 
 %if %{with rintegration}
@@ -457,8 +457,8 @@ install it.
 
 %files R
 %defattr(-,root,root)
-%{_libdir}/monetdb5/rapi.R
-%{_libdir}/monetdb5/lib_rapi.so
+%{_libdir}/monetdb5*/rapi.R
+%{_libdir}/monetdb5*/lib_rapi.so
 %endif
 
 %if %{with py3integration}
@@ -483,7 +483,7 @@ install it.
 
 %files python3
 %defattr(-,root,root)
-%{_libdir}/monetdb5/lib_pyapi3.so
+%{_libdir}/monetdb5*/lib_pyapi3.so
 %endif
 
 %if %{with fits}
@@ -503,7 +503,7 @@ format.
 
 %files cfitsio
 %defattr(-,root,root)
-%{_libdir}/monetdb5/lib_fits.so
+%{_libdir}/monetdb5*/lib_fits.so
 %endif
 
 %package libs
@@ -528,14 +528,14 @@ embedded library (%{name}-embedded).
 
 %files libs
 %defattr(-,root,root)
-%{_libdir}/libmonetdb5.so.*
-%{_libdir}/libmonetdbsql.so*
-%dir %{_libdir}/monetdb5
+%{_libdir}/libmonetdb5*.so.*
+%{_libdir}/libmonetdbsql*.so*
+%dir %{_libdir}/monetdb5%{version}
 %if %{with cintegration}
-%{_libdir}/monetdb5/lib_capi.so
+%{_libdir}/monetdb5*/lib_capi.so
 %endif
-%{_libdir}/monetdb5/lib_csv.so
-%{_libdir}/monetdb5/lib_generator.so
+%{_libdir}/monetdb5*/lib_csv.so
+%{_libdir}/monetdb5*/lib_generator.so
 
 %package server
 Summary: MonetDB - Monet Database Management System
@@ -590,7 +590,7 @@ exit 0
 %attr(2750,monetdb,monetdb) %dir %{_localstatedir}/lib/monetdb
 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5
 %attr(2770,monetdb,monetdb) %dir %{_localstatedir}/monetdb5/dbfarm
-%{_bindir}/mserver5
+%{_bindir}/mserver5*
 %{_mandir}/man1/mserver5.1*
 %dir %{_datadir}/doc/MonetDB
 %docdir %{_datadir}/doc/MonetDB
@@ -618,7 +618,7 @@ used from the MAL level.
 %defattr(-,root,root)
 %{_includedir}/monetdb/mal*.h
 %{_includedir}/monetdb/mel.h
-%{_libdir}/libmonetdb5.so
+%{_libdir}/libmonetdb5*.so
 %{_libdir}/pkgconfig/monetdb5.pc
 
 %package SQL
@@ -653,8 +653,7 @@ configuration.
 
 

MonetDB: ascii-flag - Merge with default branch.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: a3396b4096a6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a3396b4096a6
Modified Files:
gdk/gdk.h
Branch: ascii-flag
Log Message:

Merge with default branch.


diffs (truncated from 1876 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
+* Wed May  8 2024 Sjoerd Mullender 
+- Some of the Debian/Ubuntu packages have been renamed.  The old monetdb5
+  names have been changed to plain monetdb, and libmonetdb5-server-*
+  packages have been renamed monetdb-*.
+- The names of some of the provided RPM files have been changed.
+  References to the old MonetDB5 name have been removed.  All packages
+  are now just MonetDB.
+
+* 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 '*'.
+
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -57,7 +57,7 @@
 # available.  However, the geos library is available in the Extra
 # Packages for Enterprise Linux (EPEL).
 %if %{fedpkgs} && (0%{?rhel} != 7) && (0%{?rhel} != 8)
-# By default create the MonetDB-geom-MonetDB5 package on Fedora and RHEL 7
+# By default create the MonetDB-geom package on Fedora and RHEL 7
 %bcond_without geos
 %endif
 
@@ -154,8 +154,8 @@ BuildRequires: pkgconfig(libR)
 # BuildRequires: pkgconfig(valgrind)# -DWITH_VALGRIND=ON
 
 %if (0%{?fedora} >= 22)
-Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Recommends: MonetDB5-server%{?_isa} = %{version}-%{release}
+Recommends: %{name}-SQL%{?_isa} = %{version}-%{release}
+Recommends: %{name}-server%{?_isa} = %{version}-%{release}
 Suggests: %{name}-client%{?_isa} = %{version}-%{release}
 %endif
 
@@ -167,8 +167,8 @@ accelerators.  It also has an SQL front 
 
 This package contains the core components of MonetDB in the form of a
 single shared library.  If you want to use MonetDB, you will certainly
-need this package, but you will also need at least the MonetDB5-server
-package, and most likely also %{name}-SQL-server5, as well as one or
+need this package, but you will also need at least the %{name}-server
+package, and most likely also %{name}-SQL, as well as one or
 more client packages.
 
 %ldconfig_scriptlets
@@ -254,8 +254,8 @@ library.
 Summary: MonetDB - Monet Database Management System Client Programs
 Group: Applications/Databases
 %if (0%{?fedora} >= 22)
-Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Recommends: MonetDB5-server%{?_isa} = %{version}-%{release}
+Recommends: %{name}-SQL%{?_isa} = %{version}-%{release}
+Recommends: %{name}-server%{?_isa} = %{version}-%{release}
 %endif
 
 %description client-lib
@@ -280,8 +280,8 @@ Summary: MonetDB - Monet Database Manage
 Group: Applications/Databases
 Requires: %{name}-client-lib%{?_isa} = %{version}-%{release}
 %if (0%{?fedora} >= 22)
-Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Recommends: MonetDB5-server%{?_isa} = %{version}-%{release}
+Recommends: %{name}-SQL%{?_isa} = %{version}-%{release}
+Recommends: %{name}-server%{?_isa} = %{version}-%{release}
 %endif
 
 %description client
@@ -368,14 +368,14 @@ fi
 %package client-tests
 Summary: MonetDB Client tests package
 Group: Applications/Databases
-Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
 Requires: %{name}-client%{?_isa} = %{version}-%{release}
 Requires: %{name}-client-odbc%{?_isa} = %{version}-%{release}
 %if (0%{?fedora} >= 22)
 Recommends: perl-DBD-monetdb >= 1.0
 Recommends: php-monetdb >= 1.0
 %endif
-Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} > 7
 Recommends: python3dist(lz4)
 Recommends: python3dist(scipy)
@@ -414,21 +414,24 @@ developer.
 %{_bindir}/sqlsample.pl
 
 %if %{with geos}
-%package geom-MonetDB5
-Summary: MonetDB5 SQL GIS support module
+%package geom
+Summary: SQL GIS support module for MonetDB
 Group: Applications/Databases
-Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+Obsoletes: MonetDB-geom-MonetDB5 < 11.50.0
+Provides: %{name}-geom-MonetDB5 = %{version}-%{release}
+Provides: %{name}-geom-MonetDB5%{?_isa} = %{version}-%{release}
 
-%description geom-MonetDB5
+%description geom
 MonetDB is a database management system that is developed from a
 main-memory perspective with use of a fully decomposed storage model,
 automatic index management, extensibility of data types and search
 accelerators.  It also has an SQL front end.
 
 This package contains the GIS (Geographic 

MonetDB: default - Merge with Dec2023 branch.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: d5c90fe141d5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d5c90fe141d5
Modified Files:
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out
Branch: default
Log Message:

Merge with Dec2023 branch.

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


MonetDB: Dec2023 - Approve 64 bit upgrade.

2024-05-13 Thread Sjoerd Mullender via checkin-list
Changeset: f824abac8ddc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f824abac8ddc
Modified Files:
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out
Branch: Dec2023
Log Message:

Approve 64 bit upgrade.


diffs (32 lines):

diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
@@ -0,0 +1,4 @@
+Running database upgrade commands:
+delete from sys.dependencies where (id, depend_id) in (select c.id, f.id from 
sys.functions f, sys._tables t, sys._columns c, sys.dependencies d where 
c.table_id = t.id and f.id = d.depend_id and c.id = d.id and f.schema_id = 2000 
and t.schema_id = 2000 and (f.name, t.name, c.name) in (values 
('describe_columns', '_columns', 'storage'), ('describe_function', 
'function_languages', 'language_name'), ('describe_function', 'function_types', 
'function_type_name'), ('describe_function', 'functions', 'func'), 
('describe_function', 'functions', 'mod'), ('describe_function', 'functions', 
'semantics'), ('describe_function', 'functions', 'side_effect'), 
('describe_function', 'functions', 'system'), ('describe_function', 
'functions', 'vararg'), ('describe_function', 'functions', 'varres'), 
('describe_function', 'schemas', 'authorization'), ('describe_function', 
'schemas', 'owner'), ('describe_function', 'schemas', 'system'), 
('describe_table', '_tables', 'access'), ('describe_table', '_tables',
  'commit_action'), ('describe_table', '_tables', 'system')));
+delete from sys.dependencies where (id, depend_id) in (select c.id, v.id from 
sys._tables v, sys._tables t, sys._columns c, sys.dependencies d where 
c.table_id = t.id and v.id = d.depend_id and c.id = d.id and v.schema_id = 2000 
and t.schema_id = 2000 and (v.name, t.name, c.name) in (values 
('dependency_columns_on_indexes', '_columns', 'name'), 
('dependency_columns_on_indexes', '_columns', 'number'), 
('dependency_columns_on_indexes', '_columns', 'storage'), 
('dependency_columns_on_indexes', '_columns', 'table_id'), 
('dependency_columns_on_indexes', '_columns', 'type_digits'), 
('dependency_columns_on_indexes', 'keys', 'id'), 
('dependency_columns_on_indexes', 'triggers', 'name'), 
('dependency_columns_on_indexes', 'triggers', 'orientation'), 
('dependency_columns_on_indexes', 'triggers', 'table_id'), 
('dependency_columns_on_indexes', 'triggers', 'time'), 
('dependency_columns_on_keys', '_columns', 'name'), 
('dependency_columns_on_keys', '_columns', 'table_id'), 
('dependency_columns_on_ke
 ys', '_columns', 'type'), ('dependency_columns_on_keys', '_columns', 
'type_digits'), ('dependency_columns_on_keys', '_columns', 'type_scale'), 
('dependency_columns_on_keys', 'triggers', 'name'), 
('dependency_columns_on_keys', 'triggers', 'orientation'), 
('dependency_columns_on_keys', 'triggers', 'table_id'), 
('dependency_columns_on_keys', 'triggers', 'time'), 
('dependency_columns_on_triggers', 'keys', 'name'), 
('dependency_columns_on_triggers', 'keys', 'rkey'), 
('dependency_columns_on_triggers', 'keys', 'type'), 
('dependency_functions_on_triggers', 'keys', 'action'), 
('dependency_functions_on_triggers', 'keys', 'name'), 
('dependency_functions_on_triggers', 'keys', 'rkey'), 
('dependency_functions_on_triggers', 'keys', 'type'), 
('dependency_keys_on_foreignkeys', '_columns', 'default'), 
('dependency_keys_on_foreignkeys', '_columns', 'name'), 
('dependency_keys_on_foreignkeys', '_columns', 'table_id'), 
('dependency_keys_on_foreignkeys', '_columns', 'type'), 
('dependency_keys_on_foreignke
 ys', '_columns', 'type_digits'), ('dependency_keys_on_foreignkeys', 
'_columns', 'type_scale'), ('dependency_tables_on_foreignkeys', '_columns', 
'default'), ('dependency_tables_on_foreignkeys', '_columns', 'name'), 
('dependency_tables_on_foreignkeys', '_columns', 'table_id'), 
('dependency_tables_on_foreignkeys', '_columns', 'type'), 
('dependency_tables_on_foreignkeys', '_columns', 'type_digits'), 
('dependency_tables_on_foreignkeys', '_columns', 'type_scale'), 
('dependency_tables_on_indexes', '_columns', 'name'), 
('dependency_tables_on_indexes', '_columns', 'number'), 
('dependency_tables_on_indexes', '_columns', 'storage'), 
('dependency_tables_on_indexes', '_columns', 'table_id'), 
('dependency_tables_on_indexes', '_columns', 'type_digits'), 
('dependency_tables_on_indexes', 'keys', 'id'), 
('dependency_tables_on_triggers', 'keys', 'action'), 
('dependency_tables_on_triggers', 'keys', 'name'), 
('dependency_tables_on_triggers', 'keys', 'rkey'), 
('dependency_tables_on_triggers', 'keys', 'ty
 pe')));
+
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out 
b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out
--- 

MonetDB: default - Merge with Dec2023 branch.

2024-05-10 Thread Sjoerd Mullender via checkin-list
Changeset: 4aab2525d40a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4aab2525d40a
Modified Files:
sql/backends/monet5/sql.c
sql/backends/monet5/sql_upgrades.c
sql/scripts/52_describe.sql
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/storage/sql_catalog.c
sql/storage/store.c
sql/test/BugTracker-2024/Tests/All
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-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
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

sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (truncated from 1220 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/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/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -5208,6 +5208,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/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
@@ -6596,6 +6596,46 @@ sql_update_dec2023_sp1(Client c, mvc *sq
 }
 
 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 changes where view did
+* the same thing (i.e. the second delete will normally not delete
+* anything) */
+   err = 

MonetDB: default - Add version numbers to selected files names.

2024-05-10 Thread Sjoerd Mullender via checkin-list
Changeset: a8115ccb4014 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a8115ccb4014
Added Files:
clients/NT/mclient.bat.in
clients/NT/msqldump.bat.in
monetdb5/NT/M5server.bat.in
Removed Files:
clients/NT/mclient.bat
clients/NT/msqldump.bat
monetdb5/NT/M5server.bat
Modified Files:
ChangeLog
MonetDB.spec
NT/mkodbcwxs.py
NT/mksqlwxs.py
clients/NT/CMakeLists.txt
clients/mapilib/CMakeLists.txt
clients/mapilib/monetdb-mapi.pc.in
common/stream/CMakeLists.txt
common/stream/monetdb-stream.pc.in
debian/libmonetdb-client-dev.install
debian/libmonetdb-client26.install
debian/libmonetdb-dev.install
debian/libmonetdb-stream-dev.install
debian/libmonetdb-stream26.install
debian/libmonetdb28.install
debian/libmonetdb5-server-cfitsio.install
debian/libmonetdb5-server-geom.install
debian/monetdb-python3.install
debian/monetdb-r.install
debian/monetdb5-server-dev.install
debian/monetdb5-server.install
gdk/CMakeLists.txt
gdk/monetdb-gdk.pc.in
geom/monetdb5/CMakeLists.txt
misc/selinux/monetdb.fc.in
misc/selinux/monetdb.te
monetdb5/NT/CMakeLists.txt
monetdb5/extras/mal_optimizer_template/CMakeLists.txt
monetdb5/extras/rapi/CMakeLists.txt
monetdb5/extras/rapi/rapi.R
monetdb5/extras/rapi/rapi.c
monetdb5/modules/kernel/CMakeLists.txt
monetdb5/tools/CMakeLists.txt
monetdb5/tools/monetdb5.pc.in
sql/backends/monet5/CMakeLists.txt
sql/backends/monet5/UDF/capi/CMakeLists.txt
sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
sql/backends/monet5/UDF/udf/CMakeLists.txt
sql/backends/monet5/generator/CMakeLists.txt
sql/backends/monet5/vaults/csv/CMakeLists.txt
sql/backends/monet5/vaults/fits/CMakeLists.txt
sql/backends/monet5/vaults/netcdf/CMakeLists.txt
sql/backends/monet5/vaults/shp/CMakeLists.txt
tools/mserver/mserver5.c
Branch: default
Log Message:

Add version numbers to selected files names.
This is a step towards being able to have compatibility (i.e. older)
versions installed at the same time.


diffs (truncated from 947 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 # This file is updated with Maddlog
 
 * Wed May  8 2024 Sjoerd Mullender 
+- The shared library (.dll aka .so files) now have the version number
+  as part of the name.  This should allow the building of compatibility
+  versions that can be installed in parallel to the latest version.
 - Some of the Debian/Ubuntu packages have been renamed.  The old monetdb5
   names have been changed to plain monetdb, and libmonetdb5-server-*
   packages have been renamed monetdb-*.
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -176,7 +176,7 @@ more client packages.
 %files
 %license COPYING
 %defattr(-,root,root)
-%{_libdir}/libbat.so.*
+%{_libdir}/libbat*.so.*
 
 %package devel
 Summary: MonetDB development files
@@ -202,7 +202,7 @@ functionality of MonetDB.
 %{_includedir}/monetdb/mstring.h
 %exclude %{_includedir}/monetdb/monetdbe.h
 %{_includedir}/monetdb/monet*.h
-%{_libdir}/libbat.so
+%{_libdir}/libbat*.so
 %{_libdir}/pkgconfig/monetdb-gdk.pc
 
 %package stream
@@ -223,7 +223,7 @@ various other components.
 %files stream
 %license COPYING
 %defattr(-,root,root)
-%{_libdir}/libstream.so.*
+%{_libdir}/libstream*.so.*
 
 %package stream-devel
 Summary: MonetDB stream library
@@ -245,7 +245,7 @@ library.
 %files stream-devel
 %defattr(-,root,root)
 %dir %{_includedir}/monetdb
-%{_libdir}/libstream.so
+%{_libdir}/libstream*.so
 %{_includedir}/monetdb/stream.h
 %{_includedir}/monetdb/stream_socket.h
 %{_libdir}/pkgconfig/monetdb-stream.pc
@@ -273,7 +273,7 @@ you will very likely need this package.
 %files client-lib
 %license COPYING
 %defattr(-,root,root)
-%{_libdir}/libmapi.so.*
+%{_libdir}/libmapi*.so.*
 
 %package client
 Summary: MonetDB - Monet Database Management System Client Programs
@@ -298,8 +298,8 @@ MonetDB, you will very likely need this 
 %files client
 %license COPYING
 %defattr(-,root,root)
-%{_bindir}/mclient
-%{_bindir}/msqldump
+%{_bindir}/mclient*
+%{_bindir}/msqldump*
 %{_mandir}/man1/mclient.1*
 %{_mandir}/man1/msqldump.1*
 
@@ -321,7 +321,7 @@ This package contains the files needed t
 %files client-devel
 %defattr(-,root,root)
 %dir %{_includedir}/monetdb
-%{_libdir}/libmapi.so
+%{_libdir}/libmapi*.so
 %{_includedir}/monetdb/mapi*.h
 %{_includedir}/monetdb/msettings.h
 %{_libdir}/pkgconfig/monetdb-mapi.pc
@@ -433,7 +433,7 @@ extensions for %{name}-server.
 
 %files geom
 %defattr(-,root,root)
-%{_libdir}/monetdb5/lib_geom.so
+%{_libdir}/monetdb5*/lib_geom.so
 %endif
 
 %if %{with rintegration}
@@ -457,8 +457,8 @@ install it.
 
 %files R
 %defattr(-,root,root)

MonetDB: Dec2023 - Upgrade code after SQL optimizer fixes which ...

2024-05-10 Thread Sjoerd Mullender via checkin-list
Changeset: 74f83ec971b4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/74f83ec971b4
Modified Files:
sql/backends/monet5/sql_upgrades.c

sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128

sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: Dec2023
Log Message:

Upgrade code after SQL optimizer fixes which find fewer dependencies.


diffs (270 lines):

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 changes where view did
+* the same thing (i.e. the second delete will normally not delete
+* anything) */
+   err = SQLstatementIntern(c, "select * from sys.dependencies where (id, 
depend_id) in (select c.id, f.id from sys.functions f, sys._tables t, 
sys._columns c, sys.dependencies d where c.table_id = t.id and f.id = 
d.depend_id and c.id = d.id and f.schema_id = 2000 and t.schema_id = 2000 and 
(f.name, t.name, c.name) in (values ('describe_columns', '_columns', 
'storage')));\n", "update", true, false, );
+   if (err)
+   return err;
+   b = BATdescriptor(output->cols[0].b);
+   if (b) {
+   if (BATcount(b) > 0) {
+   const char query[] = "delete from sys.dependencies 
where (id, depend_id) in (select c.id, f.id from sys.functions f, sys._tables 
t, sys._columns c, sys.dependencies d where c.table_id = t.id and f.id = 
d.depend_id and c.id = d.id and f.schema_id = 2000 and t.schema_id = 2000 and 
(f.name, t.name, c.name) in (values ('describe_columns', '_columns', 
'storage'), ('describe_function', 'function_languages', 'language_name'), 
('describe_function', 'function_types', 'function_type_name'), 
('describe_function', 'functions', 'func'), ('describe_function', 'functions', 
'mod'), ('describe_function', 'functions', 'semantics'), ('describe_function', 
'functions', 'side_effect'), ('describe_function', 'functions', 'system'), 
('describe_function', 'functions', 'vararg'), ('describe_function', 
'functions', 'varres'), ('describe_function', 'schemas', 'authorization'), 
('describe_function', 'schemas', 'owner'), ('describe_function', 'schemas', 
'system'), ('describe_table', '_tables', 'access'), ('de
 scribe_table', '_tables', 'commit_action'), ('describe_table', '_tables', 
'system')));\n"
+   "delete from sys.dependencies where (id, 
depend_id) in (select c.id, v.id from sys._tables v, sys._tables t, 
sys._columns c, sys.dependencies d where c.table_id = t.id and v.id = 
d.depend_id and c.id = d.id and v.schema_id = 2000 and t.schema_id = 2000 and 
(v.name, t.name, c.name) in (values ('dependency_columns_on_indexes', 
'_columns', 'name'), ('dependency_columns_on_indexes', '_columns', 'number'), 
('dependency_columns_on_indexes', '_columns', 'storage'), 
('dependency_columns_on_indexes', '_columns', 'table_id'), 
('dependency_columns_on_indexes', '_columns', 'type_digits'), 
('dependency_columns_on_indexes', 'keys', 'id'), 
('dependency_columns_on_indexes', 'triggers', 'name'), 

MonetDB: Dec2023 - Dec2023-SP3 was released.

2024-05-10 Thread Sjoerd Mullender via checkin-list
Changeset: 8995a45762ed for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8995a45762ed
Modified Files:
.hgtags
Branch: Dec2023
Log Message:

Dec2023-SP3 was released.


diffs (8 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
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Remove upgrade obsoleting of hugeint packages.

2024-05-08 Thread Sjoerd Mullender via checkin-list
Changeset: 6dfe9fabdab4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6dfe9fabdab4
Modified Files:
MonetDB.spec
debian/control
Branch: default
Log Message:

Remove upgrade obsoleting of hugeint packages.


diffs (47 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -543,11 +543,6 @@ Group: Applications/Databases
 Requires(pre): shadow-utils
 Requires: %{name}-client%{?_isa} = %{version}-%{release}
 Requires: %{name}-libs%{?_isa} = %{version}-%{release}
-Obsoletes: MonetDB5-server-hugeint < 11.38.0
-%if %{with hugeint}
-Provides: %{name}-server-hugeint%{?_isa} = %{version}-%{release}
-Provides: MonetDB5-server-hugeint%{?_isa} = %{version}-%{release}
-%endif
 Obsoletes: MonetDB5-server < 11.50.0
 Provides: MonetDB5-server = %{version}-%{release}
 Provides: MonetDB5-server%{?_isa} = %{version}-%{release}
@@ -630,10 +625,6 @@ used from the MAL level.
 Summary: MonetDB SQL server modules
 Group: Applications/Databases
 Requires(pre): %{name}-server%{?_isa} = %{version}-%{release}
-Obsoletes: MonetDB-SQL-server5-hugeint < 11.38.0
-%if %{with hugeint}
-Provides: %{name}-SQL-hugeint%{?_isa} = %{version}-%{release}
-%endif
 Obsoletes: MonetDB-SQL-server5 < 11.50.0
 Provides: %{name}-SQL-server5 = %{version}-%{release}
 Provides: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -206,8 +206,6 @@ Depends: ${shlibs:Depends}, ${misc:Depen
  libmonetdb28 (= ${source:Version}),
 Recommends: monetdb-sql (= ${source:Version})
 Suggests: monetdb-client (= ${source:Version})
-Conflicts: monetdb5-server-hugeint (<< 11.38.0)
-Replaces: monetdb5-server-hugeint (<< 11.38.0)
 Replaces: monetdb5-server (<< 11.50.0)
 Break: monetdb5-server (<< 11.50.0)
 Description: MonetDB database server
@@ -254,8 +252,6 @@ Depends: ${shlibs:Depends}, ${misc:Depen
  libmonetdb-client26 (= ${source:Version}),
  libmonetdb-stream26 (= ${source:Version}),
  monetdb-server (= ${source:Version})
-Conflicts: monetdb5-sql-hugeint (<< 11.38.0)
-Replaces: monetdb5-sql-hugeint (<< 11.38.0)
 Replaces: monetdb5-sql (<< 11.50.0)
 Break: monetdb5-sql (<< 11.50.0)
 Suggests: monetdb-client (= ${source:Version})
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Rename Debian/Ubuntu packages to remove the n...

2024-05-08 Thread Sjoerd Mullender via checkin-list
Changeset: 9b849f13bc02 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9b849f13bc02
Modified Files:
ChangeLog
debian/control
Branch: default
Log Message:

Rename Debian/Ubuntu packages to remove the name "monetdb5".


diffs (237 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
 # This file is updated with Maddlog
 
 * Wed May  8 2024 Sjoerd Mullender 
+- Some of the Debian/Ubuntu packages have been renamed.  The old monetdb5
+  names have been changed to plain monetdb, and libmonetdb5-server-*
+  packages have been renamed monetdb-*.
 - The names of some of the provided RPM files have been changed.
   References to the old MonetDB5 name have been removed.  All packages
   are now just MonetDB.
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -18,7 +18,6 @@ Package: libmonetdb28
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends},
  libmonetdb-stream26 (= ${source:Version})
-Conflicts: libmonetdb5-server-geom (<< ${source:Version})
 Description: MonetDB core library
  MonetDB is a database management system that is developed from a
  main-memory perspective with use of a fully decomposed storage model,
@@ -27,8 +26,8 @@ Description: MonetDB core library
  .
  This package contains the core components of MonetDB in the form of a
  single shared library.  If you want to use MonetDB, you will certainly
- need this package, but you will also need at least the monetdb5-server
- package, and most likely also monetdb5-sql, as well as one or
+ need this package, but you will also need at least the monetdb-server
+ package, and most likely also monetdb-sql, as well as one or
  more client packages.
 
 Package: libmonetdb-dev
@@ -101,8 +100,8 @@ Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends},
  libmonetdb-client26 (= ${source:Version}),
  libmonetdb-stream26 (= ${source:Version})
-Recommends: monetdb5-sql (= ${source:Version}),
- monetdb5-server (= ${source:Version})
+Recommends: monetdb-sql (= ${source:Version}),
+ monetdb-server (= ${source:Version})
 Description: MonetDB database client
  MonetDB is a database management system that is developed from a
  main-memory perspective with use of a fully decomposed storage model,
@@ -132,10 +131,10 @@ Depends: ${shlibs:Depends}, libmonetdb-c
  libmonetdb-client26 (= ${source:Version}),
  libmonetdb-stream26 (= ${source:Version}),
  libmonetdb28 (= ${source:Version}),
- monetdb5-server (= ${source:Version}),
+ monetdb-server (= ${source:Version}),
  libdbd-monetdb-perl (>= 1.0),
  php-monetdb (>= 1.0),
- monetdb5-server (= ${source:Version})
+ monetdb-server (= ${source:Version})
 Description: MonetDB client testing tools
  MonetDB is a database management system that is developed from a
  main-memory perspective with use of a fully decomposed storage model,
@@ -147,28 +146,44 @@ Description: MonetDB client testing tool
  developer.
 
 Package: libmonetdb5-server-geom
+Architecture: all
+Depends: monetdb-geom
+Description: transitional package
+ This is a transitional package.  It can safely be removed.
+
+Package: monetdb-geom
 Section: libs
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends},
  libmonetdb-stream26 (= ${source:Version}),
  libmonetdb28 (= ${source:Version}),
- monetdb5-server (= ${source:Version})
-Description: MonetDB5 SQL GIS support module
+ monetdb-server (= ${source:Version})
+Replaces: libmonetdb5-server-geom (<< 11.50.0)
+Break: libmonetdb5-server-geom (<< 11.50.0)
+Description: MonetDB SQL GIS support module
  MonetDB is a database management system that is developed from a
  main-memory perspective with use of a fully decomposed storage model,
  automatic index management, extensibility of data types and search
  accelerators.  It also has an SQL front end.
  .
  This package contains the GIS (Geographic Information System)
- extensions for monetdb5-server.
+ extensions for monetdb-server.
 
 Package: libmonetdb5-server-cfitsio
+Architecture: all
+Depends: monetdb-cfitsio
+Description: transitional package
+ This is a transitional package.  It can safely be removed.
+
+Package: monetdb-cfitsio
 Section: libs
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends},
  libmonetdb28 (= ${source:Version}),
- monetdb5-server (= ${source:Version})
-Description: MonetDB5 add on module for FITS files
+ monetdb-server (= ${source:Version})
+Replaces: libmonetdb5-server-cfitsio (<< 11.50.0)
+Break: libmonetdb5-server-cfitsio (<< 11.50.0)
+Description: MonetDB add on module for FITS files
  MonetDB is a database management system that is developed from a
  main-memory perspective with use of a fully decomposed storage model,
  automatic index management, extensibility of data types and search
@@ -178,16 +193,24 @@ Description: MonetDB5 add on module for 
  format.
 
 Package: monetdb5-server
+Architecture: all
+Depends: monetdb-server
+Description: transitional package
+ This is a transitional package. 

MonetDB: default - Changed some RPM names.

2024-05-08 Thread Sjoerd Mullender via checkin-list
Changeset: 5c135739277f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5c135739277f
Modified Files:
ChangeLog
MonetDB.spec
Branch: default
Log Message:

Changed some RPM names.
MonetDB5-server -> MonetDB-server
MonetDB5-libs -> MonetDB-libs
MonetDB-SQL-server5 -> MonetDB-SQL
MonetDB-geom-MonetDB5 -> MonetDB-geom


diffs (truncated from 363 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
+* Wed May  8 2024 Sjoerd Mullender 
+- The names of some of the provided RPM files have been changed.
+  References to the old MonetDB5 name have been removed.  All packages
+  are now just MonetDB.
+
 * 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
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -57,7 +57,7 @@
 # available.  However, the geos library is available in the Extra
 # Packages for Enterprise Linux (EPEL).
 %if %{fedpkgs} && (0%{?rhel} != 7) && (0%{?rhel} != 8)
-# By default create the MonetDB-geom-MonetDB5 package on Fedora and RHEL 7
+# By default create the MonetDB-geom package on Fedora and RHEL 7
 %bcond_without geos
 %endif
 
@@ -154,8 +154,8 @@ BuildRequires: pkgconfig(libR)
 # BuildRequires: pkgconfig(valgrind)# -DWITH_VALGRIND=ON
 
 %if (0%{?fedora} >= 22)
-Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Recommends: MonetDB5-server%{?_isa} = %{version}-%{release}
+Recommends: %{name}-SQL%{?_isa} = %{version}-%{release}
+Recommends: %{name}-server%{?_isa} = %{version}-%{release}
 Suggests: %{name}-client%{?_isa} = %{version}-%{release}
 %endif
 
@@ -167,8 +167,8 @@ accelerators.  It also has an SQL front 
 
 This package contains the core components of MonetDB in the form of a
 single shared library.  If you want to use MonetDB, you will certainly
-need this package, but you will also need at least the MonetDB5-server
-package, and most likely also %{name}-SQL-server5, as well as one or
+need this package, but you will also need at least the %{name}-server
+package, and most likely also %{name}-SQL, as well as one or
 more client packages.
 
 %ldconfig_scriptlets
@@ -254,8 +254,8 @@ library.
 Summary: MonetDB - Monet Database Management System Client Programs
 Group: Applications/Databases
 %if (0%{?fedora} >= 22)
-Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Recommends: MonetDB5-server%{?_isa} = %{version}-%{release}
+Recommends: %{name}-SQL%{?_isa} = %{version}-%{release}
+Recommends: %{name}-server%{?_isa} = %{version}-%{release}
 %endif
 
 %description client-lib
@@ -280,8 +280,8 @@ Summary: MonetDB - Monet Database Manage
 Group: Applications/Databases
 Requires: %{name}-client-lib%{?_isa} = %{version}-%{release}
 %if (0%{?fedora} >= 22)
-Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
-Recommends: MonetDB5-server%{?_isa} = %{version}-%{release}
+Recommends: %{name}-SQL%{?_isa} = %{version}-%{release}
+Recommends: %{name}-server%{?_isa} = %{version}-%{release}
 %endif
 
 %description client
@@ -368,14 +368,14 @@ fi
 %package client-tests
 Summary: MonetDB Client tests package
 Group: Applications/Databases
-Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
 Requires: %{name}-client%{?_isa} = %{version}-%{release}
 Requires: %{name}-client-odbc%{?_isa} = %{version}-%{release}
 %if (0%{?fedora} >= 22)
 Recommends: perl-DBD-monetdb >= 1.0
 Recommends: php-monetdb >= 1.0
 %endif
-Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
 %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} > 7
 Recommends: python3dist(lz4)
 Recommends: python3dist(scipy)
@@ -414,21 +414,24 @@ developer.
 %{_bindir}/sqlsample.pl
 
 %if %{with geos}
-%package geom-MonetDB5
-Summary: MonetDB5 SQL GIS support module
+%package geom
+Summary: SQL GIS support module for MonetDB
 Group: Applications/Databases
-Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
+Obsoletes: MonetDB-geom-MonetDB5 < 11.50.0
+Provides: %{name}-geom-MonetDB5 = %{version}-%{release}
+Provides: %{name}-geom-MonetDB5%{?_isa} = %{version}-%{release}
 
-%description geom-MonetDB5
+%description geom
 MonetDB is a database management system that is developed from a
 main-memory perspective with use of a fully decomposed storage model,
 automatic index management, extensibility of data types and search
 accelerators.  It also has an SQL front end.
 
 This package contains the GIS (Geographic Information System)
-extensions for MonetDB5-server.
+extensions for %{name}-server.
 
-%files geom-MonetDB5
+%files geom
 %defattr(-,root,root)
 %{_libdir}/monetdb5/lib_geom.so
 %endif
@@ -437,7 +440,7 @@ extensions for MonetDB5-server.
 

MonetDB: ascii-flag - We only need to initialize once + clarify ...

2024-05-08 Thread Sjoerd Mullender via checkin-list
Changeset: 912ad6ae2632 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/912ad6ae2632
Modified Files:
gdk/gdk_string.c
Branch: ascii-flag
Log Message:

We only need to initialize once + clarify comment.


diffs (57 lines):

diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -6859,7 +6859,7 @@ GDKstrncasecmp(const char *str1, const c
const uint8_t *s2 = (const uint8_t *) str2;
const uint8_t *x1 = NULL, *x2 = NULL;
int n1, n2;
-   int v1, v2;
+   int v1 = 0, v2 = 0;
 
for (;;) {
/* check for the end */
@@ -6870,7 +6870,6 @@ GDKstrncasecmp(const char *str1, const c
if (x2 == NULL && *s2 == 0)
return 1;
 
-   v1 = v2 = 0;
/* get next character from str1 */
if (x1 == NULL) {
v1 = casefold[*s1++];
@@ -6929,19 +6928,23 @@ GDKstrncasecmp(const char *str1, const c
n2++;
}
 
-   /* At this point, if x1 != NULL (then v1 == 0), it
-* points to the end of a sequence of length n1 that is
-* (part of) the first string to be compared and if *x1
-* != 0, it points to the next character to be compared
-* (in the next iteration, else we continue with s1);
-* else if v1 == 0, s1 points to the end of a sequence
-* of length n1 that is (part of) the string to be
-* compared; else v1 is the codepoint to be compared.
-* In any case, s1 points to the start of the next
-* character to be compared (after x1 is exhausted).
-* The value in l1 is the remaining length of the first
-* string (i.e. what s1 points to).  The same for x2,
-* s2, n2, l2, and v2. */
+   /* At this point, there are three possibilities:
+* x1 != NULL && v1 == 0:
+* x1 points to the byte behind a UTF-8 sequence of
+* length n1 that is to be compared (so x1-n1 is the
+* start);
+* x1 == NULL && v1 == 0:
+* s1 points to the byte behind a UTF-8 sequence of
+* length n1 that is to be compared (so s1-n1 is the
+* start);
+* x1 == NULL && v1 != 0:
+* v1 is the codepoint value that is to be compared.
+* Note that x1 != NULL && v1 != 0 cannot happen.
+* In all cases, s1 points to the start of the next
+* UTF-8 sequence, and l1 is the number of bytes left
+* that are to be compared (can be zero).
+*
+* The same goes for s2/x2/v2/n2/l2. */
 
/* compare */
if (v1 == 0) {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Initialize variables.

2024-05-08 Thread Sjoerd Mullender via checkin-list
Changeset: 1b913eb06824 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1b913eb06824
Modified Files:
gdk/gdk_string.c
Branch: ascii-flag
Log Message:

Initialize variables.


diffs (11 lines):

diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -6870,6 +6870,7 @@ GDKstrncasecmp(const char *str1, const c
if (x2 == NULL && *s2 == 0)
return 1;
 
+   v1 = v2 = 0;
/* get next character from str1 */
if (x1 == NULL) {
v1 = casefold[*s1++];
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: e97cd4d87b96 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e97cd4d87b96
Modified Files:
gdk/gdk.h
gdk/gdk_strimps.c
monetdb5/mal/mal_profiler.c
monetdb5/modules/mal/remote.c
sql/storage/bat/bat_storage.c
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (114 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -900,9 +900,10 @@ gdk_export size_t HEAPmemsize(Heap *h);
 gdk_export void HEAPdecref(Heap *h, bool remove);
 gdk_export void HEAPincref(Heap *h);
 
-#define isVIEW(x)  \
-   (((x)->theap && (x)->theap->parentid != (x)->batCacheid) || \
-((x)->tvheap && (x)->tvheap->parentid != (x)->batCacheid))
+#define VIEWtparent(x) ((x)->theap == NULL || (x)->theap->parentid == 
(x)->batCacheid ? 0 : (x)->theap->parentid)
+#define VIEWvtparent(x)((x)->tvheap == NULL || (x)->tvheap->parentid 
== (x)->batCacheid ? 0 : (x)->tvheap->parentid)
+
+#define isVIEW(x)  (VIEWtparent(x) != 0 || VIEWvtparent(x) != 0)
 
 /*
  * @+ BAT Buffer Pool
@@ -1083,7 +1084,7 @@ bat_iterator_nolock(BAT *b)
 {
/* does not get matched by bat_iterator_end */
if (b) {
-   bool isview = isVIEW(b);
+   bool isview = VIEWtparent(b);
return (BATiter) {
.b = b,
.h = b->theap,
@@ -2162,9 +2163,6 @@ gdk_export void VIEWbounds(BAT *b, BAT *
}   \
} while (false)
 
-#define VIEWtparent(x) ((x)->theap == NULL || (x)->theap->parentid == 
(x)->batCacheid ? 0 : (x)->theap->parentid)
-#define VIEWvtparent(x)((x)->tvheap == NULL || (x)->tvheap->parentid 
== (x)->batCacheid ? 0 : (x)->tvheap->parentid)
-
 /*
  * @+ BAT Iterators
  *  @multitable @columnfractions 0.15 0.7
diff --git a/gdk/gdk_strimps.c b/gdk/gdk_strimps.c
--- a/gdk/gdk_strimps.c
+++ b/gdk/gdk_strimps.c
@@ -551,7 +551,7 @@ STRMPfilter(BAT *b, BAT *s, const char *
 
TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec();
 
-   if (isVIEW(b)) {
+   if (VIEWtparent(b)) {
pb = BATdescriptor(VIEWtparent(b));
if (pb == NULL)
return NULL;
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -396,7 +396,7 @@ prepareMalEvent(Client cntxt, MalBlkPtr 
 * without further locking */
MT_lock_unset(>theaplock);
cnt = di.count;
-   if (isVIEW(d)) {
+   if (VIEWtparent(d)) {
BAT *v = 
BBP_desc(VIEWtparent(d));

MT_lock_set(>theaplock);
bool vtransient = 
v->batTransient;
diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -1546,7 +1546,7 @@ RMTbincopyto(Client cntxt, MalBlkPtr mb,
 
sendtheap = b->ttype != TYPE_void;
sendtvheap = sendtheap && b->tvheap;
-   if (isVIEW(b) && sendtvheap && VIEWvtparent(b)
+   if (sendtvheap && VIEWvtparent(b)
&& BATcount(b) < BATcount(BBP_desc(VIEWvtparent(b {
if ((b = BATdescriptor(bid)) == NULL) {
BBPunfix(bid);
diff --git a/sql/backends/monet5/sql_statistics.c 
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -183,7 +183,7 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
int access = c->storage_type && 
c->storage_type[0] == 'D' ? RD_EXT : RDONLY;
if (!(b = 
store->storage_api.bind_col(tr, c, access)))
continue; /* At the moment we 
ignore the error, but maybe we can change this */
-   if (isVIEW(b)) { /* If it is a view get 
the parent BAT */
+   if (VIEWtparent(b)) { /* If it is a 
view get the parent BAT */
BAT *nb = 
BATdescriptor(VIEWtparent(b));
BBPunfix(b->batCacheid);
b = nb;
@@ -370,7 +370,7 @@ sql_statistics(Client cntxt, MalBlkPtr m
goto bailout;
}
BATiter rei = 
bat_iterator(re);
- 

MonetDB: Dec2023 - isVIEW(x) == true does not imply VIEWtparent(...

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: f18ad1b06096 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f18ad1b06096
Modified Files:
gdk/gdk.h
gdk/gdk_strimps.c
monetdb5/mal/mal_profiler.c
monetdb5/modules/mal/remote.c
sql/backends/monet5/sql_statistics.c
sql/storage/bat/bat_storage.c
Branch: Dec2023
Log Message:

isVIEW(x) == true does not imply VIEWtparent(x) != 0.


diffs (114 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -906,9 +906,10 @@ gdk_export size_t HEAPmemsize(Heap *h);
 gdk_export void HEAPdecref(Heap *h, bool remove);
 gdk_export void HEAPincref(Heap *h);
 
-#define isVIEW(x)  \
-   (((x)->theap && (x)->theap->parentid != (x)->batCacheid) || \
-((x)->tvheap && (x)->tvheap->parentid != (x)->batCacheid))
+#define VIEWtparent(x) ((x)->theap == NULL || (x)->theap->parentid == 
(x)->batCacheid ? 0 : (x)->theap->parentid)
+#define VIEWvtparent(x)((x)->tvheap == NULL || (x)->tvheap->parentid 
== (x)->batCacheid ? 0 : (x)->tvheap->parentid)
+
+#define isVIEW(x)  (VIEWtparent(x) != 0 || VIEWvtparent(x) != 0)
 
 /*
  * @+ BAT Buffer Pool
@@ -1091,7 +1092,7 @@ bat_iterator_nolock(BAT *b)
 {
/* does not get matched by bat_iterator_end */
if (b) {
-   bool isview = isVIEW(b);
+   bool isview = VIEWtparent(b);
return (BATiter) {
.b = b,
.h = b->theap,
@@ -2191,9 +2192,6 @@ gdk_export void VIEWbounds(BAT *b, BAT *
}   \
} while (false)
 
-#define VIEWtparent(x) ((x)->theap == NULL || (x)->theap->parentid == 
(x)->batCacheid ? 0 : (x)->theap->parentid)
-#define VIEWvtparent(x)((x)->tvheap == NULL || (x)->tvheap->parentid 
== (x)->batCacheid ? 0 : (x)->tvheap->parentid)
-
 /*
  * @+ BAT Iterators
  *  @multitable @columnfractions 0.15 0.7
diff --git a/gdk/gdk_strimps.c b/gdk/gdk_strimps.c
--- a/gdk/gdk_strimps.c
+++ b/gdk/gdk_strimps.c
@@ -551,7 +551,7 @@ STRMPfilter(BAT *b, BAT *s, const char *
 
TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec();
 
-   if (isVIEW(b)) {
+   if (VIEWtparent(b)) {
pb = BATdescriptor(VIEWtparent(b));
if (pb == NULL)
return NULL;
diff --git a/monetdb5/mal/mal_profiler.c b/monetdb5/mal/mal_profiler.c
--- a/monetdb5/mal/mal_profiler.c
+++ b/monetdb5/mal/mal_profiler.c
@@ -399,7 +399,7 @@ prepareMalEvent(Client cntxt, MalBlkPtr 
 * without further locking */
MT_lock_unset(>theaplock);
cnt = di.count;
-   if (isVIEW(d)) {
+   if (VIEWtparent(d)) {
BAT *v = 
BBP_desc(VIEWtparent(d));
bool vtransient = true;
if (v) {
diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -1536,7 +1536,7 @@ RMTbincopyto(Client cntxt, MalBlkPtr mb,
 
sendtheap = b->ttype != TYPE_void;
sendtvheap = sendtheap && b->tvheap;
-   if (isVIEW(b) && sendtvheap && VIEWvtparent(b)
+   if (sendtvheap && VIEWvtparent(b)
&& BATcount(b) < BATcount(BBP_desc(VIEWvtparent(b {
if ((b = BATdescriptor(bid)) == NULL) {
BBPunfix(bid);
diff --git a/sql/backends/monet5/sql_statistics.c 
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -183,7 +183,7 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
int access = c->storage_type && 
c->storage_type[0] == 'D' ? RD_EXT : RDONLY;
if (!(b = 
store->storage_api.bind_col(tr, c, access)))
continue; /* At the moment we 
ignore the error, but maybe we can change this */
-   if (isVIEW(b)) { /* If it is a view get 
the parent BAT */
+   if (VIEWtparent(b)) { /* If it is a 
view get the parent BAT */
BAT *nb = 
BATdescriptor(VIEWtparent(b));
BBPunfix(b->batCacheid);
b = nb;
@@ -370,7 +370,7 @@ sql_statistics(Client cntxt, MalBlkPtr m
goto bailout;
}
BATiter rei 

MonetDB: ascii-flag - Merge with default branch.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: 8e2d926b65bf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8e2d926b65bf
Branch: ascii-flag
Log Message:

Merge with default branch.


diffs (truncated from 3634 to 300 lines):

diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
--- a/monetdb5/modules/mal/clients.c
+++ b/monetdb5/modules/mal/clients.c
@@ -479,9 +479,11 @@ CLTqueryTimeout(Client cntxt, MalBlkPtr 
lng timeout_micro = ATOMIC_GET() & FORCEMITOMASK
&& qto == 1 ? 1000 : (lng) qto * 100;
mal_clients[idx].querytimeout = timeout_micro;
-   QryCtx *qry_ctx = MT_thread_get_qry_ctx();
-   if (qry_ctx) {
-   qry_ctx->endtime = qry_ctx->starttime && timeout_micro 
? qry_ctx->starttime + timeout_micro : 0;
+   if (timeout_micro != 1000) {
+   QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+   if (qry_ctx) {
+   qry_ctx->endtime = qry_ctx->starttime && 
timeout_micro ? qry_ctx->starttime + timeout_micro : 0;
+   }
}
}
MT_lock_unset(_contextLock);
diff --git a/sql/test/emptydb/Tests/check.stable.out.32bit 
b/sql/test/emptydb/Tests/check.stable.out.32bit
--- a/sql/test/emptydb/Tests/check.stable.out.32bit
+++ b/sql/test/emptydb/Tests/check.stable.out.32bit
@@ -39,7 +39,7 @@ select 'sys.objects', o.name, case when 
 --  schemas
 select 'default schema of user', s.name, u.name from sys.schemas s, sys.users 
u where s.id = u.default_schema order by s.name, u.name;
 --  tables
-select 'grant on table', t.name, a.name, pc.privilege_code_name, g.name, 
p.grantable from sys._tables t, sys.privileges p left outer join sys.auths g on 
p.grantor = g.id left outer join sys.privilege_codes pc on p.privileges = 
pc.privilege_code_id, sys.auths a where t.id = p.obj_id and p.auth_id = a.id 
order by t.name, a.name;
+select 'grant on table', t.name, a.name, pc.privilege_code_name, g.name, 
p.grantable from sys._tables t, sys.privileges p left outer join sys.auths g on 
p.grantor = g.id left outer join sys.privilege_codes pc on p.privileges = 
pc.privilege_code_id, sys.auths a where t.id = p.obj_id and p.auth_id = a.id 
order by t.name, a.name, g.name nulls first;
 --  columns
 select 'grant on column', t.name, c.name, a.name, pc.privilege_code_name, 
g.name, p.grantable from sys._tables t, sys._columns c, sys.privileges p left 
outer join sys.auths g on p.grantor = g.id left outer join sys.privilege_codes 
pc on p.privileges = pc.privilege_code_id, sys.auths a where c.id = p.obj_id 
and c.table_id = t.id and p.auth_id = a.id order by t.name, c.name, a.name;
 --  functions
@@ -433,7 +433,7 @@ select 'null in fkeys.delete_action_id',
 select 'null in fkeys.delete_action', delete_action, * from sys.fkeys where 
delete_action is null;
 % .%1, .s, .,  .,  .s, . # table_name
 % %1,  name,   authorization,  owner,  system, comment # name
-% char,varchar,varchar,varchar,boolean,
varchar # type
+% varchar, varchar,varchar,varchar,boolean,
varchar # type
 % 11,  18, 8,  7,  5,  28 # length
 [ "sys.schemas",   "information_schema",   "monetdb",  "monetdb",  
true,   "ISO/IEC 9075-11 SQL/Schemata"  ]
 [ "sys.schemas",   "json", "monetdb",  "monetdb",  true,   NULL
]
@@ -443,8 +443,8 @@ select 'null in fkeys.delete_action', de
 [ "sys.schemas",   "tmp",  "sysadmin", "monetdb",  true,   NULL
]
 % .%25,.s, .t, .,  .,  .t, .,  .,  . # 
table_name
 % %25, name,   name,   query,  type,   system, commit_action,  access, comment 
# name
-% char,varchar,varchar,char,   varchar,
boolean,char,   char,   varchar # type
-% 11,  18, 34, 6812,   5,  5,  8,  10, 0 # length
+% varchar, varchar,varchar,varchar,varchar,
boolean,varchar,varchar,varchar # type
+% 11,  18, 34, 6812,   5,  5,  8,  8,  0 # length
 [ "sys._tables",   "information_schema",   "character_sets",   "create 
view information_schema.character_sets as select cast(null as varchar(1)) as 
character_set_catalog, cast(null as varchar(1)) as character_set_schema, 
cast('UTF-8' as varchar(16)) as character_set_name, cast('ISO/IEC 10646:2021' 
as varchar(20)) as character_repertoire, cast('UTF-8' as varchar(16)) as 
form_of_use, cast(null as varchar(1)) as default_collate_catalog, cast(null as 
varchar(1)) as default_collate_schema, cast(null as varchar(1)) as 
default_collate_name;",  "VIEW", true,   "COMMIT",   "WRITABLE", NULL   
 ]
 [ "sys._tables",   "information_schema",   "check_constraints","create 
view information_schema.check_constraints as select cast(null as varchar(1)) as 
constraint_catalog, 

MonetDB: default - Merge with Dec2023 branch.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: b9b9086ac1ad for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b9b9086ac1ad
Modified Files:
monetdb5/modules/mal/clients.c
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (31 lines):

diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
--- a/monetdb5/modules/mal/clients.c
+++ b/monetdb5/modules/mal/clients.c
@@ -479,9 +479,11 @@ CLTqueryTimeout(Client cntxt, MalBlkPtr 
lng timeout_micro = ATOMIC_GET() & FORCEMITOMASK
&& qto == 1 ? 1000 : (lng) qto * 100;
mal_clients[idx].querytimeout = timeout_micro;
-   QryCtx *qry_ctx = MT_thread_get_qry_ctx();
-   if (qry_ctx) {
-   qry_ctx->endtime = qry_ctx->starttime && timeout_micro 
? qry_ctx->starttime + timeout_micro : 0;
+   if (timeout_micro != 1000) {
+   QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+   if (qry_ctx) {
+   qry_ctx->endtime = qry_ctx->starttime && 
timeout_micro ? qry_ctx->starttime + timeout_micro : 0;
+   }
}
}
MT_lock_unset(_contextLock);
diff --git a/sql/test/strimps/Tests/small_string_crash.test 
b/sql/test/strimps/Tests/small_string_crash.test
--- a/sql/test/strimps/Tests/small_string_crash.test
+++ b/sql/test/strimps/Tests/small_string_crash.test
@@ -117,3 +117,9 @@ SELECT * FROM fal WHERE x LIKE 'Daniel%'
 Daniel Sims
 Daniel Sullivan
 
+query T nosort
+SELECT * FROM fal WHERE startswith(x, 'Daniel')
+
+Daniel Sims
+Daniel Sullivan
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Changelog blurb.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: c5c6f73f2644 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c5c6f73f2644
Modified Files:
common/stream/ChangeLog
gdk/ChangeLog
Branch: ascii-flag
Log Message:

Changelog blurb.


diffs (32 lines):

diff --git a/common/stream/ChangeLog b/common/stream/ChangeLog
--- a/common/stream/ChangeLog
+++ b/common/stream/ChangeLog
@@ -1,6 +1,11 @@
 # ChangeLog file for stream
 # This file is updated with Maddlog
 
+* Fri May  3 2024 Sjoerd Mullender 
+- ICONV support has been removed from the stream library.  The server
+  itself only needs UTF-8 support.  The client (mclient) does have
+  iconv support.
+
 * Wed Feb 21 2024 Sjoerd Mullender 
 - CURL support has been removed from the stream library.  If support is
   needed, look at the source code in either streamcat.c or mclient.c.
diff --git a/gdk/ChangeLog b/gdk/ChangeLog
--- a/gdk/ChangeLog
+++ b/gdk/ChangeLog
@@ -1,6 +1,13 @@
 # ChangeLog file for GDK
 # This file is updated with Maddlog
 
+* Fri May  3 2024 Sjoerd Mullender 
+- Various changes were made having to do with things like case-insensitive
+  comparisons and converting to upper or lower case.  Case insensitive
+  comparison (i.e. the ILIKE operator) uses case folding which is similar
+  to converting to lower case, but changes more characters, also sometimes
+  to multiple characters (e.g. German sharp s (ß) comparse equal to SS).
+
 * Tue Mar 26 2024 Sjoerd Mullender 
 - Made some changes to how BAT descriptors are allocated.  They are now
   allocated in bulk, meaning fewer malloc/free calls during processing.
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Approve some space changes.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: 8ebf0e62b30f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8ebf0e62b30f
Modified Files:
clients/Tests/MAL-signatures-hge.test
Branch: ascii-flag
Log Message:

Approve some space changes.


diffs (39 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
@@ -34320,12 +34320,12 @@ BATSTRasciify;
 Transform BAT of strings from UTF8 to ASCII
 batstr
 caseFold
-pattern batstr.caseFold(X_0:bat[:str]):bat[:str] 
+pattern batstr.caseFold(X_0:bat[:str]):bat[:str]
 STRbatCaseFold;
 Fold the case of a string.
 batstr
 caseFold
-pattern batstr.caseFold(X_0:bat[:str], X_1:bat[:oid]):bat[:str] 
+pattern batstr.caseFold(X_0:bat[:str], X_1:bat[:oid]):bat[:str]
 STRbatCaseFold;
 Fold the case of a string.
 batstr
@@ -50310,7 +50310,7 @@ STRasciify;
 Transform string from UTF8 to ASCII
 str
 caseFold
-command str.caseFold(X_0:str):str 
+command str.caseFold(X_0:str):str
 STRcasefold;
 Fold the case of a string.
 str
@@ -50394,11 +50394,6 @@ pattern str.endswithselect(X_0:bat[:str]
 STRendswithselect;
 Select all head values of the first input BAT for which the@tail value end 
with the given suffix + icase.
 str
-epilogue
-command str.epilogue():void
-STRepilogue;
-(empty)
-str
 insert
 command str.insert(X_0:str, X_1:int, X_2:int, X_3:str):str
 STRinsert;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Approve 32 bit output.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: 775c53d2116c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/775c53d2116c
Modified Files:
sql/test/emptydb/Tests/check.stable.out.32bit
Branch: default
Log Message:

Approve 32 bit output.


diffs (truncated from 3603 to 300 lines):

diff --git a/sql/test/emptydb/Tests/check.stable.out.32bit 
b/sql/test/emptydb/Tests/check.stable.out.32bit
--- a/sql/test/emptydb/Tests/check.stable.out.32bit
+++ b/sql/test/emptydb/Tests/check.stable.out.32bit
@@ -39,7 +39,7 @@ select 'sys.objects', o.name, case when 
 --  schemas
 select 'default schema of user', s.name, u.name from sys.schemas s, sys.users 
u where s.id = u.default_schema order by s.name, u.name;
 --  tables
-select 'grant on table', t.name, a.name, pc.privilege_code_name, g.name, 
p.grantable from sys._tables t, sys.privileges p left outer join sys.auths g on 
p.grantor = g.id left outer join sys.privilege_codes pc on p.privileges = 
pc.privilege_code_id, sys.auths a where t.id = p.obj_id and p.auth_id = a.id 
order by t.name, a.name;
+select 'grant on table', t.name, a.name, pc.privilege_code_name, g.name, 
p.grantable from sys._tables t, sys.privileges p left outer join sys.auths g on 
p.grantor = g.id left outer join sys.privilege_codes pc on p.privileges = 
pc.privilege_code_id, sys.auths a where t.id = p.obj_id and p.auth_id = a.id 
order by t.name, a.name, g.name nulls first;
 --  columns
 select 'grant on column', t.name, c.name, a.name, pc.privilege_code_name, 
g.name, p.grantable from sys._tables t, sys._columns c, sys.privileges p left 
outer join sys.auths g on p.grantor = g.id left outer join sys.privilege_codes 
pc on p.privileges = pc.privilege_code_id, sys.auths a where c.id = p.obj_id 
and c.table_id = t.id and p.auth_id = a.id order by t.name, c.name, a.name;
 --  functions
@@ -433,7 +433,7 @@ select 'null in fkeys.delete_action_id',
 select 'null in fkeys.delete_action', delete_action, * from sys.fkeys where 
delete_action is null;
 % .%1, .s, .,  .,  .s, . # table_name
 % %1,  name,   authorization,  owner,  system, comment # name
-% char,varchar,varchar,varchar,boolean,
varchar # type
+% varchar, varchar,varchar,varchar,boolean,
varchar # type
 % 11,  18, 8,  7,  5,  28 # length
 [ "sys.schemas",   "information_schema",   "monetdb",  "monetdb",  
true,   "ISO/IEC 9075-11 SQL/Schemata"  ]
 [ "sys.schemas",   "json", "monetdb",  "monetdb",  true,   NULL
]
@@ -443,8 +443,8 @@ select 'null in fkeys.delete_action', de
 [ "sys.schemas",   "tmp",  "sysadmin", "monetdb",  true,   NULL
]
 % .%25,.s, .t, .,  .,  .t, .,  .,  . # 
table_name
 % %25, name,   name,   query,  type,   system, commit_action,  access, comment 
# name
-% char,varchar,varchar,char,   varchar,
boolean,char,   char,   varchar # type
-% 11,  18, 34, 6812,   5,  5,  8,  10, 0 # length
+% varchar, varchar,varchar,varchar,varchar,
boolean,varchar,varchar,varchar # type
+% 11,  18, 34, 6812,   5,  5,  8,  8,  0 # length
 [ "sys._tables",   "information_schema",   "character_sets",   "create 
view information_schema.character_sets as select cast(null as varchar(1)) as 
character_set_catalog, cast(null as varchar(1)) as character_set_schema, 
cast('UTF-8' as varchar(16)) as character_set_name, cast('ISO/IEC 10646:2021' 
as varchar(20)) as character_repertoire, cast('UTF-8' as varchar(16)) as 
form_of_use, cast(null as varchar(1)) as default_collate_catalog, cast(null as 
varchar(1)) as default_collate_schema, cast(null as varchar(1)) as 
default_collate_name;",  "VIEW", true,   "COMMIT",   "WRITABLE", NULL   
 ]
 [ "sys._tables",   "information_schema",   "check_constraints","create 
view information_schema.check_constraints as select cast(null as varchar(1)) as 
constraint_catalog, cast(null as varchar(1024)) as constraint_schema, cast(null 
as varchar(1024)) as constraint_name, cast(null as varchar(1024)) as 
check_clause where 1=0;",  "VIEW", true,   "COMMIT",   "WRITABLE", NULL 
   ]
 [ "sys._tables",   "information_schema",   "columns",  "create view 
information_schema.columns as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, c.\"name\" as 
column_name, cast(1 + c.\"number\" as int) as ordinal_position, c.\"default\" 
as column_default, cast(sys.ifthenelse(c.\"null\", 'YES', 'NO') as varchar(3)) 
as is_nullable, cast(sys.\"sql_datatype\"(c.\"type\", c.\"type_digits\", 
c.\"type_scale\", true, true) as varchar(1024)) as data_type, 
cast(sys.ifthenelse(c.\"type\" in ('varchar','clob','char','json','url','xml') 
and c.\"type_digits\" > 0, c.\"type_digits\", null) as int) as 
character_maximum_length, 

MonetDB: default - Approve non-hge output.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: 69363e9ed196 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/69363e9ed196
Modified Files:
sql/test/emptydb/Tests/check.stable.out
Branch: default
Log Message:

Approve non-hge output.


diffs (14 lines):

diff --git a/sql/test/emptydb/Tests/check.stable.out 
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -6927,8 +6927,8 @@ select 'null in fkeys.delete_action', de
 % %14, table_id,   id, table_id,   type,   name,   rkey,   
update_action_id,   update_action,  delete_action_id,   delete_action # 
name
 % varchar, int,int,int,int,varchar,int,
smallint,   varchar,smallint,   varchar # type
 % 0,   1,  1,  1,  1,  0,  1,  1,  0,  1,  
0 # length
-% .%14,.fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, 
sys.fkeys,  .fkeys, sys.fkeys # table_name
-% %14, type,   id, table_id,   type,   name,   rkey,   
update_action_id,   update_action,  delete_action_id,   delete_action # 
name
+% .%15,.fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, 
.fkeys, .fkeys # table_name
+% %15, type,   id, table_id,   type,   name,   rkey,   
update_action_id,   update_action,  delete_action_id,   delete_action # 
name
 % varchar, int,int,int,int,varchar,int,
smallint,   varchar,smallint,   varchar # type
 % 0,   1,  1,  1,  1,  0,  1,  1,  0,  1,  
0 # length
 % .%14,.fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, 
sys.fkeys,  .fkeys, sys.fkeys # table_name
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Only set query timeout for query setting the ...

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: 9cde2d6c052e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9cde2d6c052e
Modified Files:
monetdb5/modules/mal/clients.c
Branch: Dec2023
Log Message:

Only set query timeout for query setting the timeout if not testing.


diffs (21 lines):

diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
--- a/monetdb5/modules/mal/clients.c
+++ b/monetdb5/modules/mal/clients.c
@@ -479,9 +479,14 @@ CLTqueryTimeout(Client cntxt, MalBlkPtr 
lng timeout_micro = ATOMIC_GET() & FORCEMITOMASK
&& qto == 1 ? 1000 : (lng) qto * 100;
mal_clients[idx].qryctx.querytimeout = timeout_micro;
-   QryCtx *qry_ctx = MT_thread_get_qry_ctx();
-   if (qry_ctx)
-   qry_ctx->querytimeout = timeout_micro;
+   if (timeout_micro != 1000) {
+   /* only set timeout for current query if not setting it 
to 1
+* msec during testing: we don't want a timeout during 
this
+* query */
+   QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+   if (qry_ctx)
+   qry_ctx->querytimeout = timeout_micro;
+   }
}
MT_lock_unset(_contextLock);
return msg;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Some code cleanup.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: 4b4e9c5ff1ae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4b4e9c5ff1ae
Modified Files:
monetdb5/modules/atoms/str.c
Branch: ascii-flag
Log Message:

Some code cleanup.


diffs (truncated from 472 to 300 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -691,12 +691,11 @@ STRWChrAt(int *res, const char *const *a
 }
 
 static inline str
-doStrConvert(str *res, const char *const *arg1, gdk_return (*func)(char 
**restrict, size_t *restrict, const char *restrict))
+doStrConvert(str *res, const char *arg1, gdk_return (*func)(char **restrict, 
size_t *restrict, const char *restrict))
 {
str buf = NULL, msg = MAL_SUCCEED;
-   const char *s = *arg1;
-
-   if (strNil(s)) {
+
+   if (strNil(arg1)) {
*res = GDKstrdup(str_nil);
} else {
size_t buflen = INITIAL_STR_BUFFER_LENGTH;
@@ -704,7 +703,7 @@ doStrConvert(str *res, const char *const
*res = NULL;
if (!(buf = GDKmalloc(buflen)))
throw(MAL, "str.lower", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
-   if ((*func)(, , s) != GDK_SUCCEED) {
+   if ((*func)(, , arg1) != GDK_SUCCEED) {
GDKfree(buf);
throw(MAL, "str.lower", GDK_EXCEPTION);
}
@@ -721,19 +720,19 @@ doStrConvert(str *res, const char *const
 static inline str
 STRlower(str *res, const char *const *arg1)
 {
-   return doStrConvert(res, arg1, GDKtolower);
+   return doStrConvert(res, *arg1, GDKtolower);
 }
 
 static inline str
 STRupper(str *res, const char *const *arg1)
 {
-   return doStrConvert(res, arg1, GDKtoupper);
+   return doStrConvert(res, *arg1, GDKtoupper);
 }
 
 static inline str
 STRcasefold(str *res, const char *const *arg1)
 {
-   return doStrConvert(res, arg1, GDKcasefold);
+   return doStrConvert(res, *arg1, GDKcasefold);
 }
 
 /* returns whether arg1 starts with arg2 */
@@ -795,24 +794,16 @@ str_icontains(const char *h, const char 
return GDKstrcasestr(h, n) == NULL;
 }
 
-#define STR_MAPARGS(STK, PCI, R, S1, S2, ICASE)
\
-   do{ 
\
-   R = getArgReference(STK, PCI, 0);   
\
-   S1 = *getArgReference_str(STK, PCI, 1); 
\
-   S2 = *getArgReference_str(STK, PCI, 2); 
\
-   icase = PCI->argc == 4 && *getArgReference_bit(STK, PCI, 3);
\
-   } while(0)
-
 static str
 STRstartswith(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
 {
(void) cntxt;
(void) mb;
 
-   str s1, s2;
-   bit *r, icase;
-
-   STR_MAPARGS(stk, pci, r, s1, s2, icase);
+   bit *r = getArgReference_bit(stk, pci, 0);
+   const char *s1 = *getArgReference_str(stk, pci, 1);
+   const char *s2 = *getArgReference_str(stk, pci, 2);
+   bit icase = pci->argc == 4 && *getArgReference_bit(stk, pci, 3);
 
if (strNil(s1) || strNil(s2)) {
*r = bit_nil;
@@ -831,10 +822,10 @@ STRendswith(Client cntxt, MalBlkPtr mb, 
(void) cntxt;
(void) mb;
 
-   str s1, s2;
-   bit *r, icase;
-
-   STR_MAPARGS(stk, pci, r, s1, s2, icase);
+   bit *r = getArgReference_bit(stk, pci, 0);
+   const char *s1 = *getArgReference_str(stk, pci, 1);
+   const char *s2 = *getArgReference_str(stk, pci, 2);
+   bit icase = pci->argc == 4 && *getArgReference_bit(stk, pci, 3);
 
if (strNil(s1) || strNil(s2)) {
*r = bit_nil;
@@ -854,10 +845,10 @@ STRcontains(Client cntxt, MalBlkPtr mb, 
(void) cntxt;
(void) mb;
 
-   str s1, s2;
-   bit *r, icase;
-
-   STR_MAPARGS(stk, pci, r, s1, s2, icase);
+   bit *r = getArgReference_bit(stk, pci, 0);
+   const char *s1 = *getArgReference_str(stk, pci, 1);
+   const char *s2 = *getArgReference_str(stk, pci, 2);
+   bit icase = pci->argc == 4 && *getArgReference_bit(stk, pci, 3);
 
if (strNil(s1) || strNil(s2)) {
*r = bit_nil;
@@ -900,7 +891,7 @@ STRstr_search(Client cntxt, MalBlkPtr mb
const char *haystack = *getArgReference_str(stk, pci, 1);
const char *needle = *getArgReference_str(stk, pci, 2);
bit icase = pci->argc == 4 && *getArgReference_bit(stk, pci, 3);
-   char *msg = MAL_SUCCEED;
+
if (strNil(haystack) || strNil(needle)) {
*res = bit_nil;
} else {
@@ -908,7 +899,7 @@ STRstr_search(Client cntxt, MalBlkPtr mb
str_isearch(haystack, needle) :
str_search(haystack, 

MonetDB: ascii-flag - Merge with default branch.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: 63728d9503e3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/63728d9503e3
Modified Files:
clients/Tests/exports.stable.out
monetdb5/modules/atoms/str.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/mal/pcre.c
Branch: ascii-flag
Log Message:

Merge with default branch.


diffs (truncated from 4713 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
@@ -811,9 +811,9 @@ str QLOGcatalog(BAT **r);
 str QLOGdisable(void *ret);
 str QLOGempty(void *ret);
 str QLOGenable(void *ret);
-str QLOGenableThreshold(void *ret, int *threshold);
+str QLOGenableThreshold(void *ret, const int *threshold);
 int QLOGisset(void);
-str RMTdisconnect(void *ret, str *conn);
+str RMTdisconnect(void *ret, const char *const *conn);
 BUN SQLload_file(Client cntxt, Tablet *as, bstream *b, stream *out, const char 
*csep, const char *rsep, char quote, lng skip, lng maxrow, int best, bool 
from_stdin, const char *tabnam, bool escape);
 str TABLETcollect(BAT **bats, Tablet *as);
 str TABLETcreate_bats(Tablet *as, BUN est);
diff --git a/monetdb5/modules/atoms/batxml.c b/monetdb5/modules/atoms/batxml.c
--- a/monetdb5/modules/atoms/batxml.c
+++ b/monetdb5/modules/atoms/batxml.c
@@ -760,7 +760,7 @@ BATXMLroot(bat *ret, const bat *bid, con
  *standalone);
snprintf(buf + i, len - i, "?>%s", t + 1);
buf++;
-   XMLisdocument(, );/* check 
well-formedness */
+   XMLisdocument(, &(const char *){buf});/* 
check well-formedness */
buf--;
if (!isdoc) {
err = XML_NOT_WELL_FORMED;
diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c
--- a/monetdb5/modules/atoms/blob.c
+++ b/monetdb5/modules/atoms/blob.c
@@ -130,7 +130,7 @@ BLOBnitems_bulk(Client cntxt, MalBlkPtr 
 }
 
 static str
-BLOBtoblob(blob **retval, str *s)
+BLOBtoblob(blob **retval, const char *const *s)
 {
size_t len = strLen(*s);
blob *b = (blob *) GDKmalloc(blobsize(len));
@@ -144,7 +144,7 @@ BLOBtoblob(blob **retval, str *s)
 }
 
 static str
-BLOBblob_blob(blob **d, blob **s)
+BLOBblob_blob(blob **d, const blob *const*s)
 {
size_t len = blobsize((*s)->nitems);
blob *b;
@@ -238,7 +238,7 @@ BLOBblob_blob_bulk(bat *res, const bat *
 }
 
 static str
-BLOBblob_fromstr(blob **b, const char **s)
+BLOBblob_fromstr(blob **b, const char *const*s)
 {
size_t len = 0;
 
diff --git a/monetdb5/modules/atoms/identifier.c 
b/monetdb5/modules/atoms/identifier.c
--- a/monetdb5/modules/atoms/identifier.c
+++ b/monetdb5/modules/atoms/identifier.c
@@ -93,7 +93,7 @@ IDtoString(char **retval, size_t *len, c
  * to parse the string.
  */
 static str
-IDentifier(identifier *retval, str *in)
+IDentifier(identifier *retval, const char *const *in)
 {
size_t len = 0;
 
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -229,7 +229,7 @@ INETtoString(str *retval, size_t *len, c
  * to parse the string.
  */
 static str
-INETnew(inet *retval, str *in)
+INETnew(inet *retval, const char *const *in)
 {
ssize_t pos;
size_t len = sizeof(inet);
@@ -787,7 +787,7 @@ INET_inet(inet *d, const inet *s)
 }
 
 static str
-INET_fromstr(inet *ret, str *s)
+INET_fromstr(inet *ret, const char *const *s)
 {
size_t len = sizeof(inet);
if (INETfromString(*s, , (void **) , false) < 0)
diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -233,7 +233,7 @@ JSONtoStorageString(JSON *jt, int idx, j
return msg;
 }
 
-static str JSONstr2json(json *ret, const char **j);
+static str JSONstr2json(json *ret, const char *const*j);
 
 static ssize_t
 JSONfromString(const char *src, size_t *len, void **J, bool external)
@@ -338,7 +338,7 @@ JSONtoString(str *s, size_t *len, const 
 }
 
 static BAT *
-JSONdumpInternal(JSON *jt, int depth)
+JSONdumpInternal(const JSON *jt, int depth)
 {
int i, idx;
JSONterm *je;
@@ -464,7 +464,7 @@ JSONdump(Client cntxt, MalBlkPtr mb, Mal
(void) cntxt;
 
bat *ret = getArgReference_bat(stk, pci, 0);
-   json *val = (json *) getArgReference(stk, pci, 1);
+   const json *val = (json *) getArgReference(stk, pci, 1);
JSON *jt = JSONparse(*val);
 
CHECK_JSON(jt);
@@ -503,7 +503,7 @@ JSON2json(json *ret, const json *j)
 }
 
 static str
-JSONstr2json(json *ret, const char **j)
+JSONstr2json(json *ret, const char *const*j)
 {
str msg = MAL_SUCCEED;
json buf = NULL;
@@ -541,7 +541,7 @@ JSONstr2json(json *ret, const char **j)
 }
 
 static str
-JSONisvalid(bit *ret, 

MonetDB: Dec2023 - Also test startswith with strimps.

2024-05-07 Thread Sjoerd Mullender via checkin-list
Changeset: 019e792d61bc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/019e792d61bc
Modified Files:
sql/test/strimps/Tests/small_string_crash.test
Branch: Dec2023
Log Message:

Also test startswith with strimps.


diffs (13 lines):

diff --git a/sql/test/strimps/Tests/small_string_crash.test 
b/sql/test/strimps/Tests/small_string_crash.test
--- a/sql/test/strimps/Tests/small_string_crash.test
+++ b/sql/test/strimps/Tests/small_string_crash.test
@@ -117,3 +117,9 @@ SELECT * FROM fal WHERE x LIKE 'Daniel%'
 Daniel Sims
 Daniel Sullivan
 
+query T nosort
+SELECT * FROM fal WHERE startswith(x, 'Daniel')
+
+Daniel Sims
+Daniel Sullivan
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Use const for a couple of externally visible ...

2024-05-06 Thread Sjoerd Mullender via checkin-list
Changeset: 5f7607485394 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5f7607485394
Modified Files:
clients/Tests/exports.stable.out
monetdb5/modules/mal/querylog.c
monetdb5/modules/mal/querylog.h
monetdb5/modules/mal/remote.c
monetdb5/modules/mal/remote.h
tools/monetdbe/monetdbe.c
Branch: default
Log Message:

Use const for a couple of externally visible MAL implementation functions.


diffs (74 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
@@ -800,9 +800,9 @@ str QLOGcatalog(BAT **r);
 str QLOGdisable(void *ret);
 str QLOGempty(void *ret);
 str QLOGenable(void *ret);
-str QLOGenableThreshold(void *ret, int *threshold);
+str QLOGenableThreshold(void *ret, const int *threshold);
 int QLOGisset(void);
-str RMTdisconnect(void *ret, str *conn);
+str RMTdisconnect(void *ret, const char *const *conn);
 BUN SQLload_file(Client cntxt, Tablet *as, bstream *b, stream *out, const char 
*csep, const char *rsep, char quote, lng skip, lng maxrow, int best, bool 
from_stdin, const char *tabnam, bool escape);
 str TABLETcollect(BAT **bats, Tablet *as);
 str TABLETcreate_bats(Tablet *as, BUN est);
diff --git a/monetdb5/modules/mal/querylog.c b/monetdb5/modules/mal/querylog.c
--- a/monetdb5/modules/mal/querylog.c
+++ b/monetdb5/modules/mal/querylog.c
@@ -293,7 +293,7 @@ QLOGenable(void *ret)
 }
 
 str
-QLOGenableThreshold(void *ret, int *threshold)
+QLOGenableThreshold(void *ret, const int *threshold)
 {
(void) ret;
QLOGtrace = true;
diff --git a/monetdb5/modules/mal/querylog.h b/monetdb5/modules/mal/querylog.h
--- a/monetdb5/modules/mal/querylog.h
+++ b/monetdb5/modules/mal/querylog.h
@@ -18,7 +18,7 @@
 mal_export str QLOGcatalog(BAT **r);
 mal_export str QLOGcalls(BAT **r);
 mal_export str QLOGenable(void *ret);
-mal_export str QLOGenableThreshold(void *ret, int *threshold);
+mal_export str QLOGenableThreshold(void *ret, const int *threshold);
 mal_export str QLOGdisable(void *ret);
 mal_export int QLOGisset(void);
 mal_export str QLOGempty(void *ret);
diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c
--- a/monetdb5/modules/mal/remote.c
+++ b/monetdb5/modules/mal/remote.c
@@ -345,7 +345,7 @@ RMTconnect(Client cntxt, MalBlkPtr mb, M
  * created).
  */
 str
-RMTdisconnect(void *ret, str *conn)
+RMTdisconnect(void *ret, const char *const *conn)
 {
connection c, t;
 
diff --git a/monetdb5/modules/mal/remote.h b/monetdb5/modules/mal/remote.h
--- a/monetdb5/modules/mal/remote.h
+++ b/monetdb5/modules/mal/remote.h
@@ -29,6 +29,6 @@ typedef struct {
size_t nrcolumns);
 } columnar_result_callback;
 
-mal_export str RMTdisconnect(void *ret, str *conn);
+mal_export str RMTdisconnect(void *ret, const char *const *conn);
 
 #endif /* _REMOTE_DEF */
diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -461,7 +461,7 @@ monetdbe_close_remote(monetdbe_database_
clear_error(mdbe);
}
 
-   if ( (mdbe->msg = RMTdisconnect(NULL, &(mdbe->mid))) != MAL_SUCCEED) {
+   if ( (mdbe->msg = RMTdisconnect(NULL, &(const char *){mdbe->mid})) != 
MAL_SUCCEED) {
err = 1;
clear_error(mdbe);
}
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch.

2024-05-06 Thread Sjoerd Mullender via checkin-list
Changeset: 5c1f3c7ab660 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5c1f3c7ab660
Modified Files:
monetdb5/modules/atoms/batxml.c
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/mtime.c
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/batmmath.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/mal/bbp.c
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/iterator.c
monetdb5/modules/mal/mal_io.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/mdb.c
monetdb5/modules/mal/profiler.c
monetdb5/modules/mal/querylog.c
monetdb5/modules/mal/remote.c
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (truncated from 3580 to 300 lines):

diff --git a/monetdb5/modules/atoms/batxml.c b/monetdb5/modules/atoms/batxml.c
--- a/monetdb5/modules/atoms/batxml.c
+++ b/monetdb5/modules/atoms/batxml.c
@@ -760,7 +760,7 @@ BATXMLroot(bat *ret, const bat *bid, con
  *standalone);
snprintf(buf + i, len - i, "?>%s", t + 1);
buf++;
-   XMLisdocument(, );/* check 
well-formedness */
+   XMLisdocument(, &(const char *){buf});/* 
check well-formedness */
buf--;
if (!isdoc) {
err = XML_NOT_WELL_FORMED;
diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c
--- a/monetdb5/modules/atoms/blob.c
+++ b/monetdb5/modules/atoms/blob.c
@@ -130,7 +130,7 @@ BLOBnitems_bulk(Client cntxt, MalBlkPtr 
 }
 
 static str
-BLOBtoblob(blob **retval, str *s)
+BLOBtoblob(blob **retval, const char *const *s)
 {
size_t len = strLen(*s);
blob *b = (blob *) GDKmalloc(blobsize(len));
@@ -144,7 +144,7 @@ BLOBtoblob(blob **retval, str *s)
 }
 
 static str
-BLOBblob_blob(blob **d, blob **s)
+BLOBblob_blob(blob **d, const blob *const*s)
 {
size_t len = blobsize((*s)->nitems);
blob *b;
@@ -238,7 +238,7 @@ BLOBblob_blob_bulk(bat *res, const bat *
 }
 
 static str
-BLOBblob_fromstr(blob **b, const char **s)
+BLOBblob_fromstr(blob **b, const char *const*s)
 {
size_t len = 0;
 
diff --git a/monetdb5/modules/atoms/identifier.c 
b/monetdb5/modules/atoms/identifier.c
--- a/monetdb5/modules/atoms/identifier.c
+++ b/monetdb5/modules/atoms/identifier.c
@@ -93,7 +93,7 @@ IDtoString(char **retval, size_t *len, c
  * to parse the string.
  */
 static str
-IDentifier(identifier *retval, str *in)
+IDentifier(identifier *retval, const char *const *in)
 {
size_t len = 0;
 
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -229,7 +229,7 @@ INETtoString(str *retval, size_t *len, c
  * to parse the string.
  */
 static str
-INETnew(inet *retval, str *in)
+INETnew(inet *retval, const char *const *in)
 {
ssize_t pos;
size_t len = sizeof(inet);
@@ -787,7 +787,7 @@ INET_inet(inet *d, const inet *s)
 }
 
 static str
-INET_fromstr(inet *ret, str *s)
+INET_fromstr(inet *ret, const char *const *s)
 {
size_t len = sizeof(inet);
if (INETfromString(*s, , (void **) , false) < 0)
diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -233,7 +233,7 @@ JSONtoStorageString(JSON *jt, int idx, j
return msg;
 }
 
-static str JSONstr2json(json *ret, const char **j);
+static str JSONstr2json(json *ret, const char *const*j);
 
 static ssize_t
 JSONfromString(const char *src, size_t *len, void **J, bool external)
@@ -338,7 +338,7 @@ JSONtoString(str *s, size_t *len, const 
 }
 
 static BAT *
-JSONdumpInternal(JSON *jt, int depth)
+JSONdumpInternal(const JSON *jt, int depth)
 {
int i, idx;
JSONterm *je;
@@ -464,7 +464,7 @@ JSONdump(Client cntxt, MalBlkPtr mb, Mal
(void) cntxt;
 
bat *ret = getArgReference_bat(stk, pci, 0);
-   json *val = (json *) getArgReference(stk, pci, 1);
+   const json *val = (json *) getArgReference(stk, pci, 1);
JSON *jt = JSONparse(*val);
 
CHECK_JSON(jt);
@@ -503,7 +503,7 @@ JSON2json(json *ret, const json *j)
 }
 
 static str
-JSONstr2json(json *ret, const char **j)
+JSONstr2json(json *ret, const char *const*j)
 {
str msg = MAL_SUCCEED;
json buf = NULL;
@@ -541,7 +541,7 @@ JSONstr2json(json *ret, const char **j)
 }
 
 static str
-JSONisvalid(bit *ret, str *j)
+JSONisvalid(bit *ret, const char *const *j)
 {
if (strNil(*j)) {
*ret = bit_nil;
@@ -556,12 +556,12 @@ JSONisvalid(bit *ret, str *j)
 }
 
 static str
-JSONisobject(bit *ret, json *js)
+JSONisobject(bit *ret, const json *js)
 {
if (strNil(*js)) {
*ret = bit_nil;
} else {
-

MonetDB: Dec2023 - Use const for arguments of MAL implementation...

2024-05-06 Thread Sjoerd Mullender via checkin-list
Changeset: 2db6f10c3129 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2db6f10c3129
Modified Files:
monetdb5/modules/atoms/batxml.c
monetdb5/modules/atoms/blob.c
monetdb5/modules/atoms/identifier.c
monetdb5/modules/atoms/inet.c
monetdb5/modules/atoms/json.c
monetdb5/modules/atoms/mtime.c
monetdb5/modules/atoms/streams.c
monetdb5/modules/atoms/url.c
monetdb5/modules/atoms/uuid.c
monetdb5/modules/atoms/xml.c
monetdb5/modules/atoms/xml.h
monetdb5/modules/kernel/bat5.c
monetdb5/modules/kernel/batmmath.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/kernel/microbenchmark.c
monetdb5/modules/mal/batExtensions.c
monetdb5/modules/mal/bbp.c
monetdb5/modules/mal/calc.c
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/iterator.c
monetdb5/modules/mal/mal_io.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/mdb.c
monetdb5/modules/mal/profiler.c
monetdb5/modules/mal/querylog.c
monetdb5/modules/mal/remote.c
monetdb5/modules/mal/tracer.c
Branch: Dec2023
Log Message:

Use const for arguments of MAL implementation functions.


diffs (truncated from 3505 to 300 lines):

diff --git a/monetdb5/modules/atoms/batxml.c b/monetdb5/modules/atoms/batxml.c
--- a/monetdb5/modules/atoms/batxml.c
+++ b/monetdb5/modules/atoms/batxml.c
@@ -759,7 +759,7 @@ BATXMLroot(bat *ret, const bat *bid, con
  *standalone);
snprintf(buf + i, len - i, "?>%s", t + 1);
buf++;
-   XMLisdocument(, );/* check 
well-formedness */
+   XMLisdocument(, &(const char *){buf});/* 
check well-formedness */
buf--;
if (!isdoc) {
err = XML_NOT_WELL_FORMED;
diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c
--- a/monetdb5/modules/atoms/blob.c
+++ b/monetdb5/modules/atoms/blob.c
@@ -130,7 +130,7 @@ BLOBnitems_bulk(Client cntxt, MalBlkPtr 
 }
 
 static str
-BLOBtoblob(blob **retval, str *s)
+BLOBtoblob(blob **retval, const char *const *s)
 {
size_t len = strLen(*s);
blob *b = (blob *) GDKmalloc(blobsize(len));
@@ -144,7 +144,7 @@ BLOBtoblob(blob **retval, str *s)
 }
 
 static str
-BLOBblob_blob(blob **d, blob **s)
+BLOBblob_blob(blob **d, const blob *const*s)
 {
size_t len = blobsize((*s)->nitems);
blob *b;
@@ -238,7 +238,7 @@ BLOBblob_blob_bulk(bat *res, const bat *
 }
 
 static str
-BLOBblob_fromstr(blob **b, const char **s)
+BLOBblob_fromstr(blob **b, const char *const*s)
 {
size_t len = 0;
 
diff --git a/monetdb5/modules/atoms/identifier.c 
b/monetdb5/modules/atoms/identifier.c
--- a/monetdb5/modules/atoms/identifier.c
+++ b/monetdb5/modules/atoms/identifier.c
@@ -93,7 +93,7 @@ IDtoString(char **retval, size_t *len, c
  * to parse the string.
  */
 static str
-IDentifier(identifier *retval, str *in)
+IDentifier(identifier *retval, const char *const *in)
 {
size_t len = 0;
 
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -229,7 +229,7 @@ INETtoString(str *retval, size_t *len, c
  * to parse the string.
  */
 static str
-INETnew(inet *retval, str *in)
+INETnew(inet *retval, const char *const *in)
 {
ssize_t pos;
size_t len = sizeof(inet);
@@ -787,7 +787,7 @@ INET_inet(inet *d, const inet *s)
 }
 
 static str
-INET_fromstr(inet *ret, str *s)
+INET_fromstr(inet *ret, const char *const *s)
 {
size_t len = sizeof(inet);
if (INETfromString(*s, , (void **) , false) < 0)
diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -233,7 +233,7 @@ JSONtoStorageString(JSON *jt, int idx, j
return msg;
 }
 
-static str JSONstr2json(json *ret, const char **j);
+static str JSONstr2json(json *ret, const char *const*j);
 
 static ssize_t
 JSONfromString(const char *src, size_t *len, void **J, bool external)
@@ -338,7 +338,7 @@ JSONtoString(str *s, size_t *len, const 
 }
 
 static BAT *
-JSONdumpInternal(JSON *jt, int depth)
+JSONdumpInternal(const JSON *jt, int depth)
 {
int i, idx;
JSONterm *je;
@@ -464,7 +464,7 @@ JSONdump(Client cntxt, MalBlkPtr mb, Mal
(void) cntxt;
 
bat *ret = getArgReference_bat(stk, pci, 0);
-   json *val = (json *) getArgReference(stk, pci, 1);
+   const json *val = (json *) getArgReference(stk, pci, 1);
JSON *jt = JSONparse(*val);
 
CHECK_JSON(jt);
@@ -503,7 +503,7 @@ JSON2json(json *ret, const json *j)
 }
 
 static str
-JSONstr2json(json *ret, const char **j)
+JSONstr2json(json *ret, const char *const*j)

MonetDB: Dec2023 - Reduce number of connection, especially on Wi...

2024-05-06 Thread Sjoerd Mullender via checkin-list
Changeset: f30f88e0584b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f30f88e0584b
Modified Files:
sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py
Branch: Dec2023
Log Message:

Reduce number of connection, especially on Windows.


diffs (24 lines):

diff --git 
a/sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py 
b/sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py
--- a/sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py
+++ b/sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py
@@ -3,16 +3,18 @@ from concurrent.futures import ProcessPo
 
 if os.name == 'posix' and os.uname().sysname == 'Linux':
 executor = ProcessPoolExecutor
+nr_clients = 32
+nr_queries = 1000
 else:
 executor = ThreadPoolExecutor
+nr_clients = 16
+nr_queries = 500
 
 h   = os.getenv('MAPIHOST')
 p   = int(os.getenv('MAPIPORT'))
 db  = os.getenv('TSTDB')
 
-nr_clients = 32
 def client(_):
-nr_queries = 1000
 for x in range(0, nr_queries):
 conn = pymonetdb.connect(hostname=h, port=p,database=db, 
autocommit=True)
 cursor = conn.cursor()
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch.

2024-05-06 Thread Sjoerd Mullender via checkin-list
Changeset: 20f1242657c0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/20f1242657c0
Modified Files:
monetdb5/modules/atoms/str.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/txtsim.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_user.c
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (truncated from 1102 to 300 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -3514,7 +3514,7 @@ STRlike(const char *s, const char *pat, 
 }
 
 static str
-STRlikewrap3(bit *ret, const str *s, const str *pat, const str *esc)
+STRlikewrap3(bit *ret, const char *const *s, const char *const *pat, const 
char *const *esc)
 {
if (strNil(*s) || strNil(*pat) || strNil(*esc))
*ret = bit_nil;
@@ -3524,7 +3524,7 @@ STRlikewrap3(bit *ret, const str *s, con
 }
 
 static str
-STRlikewrap(bit *ret, const str *s, const str *pat)
+STRlikewrap(bit *ret, const char *const *s, const char *const *pat)
 {
if (strNil(*s) || strNil(*pat))
*ret = bit_nil;
@@ -3534,7 +3534,7 @@ STRlikewrap(bit *ret, const str *s, cons
 }
 
 static str
-STRtostr(str *res, const str *src)
+STRtostr(str *res, const char *const *src)
 {
if (*src == 0)
*res = GDKstrdup(str_nil);
@@ -3546,7 +3546,7 @@ STRtostr(str *res, const str *src)
 }
 
 static str
-STRLength(int *res, const str *arg1)
+STRLength(int *res, const char *const *arg1)
 {
const char *s = *arg1;
 
@@ -3555,7 +3555,7 @@ STRLength(int *res, const str *arg1)
 }
 
 static str
-STRBytes(int *res, const str *arg1)
+STRBytes(int *res, const char *const *arg1)
 {
const char *s = *arg1;
 
@@ -3579,7 +3579,7 @@ str_tail(str *buf, size_t *buflen, const
 }
 
 static str
-STRTail(str *res, const str *arg1, const int *offset)
+STRTail(str *res, const char *const *arg1, const int *offset)
 {
str buf = NULL, msg = MAL_SUCCEED;
const char *s = *arg1;
@@ -3635,7 +3635,7 @@ str_Sub_String(str *buf, size_t *buflen,
 }
 
 static str
-STRSubString(str *res, const str *arg1, const int *offset, const int *length)
+STRSubString(str *res, const char *const *arg1, const int *offset, const int 
*length)
 {
str buf = NULL, msg = MAL_SUCCEED;
const char *s = *arg1;
@@ -3724,7 +3724,7 @@ str_wchr_at(int *res, const char *s, int
 }
 
 static str
-STRWChrAt(int *res, const str *arg1, const int *at)
+STRWChrAt(int *res, const char *const *arg1, const int *at)
 {
return str_wchr_at(res, *arg1, *at);
 }
@@ -3737,7 +3737,7 @@ str_lower(str *buf, size_t *buflen, cons
 }
 
 static inline str
-STRlower(str *res, const str *arg1)
+STRlower(str *res, const char *const *arg1)
 {
str buf = NULL, msg = MAL_SUCCEED;
const char *s = *arg1;
@@ -3778,7 +3778,7 @@ str_upper(str *buf, size_t *buflen, cons
 }
 
 static str
-STRupper(str *res, const str *arg1)
+STRupper(str *res, const char *const *arg1)
 {
str buf = NULL, msg = MAL_SUCCEED;
const char *s = *arg1;
@@ -3974,10 +3974,11 @@ STRstr_search(Client cntxt, MalBlkPtr mb
(void) cntxt;
(void) mb;
bit *res = getArgReference(stk, pci, 0);
-   const str *haystack = getArgReference(stk, pci, 1),
-   *needle = getArgReference(stk, pci, 2);
+   const char *const *haystack = getArgReference(stk, pci, 1);
+   const char *const *needle = getArgReference(stk, pci, 2);
bit icase = pci->argc == 4 && *getArgReference_bit(stk, pci, 3);
-   str s = *haystack, h = *needle, msg = MAL_SUCCEED;
+   const char *s = *haystack, *h = *needle;
+   char *msg = MAL_SUCCEED;
if (strNil(s) || strNil(h)) {
*res = bit_nil;
} else {
@@ -4035,10 +4036,11 @@ STRrevstr_search(Client cntxt, MalBlkPtr
(void) cntxt;
(void) mb;
bit *res = getArgReference(stk, pci, 0);
-   const str *haystack = getArgReference(stk, pci, 1);
-   const str *needle = getArgReference(stk, pci, 2);
+   const char *const *haystack = getArgReference(stk, pci, 1);
+   const char *const *needle = getArgReference(stk, pci, 2);
bit icase = pci->argc == 4 && *getArgReference_bit(stk, pci, 3);
-   str s = *haystack, h = *needle, msg = MAL_SUCCEED;
+   const char *s = *haystack, *h = *needle;
+   char *msg = MAL_SUCCEED;
if (strNil(s) || strNil(h)) {
*res = bit_nil;
} else {
@@ -4207,7 +4209,7 @@ str_strip(str *buf, size_t *buflen, cons
 
 /* remove all whitespace from either side of arg1 */
 static str
-STRStrip(str *res, const str *arg1)
+STRStrip(str *res, const char *const *arg1)
 {
str buf = NULL, msg = MAL_SUCCEED;
const char *s = *arg1;
@@ -4248,7 +4250,7 @@ str_ltrim(str *buf, size_t *buflen, cons
 
 /* remove all whitespace from the start (left) of arg1 */
 static str
-STRLtrim(str *res, 

MonetDB: ascii-flag - Some more UTF-8 stuff.

2024-05-03 Thread Sjoerd Mullender via checkin-list
Changeset: e764818e0173 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e764818e0173
Modified Files:
clients/mapiclient/mclient.c
Branch: ascii-flag
Log Message:

Some more UTF-8 stuff.


diffs (truncated from 313 to 300 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -103,9 +103,6 @@ typedef int64_t timertype;
 
 static timertype t0, t1;   /* used for timing */
 
-#define UTF8BOM"\xEF\xBB\xBF"  /* UTF-8 encoding of Unicode 
BOM */
-#define UTF8BOMLENGTH  3   /* length of above */
-
 /* Pagination and simple ASCII-based rendering is provided for SQL
  * sessions. The result set size is limited by the cache size of the
  * Mapi Library. It is sufficiently large to accommodate most result
@@ -173,6 +170,53 @@ static char *nullstring = default_nullst
 #include 
 #include "mhelp.h"
 
+/* The code starting here, and up to and including the function decode
+ * below are copyright Bjoern Hoehrmann per the below notice.
+ *
+ * The function decode provides a fast way to check for valid UTF-8
+ * sequences and returns the value of the codepoint as well.  */
+
+// Copyright (c) 2008-2009 Bjoern Hoehrmann 
+// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
+
+#define UTF8_ACCEPT 0
+#define UTF8_REJECT 12
+
+static const uint8_t utf8d[] = {
+   // The first part of the table maps bytes to character classes that
+   // to reduce the size of the transition table and create bitmasks.
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
+7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+   10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
+
+   // The second part is a transition table that maps a combination
+   // of a state of the automaton and a character class to a state.
+0,12,24,36,60,96,84,12,12,12,48,72, 
12,12,12,12,12,12,12,12,12,12,12,12,
+   12, 0,12,12,12,12,12, 0,12, 0,12,12, 
12,24,12,12,12,12,12,24,12,24,12,12,
+   12,12,12,12,12,12,12,24,12,12,12,12, 
12,24,12,12,12,12,12,12,12,24,12,12,
+   12,12,12,12,12,12,12,36,12,36,12,12, 
12,36,12,12,12,12,12,36,12,36,12,12,
+   12,36,12,12,12,12,12,12,12,12,12,12,
+};
+
+static inline uint32_t
+decode(uint32_t *state, uint32_t *codep, uint32_t byte)
+{
+   uint32_t type = utf8d[byte];
+
+   *codep = (*state != UTF8_ACCEPT) ?
+   (byte & 0x3fu) | (*codep << 6) :
+   (0xff >> type) & (byte);
+
+   *state = utf8d[256 + *state + type];
+   return *state;
+}
+/* end code copyright by Bjoern Hoehrmann */
+
 static timertype
 gettime(void)
 {
@@ -590,69 +634,32 @@ static size_t
 utf8strlenmax(char *s, char *e, size_t max, char **t)
 {
size_t len = 0, len0 = 0;
-   int c;
-   int n;
char *t0 = s;
 
assert(max == 0 || t != NULL);
if (s == NULL)
return 0;
-   c = 0;
-   n = 0;
-   while (*s != 0 && (e == NULL || s < e)) {
-   if (*s == '\n') {
-   assert(n == 0);
-   if (max) {
-   *t = s;
-   return len;
+
+   uint32_t state = 0, codepoint = 0;
+   while (*s && (e == NULL || s < e)) {
+   switch (decode(, , (uint8_t) *s++)) {
+   case UTF8_ACCEPT:
+   if (codepoint == '\n') {
+   if (max) {
+   *t = s;
+   return len;
+   }
+   len++;
+   } else if (codepoint == '\t') {
+   len++;  /* rendered as single 
space */
+   } else if (codepoint <= 0x1F || codepoint == 0177) {
+   len += 4;   /* control, rendered as 
"\\%03o" */
+   } else if (0x80 <= codepoint && codepoint <= 0x9F) {
+   len += 6;   /* control, rendered as 
"u\\%04x" */
+   } else {
+   /* charwidth() returning -1 is caught by the 
above */
+   len += charwidth(codepoint);
}
-   len++;
-   n = 0;
-   } else if (*s == '\t') {
-   assert(n == 0);
-   len++;  /* rendered as single space */

MonetDB: ascii-flag - Ignore rest of line after write error in i...

2024-05-03 Thread Sjoerd Mullender via checkin-list
Changeset: dce9b89338b2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/dce9b89338b2
Modified Files:
clients/mapiclient/iconv-stream.h
sql/test/emptydb/Tests/check.stable.out
sql/test/mapi/Tests/utf8test.SQL.py
Branch: ascii-flag
Log Message:

Ignore rest of line after write error in iconv + some small fixes.


diffs (160 lines):

diff --git a/clients/mapiclient/iconv-stream.h 
b/clients/mapiclient/iconv-stream.h
--- a/clients/mapiclient/iconv-stream.h
+++ b/clients/mapiclient/iconv-stream.h
@@ -3,7 +3,8 @@
 struct ic_priv_t {
stream *s;
iconv_t cd;
-   bool eof;
+   bool eof:1;
+   bool err:1;
size_t buflen;
char buffer[BUFSIZ];
 };
@@ -22,7 +23,7 @@ ic_read(void *restrict private, void *re
while (outbytesleft > 0 && !ic->eof) {
if (ic->buflen == sizeof(ic->buffer)) {
/* ridiculously long multibyte sequence, return error */
-   fprintf(stderr, "multibyte sequence too long");
+   fprintf(stderr, "multibyte sequence too long\n");
return -1;
}
 
@@ -37,12 +38,12 @@ ic_read(void *restrict private, void *re
ic->eof = true;
if (ic->buflen > 0) {
/* incomplete input */
-   fprintf(stderr, "incomplete input");
+   fprintf(stderr, "incomplete input\n");
return -1;
}
if (iconv(ic->cd, NULL, NULL, , ) 
== (size_t) -1) {
/* some error occurred */
-   fprintf(stderr, "iconv reported an error");
+   fprintf(stderr, "iconv reported an error\n");
return -1;
}
goto exit_func; /* double break */
@@ -56,7 +57,7 @@ ic_read(void *restrict private, void *re
if (iconv(ic->cd, , , , ) 
== (size_t) -1) {
switch (errno) {
case EILSEQ:
-   fprintf(stderr, "invalid multibyte sequence");
+   fprintf(stderr, "invalid multibyte sequence\n");
return -1;
case EINVAL:
/* incomplete multibyte sequence encountered */
@@ -67,7 +68,7 @@ ic_read(void *restrict private, void *re
 * the buffer */
goto exit_func;
default:
-   fprintf(stderr, "iconv reported an error");
+   fprintf(stderr, "iconv reported an error\n");
return -1;
}
}
@@ -100,8 +101,17 @@ ic_write(void *restrict private, const v
char *bf = NULL;
 
if (ic == NULL) {
-   fprintf(stderr, "stream already ended");
-   goto bailout;
+   fprintf(stderr, "stream already ended\n");
+   return -1;
+   }
+
+   if (ic->err) {
+   for (size_t i = 0; i < inbytesleft; i++)
+   if (inbuf[i] == '\n') {
+   ic->err = false;
+   break;
+   }
+   return -1;
}
 
/* if unconverted data from a previous call remains, add it to
@@ -110,12 +120,12 @@ ic_write(void *restrict private, const v
bf = malloc(ic->buflen + inbytesleft);
if (bf == NULL) {
/* cannot allocate memory */
-   fprintf(stderr, "out of memory");
+   fprintf(stderr, "out of memory\n");
goto bailout;
}
memcpy(bf, ic->buffer, ic->buflen);
memcpy(bf + ic->buflen, buf, inbytesleft);
-   buf = bf;
+   inbuf = bf;
inbytesleft += ic->buflen;
ic->buflen = 0;
}
@@ -127,7 +137,7 @@ ic_write(void *restrict private, const v
switch (errno) {
case EILSEQ:
/* invalid multibyte sequence encountered */
-   fprintf(stderr, "invalid multibyte sequence");
+   fprintf(stderr, "invalid multibyte sequence\n");
goto bailout;
case EINVAL:
/* incomplete multibyte sequence
@@ -135,7 +145,7 @@ ic_write(void *restrict private, const v
 * converted */
if (outbytesleft < sizeof(ic->buffer) &&
mnstr_write(ic->s, ic->buffer, 1, 

MonetDB: ascii-flag - Tell streamcat where to find iconv.

2024-05-03 Thread Sjoerd Mullender via checkin-list
Changeset: 547ae0132fe5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/547ae0132fe5
Modified Files:
clients/examples/C/CMakeLists.txt
Branch: ascii-flag
Log Message:

Tell streamcat where to find iconv.


diffs (20 lines):

diff --git a/clients/examples/C/CMakeLists.txt 
b/clients/examples/C/CMakeLists.txt
--- a/clients/examples/C/CMakeLists.txt
+++ b/clients/examples/C/CMakeLists.txt
@@ -45,13 +45,15 @@ add_executable(streamcat
 
 target_include_directories(streamcat
   PRIVATE
+  $<$:${CMAKE_REQUIRED_INCLUDES}>
   ../../mapiclient)
 
 target_link_libraries(streamcat
   PRIVATE
   monetdb_config_header
   stream
-  $<$:CURL::libcurl>)
+  $<$:CURL::libcurl>
+  $<$:Iconv::Iconv>)
 
 add_executable(testcondvar
   testcondvar.c)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Merge with default branch.

2024-05-03 Thread Sjoerd Mullender via checkin-list
Changeset: 2a557cc30013 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2a557cc30013
Modified Files:
gdk/gdk_bat.c
gdk/gdk_bbp.c
Branch: ascii-flag
Log Message:

Merge with default branch.


diffs (truncated from 2467 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -825,3 +825,4 @@ dcc8c702e685a4faf21ccf663028d1bc3d1165d1
 dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_SP1_release
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_7
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_SP2_release
+9a694c41042503a22d6c92aeab5bc4ca1912b62e Dec2023_9
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -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-SP2/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP3/%{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
@@ -916,6 +916,25 @@ fi
 %endif
 
 %changelog
+* Thu May 02 2024 Sjoerd Mullender  - 11.49.9-20240502
+- Rebuilt.
+- GH#7422: Aggregate functions with variadic arguments
+- GH#7472: MonetDB server crashes in `tail_type`
+- GH#7473: MonetDB server crashes in `SQLunionfunc`
+- GH#7478: MonetDB server crashes in `exp_equal`
+- GH#7496: Query on view fails to produce a resultset. Assertion triggered
+  in rel2bin_select.
+- GH#7499: create schema + set schema inside a transaction that is rolled
+  back causes the connection to be aborted
+- GH#7501: files remain in backup causing problems at restart
+- GH#7503: MonetDB server crashes using `WHEN MATCHED THEN UPDATE`
+- GH#7504: possible deadlock when a bat is made persistent when it is also
+  getting unloaded
+- GH#7506: MonetDB Dec2023-SP2 crashes at `rel_value_exp2`
+- GH#7507: BBPextend: ERROR: trying to extend BAT pool beyond the limit
+  (16384)
+- GH#7508: MonetDB Dec2023-SP2 crashes at `exp_ref`
+
 * Tue Apr 09 2024 Sjoerd Mullender  - 11.49.7-20240409
 - Rebuilt.
 - GH#7469: Crash when using `CONTAINS`
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -1777,6 +1777,11 @@ mapi_new(msettings *settings)
Mapi mid;
static ATOMIC_TYPE index = ATOMIC_VAR_INIT(0);
 
+   if (!ATOMIC_TAS(_initialized)) {
+   if (mnstr_init() < 0)
+   return NULL;
+   }
+
mid = malloc(sizeof(*mid));
if (mid == NULL)
return NULL;
@@ -1885,11 +1890,6 @@ mapi_mapiuri(const char *url, const char
 {
Mapi mid;
 
-   if (!ATOMIC_TAS(_initialized)) {
-   if (mnstr_init() < 0)
-   return NULL;
-   }
-
mid = mapi_new(NULL);
if (mid == NULL)
return NULL;
@@ -1944,11 +1944,6 @@ mapi_mapi(const char *host, int port, co
 {
Mapi mid;
 
-   if (!ATOMIC_TAS(_initialized)) {
-   if (mnstr_init() < 0)
-   return NULL;
-   }
-
mid = mapi_new(NULL);
if (mid == NULL)
return NULL;
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -44,19 +44,19 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # common/options and common/utils)
 set(GDK_VERSION_MAJOR "28")
 set(GDK_VERSION_MINOR "1")
-set(GDK_VERSION_PATCH "2")
+set(GDK_VERSION_PATCH "3")
 set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 # version of the MAPI library (subdirectory clients/mapilib)
 set(MAPI_VERSION_MAJOR "26")
 set(MAPI_VERSION_MINOR "2")
-set(MAPI_VERSION_PATCH "1")
+set(MAPI_VERSION_PATCH "2")
 set(MAPI_VERSION 
"${MAPI_VERSION_MAJOR}.${MAPI_VERSION_MINOR}.${MAPI_VERSION_PATCH}")
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras 
or sql)
 set(MONETDB5_VERSION_MAJOR "35")
 set(MONETDB5_VERSION_MINOR "0")
-set(MONETDB5_VERSION_PATCH "3")
+set(MONETDB5_VERSION_PATCH "4")
 set(MONETDB5_VERSION 
"${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_MINOR}.${MONETDB5_VERSION_PATCH}")
 
 # version of the MONETDBE library (subdirectory tools/monetdbe)
@@ -74,5 +74,5 @@ set(STREAM_VERSION "${STREAM_VERSION_MAJ
 # version of the SQL library (subdirectory sql)
 set(SQL_VERSION_MAJOR "14")
 set(SQL_VERSION_MINOR "1")
-set(SQL_VERSION_PATCH "3")
+set(SQL_VERSION_PATCH "4")
 set(SQL_VERSION 
"${SQL_VERSION_MAJOR}.${SQL_VERSION_MINOR}.${SQL_VERSION_PATCH}")
diff --git a/common/utils/GenerateVersionHeader.cmake 
b/common/utils/GenerateVersionHeader.cmake
--- a/common/utils/GenerateVersionHeader.cmake
+++ b/common/utils/GenerateVersionHeader.cmake
@@ -18,34 +18,34 @@ elseif(EXISTS "${DIR}/.hg")
   find_package(Hg)
   if(HG_FOUND)
 message("hg 

MonetDB: ascii-flag - Move iconv support out of stream library s...

2024-05-03 Thread Sjoerd Mullender via checkin-list
Changeset: 104cf6f8b939 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/104cf6f8b939
Added Files:
clients/mapiclient/iconv-stream.h
Removed Files:
common/stream/iconv_stream.c
Modified Files:
clients/Tests/exports.stable.out
clients/examples/C/streamcat.c
clients/mapiclient/CMakeLists.txt
clients/mapiclient/mclient.c
common/stream/CMakeLists.txt
common/stream/monetdb-stream.pc.in
common/stream/stdio_stream.c
common/stream/stream.h
common/stream/stream_internal.h
testing/CMakeLists.txt
testing/Mtest.py.in
Branch: ascii-flag
Log Message:

Move iconv support out of stream library so that mserver doesn't carry it 
around.


diffs (truncated from 1051 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
@@ -1680,8 +1680,6 @@ FILE *getFile(stream *s);
 int getFileNo(stream *s);
 size_t getFileSize(stream *s);
 stream *gz_stream(stream *inner, int preset);
-stream *iconv_rstream(stream *restrict ss, const char *restrict charset, const 
char *restrict name);
-stream *iconv_wstream(stream *restrict ss, const char *restrict charset, const 
char *restrict name);
 bool isa_block_stream(const stream *s);
 stream *lz4_stream(stream *inner, int preset);
 stream *mapi_request_download(const char *filename, bool binary, bstream *rs, 
stream *ws);
diff --git a/clients/examples/C/streamcat.c b/clients/examples/C/streamcat.c
--- a/clients/examples/C/streamcat.c
+++ b/clients/examples/C/streamcat.c
@@ -473,6 +473,40 @@ opener_wastream(char *filename)
 }
 
 
+#ifdef HAVE_ICONV
+#include "iconv-stream.h"
+#else
+static stream *
+iconv_rstream(stream *restrict ss, const char *restrict charset, const char 
*restrict name)
+{
+   if (ss == NULL || charset == NULL || name == NULL)
+   return NULL;
+   if (ss->isutf8 ||
+   strcmp(charset, "utf-8") == 0 ||
+   strcmp(charset, "UTF-8") == 0 ||
+   strcmp(charset, "UTF8") == 0)
+   return ss;
+
+   fprintf(stderr, "ICONV support has been left out of this MonetDB");
+   return NULL;
+}
+
+static stream *
+iconv_wstream(stream *restrict ss, const char *restrict charset, const char 
*restrict name)
+{
+   if (ss == NULL || charset == NULL || name == NULL)
+   return NULL;
+   if (ss->isutf8 ||
+   strcmp(charset, "utf-8") == 0 ||
+   strcmp(charset, "UTF-8") == 0 ||
+   strcmp(charset, "UTF8") == 0)
+   return ss;
+
+   fprintf(stderr, "ICONV support has been left out of this MonetDB");
+   return NULL;
+}
+#endif
+
 static stream *
 wrapper_read_iconv(stream *s, char *enc)
 {
diff --git a/clients/mapiclient/CMakeLists.txt 
b/clients/mapiclient/CMakeLists.txt
--- a/clients/mapiclient/CMakeLists.txt
+++ b/clients/mapiclient/CMakeLists.txt
@@ -39,10 +39,12 @@ target_sources(mclient
   ReadlineTools.h
   mhelp.c
   mhelp.h
+  iconv-stream.h
   curl-stream.h)
 
 target_include_directories(mclient
   PRIVATE
+  $<$:${CMAKE_REQUIRED_INCLUDES}>
   $<$:${HAVE_GETOPT_H}>)
 
 target_link_libraries(mclient
diff --git a/clients/mapiclient/iconv-stream.h 
b/clients/mapiclient/iconv-stream.h
new file mode 100644
--- /dev/null
+++ b/clients/mapiclient/iconv-stream.h
@@ -0,0 +1,256 @@
+#include 
+
+struct ic_priv_t {
+   stream *s;
+   iconv_t cd;
+   bool eof;
+   size_t buflen;
+   char buffer[BUFSIZ];
+};
+
+static ssize_t
+ic_read(void *restrict private, void *restrict buf, size_t elmsize, size_t cnt)
+{
+   struct ic_priv_t *ic = private;
+   char *inbuf = ic->buffer;
+   size_t inbytesleft = ic->buflen;
+   char *outbuf = buf;
+   size_t outbytesleft = elmsize * cnt;
+
+   if (outbytesleft == 0)
+   return 0;
+   while (outbytesleft > 0 && !ic->eof) {
+   if (ic->buflen == sizeof(ic->buffer)) {
+   /* ridiculously long multibyte sequence, return error */
+   fprintf(stderr, "multibyte sequence too long");
+   return -1;
+   }
+
+   switch (mnstr_read(ic->s, ic->buffer + ic->buflen, 1, 1)) {
+   case 1:
+   /* expected: read one byte */
+   ic->buflen++;
+   inbytesleft++;
+   break;
+   case 0:
+   /* end of file */
+   ic->eof = true;
+   if (ic->buflen > 0) {
+   /* incomplete input */
+   fprintf(stderr, "incomplete input");
+   return -1;
+   }
+   if (iconv(ic->cd, NULL, NULL, , ) 
== (size_t) -1) {
+   /* some error occurred */
+   

MonetDB: ascii-flag - Use a single source for open_urlstream (CU...

2024-05-03 Thread Sjoerd Mullender via checkin-list
Changeset: f3c92bdfb810 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f3c92bdfb810
Added Files:
clients/mapiclient/curl-stream.h
Modified Files:
clients/examples/C/CMakeLists.txt
clients/examples/C/streamcat.c
clients/mapiclient/CMakeLists.txt
Branch: ascii-flag
Log Message:

Use a single source for open_urlstream (CURL support).


diffs (182 lines):

diff --git a/clients/examples/C/CMakeLists.txt 
b/clients/examples/C/CMakeLists.txt
--- a/clients/examples/C/CMakeLists.txt
+++ b/clients/examples/C/CMakeLists.txt
@@ -43,6 +43,10 @@ target_link_libraries(smack01
 add_executable(streamcat
   streamcat.c)
 
+target_include_directories(streamcat
+  PRIVATE
+  ../../mapiclient)
+
 target_link_libraries(streamcat
   PRIVATE
   monetdb_config_header
diff --git a/clients/examples/C/streamcat.c b/clients/examples/C/streamcat.c
--- a/clients/examples/C/streamcat.c
+++ b/clients/examples/C/streamcat.c
@@ -437,68 +437,20 @@ opener_rastream(char *filename)
 }
 
 #ifdef HAVE_CURL
-#include 
-
-#ifndef CURL_WRITEFUNC_ERROR
-#define CURL_WRITEFUNC_ERROR 0
-#endif
-
-static size_t
-write_callback(char *buffer, size_t size, size_t nitems, void *userp)
-{
-   stream *s = userp;
-
-   /* size is expected to always be 1 */
-
-   ssize_t sz = mnstr_write(s, buffer, size, nitems);
-   if (sz < 0)
-   return CURL_WRITEFUNC_ERROR; /* indicate failure to library */
-   return (size_t) sz * size;
-}
+#include "curl-stream.h"
 
 static stream *
-open_urlstream(const char *url)
+opener_urlstream(char *url)
 {
-   CURL *handle;
-   stream *s;
-   CURLcode ret;
char errbuf[CURL_ERROR_SIZE];
-
-   s = buffer_wastream(NULL, url);
-   if (s == NULL) {
-   return NULL;
-   }
-
-   if ((handle = curl_easy_init()) == NULL) {
-   mnstr_destroy(s);
-   return NULL;
-   }
-
-   errbuf[0] = 0;
-
-   if ((ret = curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, errbuf)) != 
CURLE_OK ||
-   (ret = curl_easy_setopt(handle, CURLOPT_URL, url)) != CURLE_OK ||
-   (ret = curl_easy_setopt(handle, CURLOPT_WRITEDATA, s)) != CURLE_OK 
||
-   (ret = curl_easy_setopt(handle, CURLOPT_VERBOSE, 0)) != CURLE_OK ||
-   (ret = curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1)) != CURLE_OK ||
-   (ret = curl_easy_setopt(handle, CURLOPT_FAILONERROR, 1)) != 
CURLE_OK ||
-   (ret = curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, 
write_callback)) != CURLE_OK ||
-   (ret = curl_easy_perform(handle)) != CURLE_OK) {
-   curl_easy_cleanup(handle);
-   mnstr_destroy(s);
-   if (errbuf[0])
-   fprintf(stderr, "%s\n", errbuf);
-   else
-   fprintf(stderr, "%s\n", curl_easy_strerror(ret));
-   return NULL;
-   }
-   curl_easy_cleanup(handle);
-   (void) mnstr_get_buffer(s); /* switch to read-only */
+   stream *s = open_urlstream(url,  errbuf);
+   if (s == NULL)
+   fprintf(stderr, "%s\n", errbuf);
return s;
 }
 #else
 static stream *
-open_urlstream(const char *url)
+opener_urlstream(char *url)
 {
(void) url;
return NULL;
@@ -506,13 +458,6 @@ open_urlstream(const char *url)
 #endif
 
 static stream *
-opener_urlstream(char *url)
-{
-   stream *s = open_urlstream(url);
-   return s;
-}
-
-static stream *
 opener_wstream(char *filename)
 {
stream *s = open_wstream(filename);
diff --git a/clients/mapiclient/CMakeLists.txt 
b/clients/mapiclient/CMakeLists.txt
--- a/clients/mapiclient/CMakeLists.txt
+++ b/clients/mapiclient/CMakeLists.txt
@@ -38,7 +38,8 @@ target_sources(mclient
   ReadlineTools.c
   ReadlineTools.h
   mhelp.c
-  mhelp.h)
+  mhelp.h
+  curl-stream.h)
 
 target_include_directories(mclient
   PRIVATE
diff --git a/clients/mapiclient/curl-stream.h b/clients/mapiclient/curl-stream.h
new file mode 100644
--- /dev/null
+++ b/clients/mapiclient/curl-stream.h
@@ -0,0 +1,58 @@
+#include 
+
+#ifndef CURL_WRITEFUNC_ERROR
+#define CURL_WRITEFUNC_ERROR 0
+#endif
+
+static size_t
+write_callback(char *buffer, size_t size, size_t nitems, void *userp)
+{
+   stream *s = userp;
+
+   /* size is expected to always be 1 */
+
+   ssize_t sz = mnstr_write(s, buffer, size, nitems);
+   if (sz < 0)
+   return CURL_WRITEFUNC_ERROR; /* indicate failure to library */
+   return (size_t) sz * size;
+}
+
+static stream *
+open_urlstream(const char *url, char *errbuf)
+{
+   CURL *handle;
+   stream *s;
+   CURLcode ret;
+
+   s = buffer_wastream(NULL, url);
+   if (s == NULL) {
+   snprintf(errbuf, CURL_ERROR_SIZE, "could not allocate memory");
+   return NULL;
+   }
+
+   if ((handle = curl_easy_init()) == NULL) {
+   mnstr_destroy(s);
+   snprintf(errbuf, CURL_ERROR_SIZE, "could not create CURL 
handle");
+

MonetDB: Dec2023 - Rename test to correct SF bug number.

2024-05-02 Thread Sjoerd Mullender via checkin-list
Changeset: f3e52645a5bd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f3e52645a5bd
Added Files:

sql/test/BugTracker-2009/Tests/select_X_where_bla_EQ_whatever.SF-2825974.test
Removed Files:

sql/test/BugTracker-2009/Tests/select_X_where_bla_EQ_whatever.SF-282597.test
Modified Files:
sql/test/BugTracker-2009/Tests/All
Branch: Dec2023
Log Message:

Rename test to correct SF bug number.


diffs (15 lines):

diff --git a/sql/test/BugTracker-2009/Tests/All 
b/sql/test/BugTracker-2009/Tests/All
--- a/sql/test/BugTracker-2009/Tests/All
+++ b/sql/test/BugTracker-2009/Tests/All
@@ -69,7 +69,7 @@ utf8_bug.SF-2822855
 reorder.SF-2770608
 orIssue.SF-2812504
 recursion-problem.SF-2827784
-select_X_where_bla_EQ_whatever.SF-282597
+select_X_where_bla_EQ_whatever.SF-2825974
 rollback_mistake.SF-2814622
 numeric_data_type_bug.SF-2818176
 insert_into_values_bug.SF-2807609
diff --git 
a/sql/test/BugTracker-2009/Tests/select_X_where_bla_EQ_whatever.SF-282597.test 
b/sql/test/BugTracker-2009/Tests/select_X_where_bla_EQ_whatever.SF-2825974.test
rename from 
sql/test/BugTracker-2009/Tests/select_X_where_bla_EQ_whatever.SF-282597.test
rename to 
sql/test/BugTracker-2009/Tests/select_X_where_bla_EQ_whatever.SF-2825974.test
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Enable test.

2024-05-02 Thread Sjoerd Mullender via checkin-list
Changeset: 2b3f9e72cae9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2b3f9e72cae9
Modified Files:
sql/test/BugTracker-2024/Tests/sql_init_subtype-Bug-7487.test
Branch: Dec2023
Log Message:

Enable test.


diffs (18 lines):

diff --git a/sql/test/BugTracker-2024/Tests/sql_init_subtype-Bug-7487.test 
b/sql/test/BugTracker-2024/Tests/sql_init_subtype-Bug-7487.test
--- a/sql/test/BugTracker-2024/Tests/sql_init_subtype-Bug-7487.test
+++ b/sql/test/BugTracker-2024/Tests/sql_init_subtype-Bug-7487.test
@@ -8,13 +8,11 @@ SELECT levenshtein ( 'Xint' , '2014-10-2
 
 14
 
-skipif knownfail
 query I nosort
 SELECT levenshtein ( 'int' , 'X2014-10-25 UTC' )
 
-14
+15
 
-skipif knownfail
 query I nosort
 SELECT levenshtein ( 'int' , '2014-10-25 UTC' )
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - No API changes allowed.

2024-05-02 Thread Sjoerd Mullender via checkin-list
Changeset: 4141f64e7027 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4141f64e7027
Modified Files:
sql/backends/monet5/UDF/udf/udf.c
sql/backends/monet5/UDF/udf/udf.h
Branch: Dec2023
Log Message:

No API changes allowed.


diffs (28 lines):

diff --git a/sql/backends/monet5/UDF/udf/udf.c 
b/sql/backends/monet5/UDF/udf/udf.c
--- a/sql/backends/monet5/UDF/udf/udf.c
+++ b/sql/backends/monet5/UDF/udf/udf.c
@@ -77,10 +77,9 @@ UDFreverse_(str *buf, size_t *buflen, co
 
 /* MAL wrapper */
 str
-UDFreverse(str *res, const char *const *arg)
+UDFreverse(str *res, const str *arg)
 {
-   str msg = MAL_SUCCEED;
-   const char *s;
+   str msg = MAL_SUCCEED, s;
 
/* assert calling sanity */
assert(res && arg);
diff --git a/sql/backends/monet5/UDF/udf/udf.h 
b/sql/backends/monet5/UDF/udf/udf.h
--- a/sql/backends/monet5/UDF/udf/udf.h
+++ b/sql/backends/monet5/UDF/udf/udf.h
@@ -33,7 +33,7 @@
 
 /* export MAL wrapper functions */
 
-udf_export str UDFreverse(str *ret, const char *const *arg);
+udf_export str UDFreverse(str *ret, const str *arg);
 udf_export str UDFBATreverse(bat *ret, const bat *arg);
 
 /* using C macro for convenient type-expansion */
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Properly use const for str parameters to C st...

2024-05-02 Thread Sjoerd Mullender via checkin-list
Changeset: 90933e6c6b36 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/90933e6c6b36
Modified Files:
monetdb5/modules/atoms/str.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/txtsim.c
sql/backends/monet5/UDF/udf/udf.c
sql/backends/monet5/UDF/udf/udf.h
sql/backends/monet5/sql_user.c
sql/backends/monet5/sql_user.h
Branch: Dec2023
Log Message:

Properly use const for str parameters to C stubs for MAL functions.
const str *val (which was used in many places) is not the same as const
* const *val (which is what it really is).
The pointer itself can be changed (i.e. val), but not *val and not
**val, since they belong to the caller.
This also fixes #7509.  But Lucas, please take a closer look.


diffs (truncated from 982 to 300 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -3488,7 +3488,7 @@ STRlike(const char *s, const char *pat, 
 }
 
 static str
-STRlikewrap3(bit *ret, const str *s, const str *pat, const str *esc)
+STRlikewrap3(bit *ret, const char *const *s, const char *const *pat, const 
char *const *esc)
 {
if (strNil(*s) || strNil(*pat) || strNil(*esc))
*ret = bit_nil;
@@ -3498,7 +3498,7 @@ STRlikewrap3(bit *ret, const str *s, con
 }
 
 static str
-STRlikewrap(bit *ret, const str *s, const str *pat)
+STRlikewrap(bit *ret, const char *const *s, const char *const *pat)
 {
if (strNil(*s) || strNil(*pat))
*ret = bit_nil;
@@ -3508,7 +3508,7 @@ STRlikewrap(bit *ret, const str *s, cons
 }
 
 static str
-STRtostr(str *res, const str *src)
+STRtostr(str *res, const char *const *src)
 {
if (*src == 0)
*res = GDKstrdup(str_nil);
@@ -3520,7 +3520,7 @@ STRtostr(str *res, const str *src)
 }
 
 static str
-STRLength(int *res, const str *arg1)
+STRLength(int *res, const char *const *arg1)
 {
const char *s = *arg1;
 
@@ -3529,7 +3529,7 @@ STRLength(int *res, const str *arg1)
 }
 
 static str
-STRBytes(int *res, const str *arg1)
+STRBytes(int *res, const char *const *arg1)
 {
const char *s = *arg1;
 
@@ -3553,7 +3553,7 @@ str_tail(str *buf, size_t *buflen, const
 }
 
 static str
-STRTail(str *res, const str *arg1, const int *offset)
+STRTail(str *res, const char *const *arg1, const int *offset)
 {
str buf = NULL, msg = MAL_SUCCEED;
const char *s = *arg1;
@@ -3609,7 +3609,7 @@ str_Sub_String(str *buf, size_t *buflen,
 }
 
 static str
-STRSubString(str *res, const str *arg1, const int *offset, const int *length)
+STRSubString(str *res, const char *const *arg1, const int *offset, const int 
*length)
 {
str buf = NULL, msg = MAL_SUCCEED;
const char *s = *arg1;
@@ -3698,7 +3698,7 @@ str_wchr_at(int *res, const char *s, int
 }
 
 static str
-STRWChrAt(int *res, const str *arg1, const int *at)
+STRWChrAt(int *res, const char *const *arg1, const int *at)
 {
return str_wchr_at(res, *arg1, *at);
 }
@@ -3711,7 +3711,7 @@ str_lower(str *buf, size_t *buflen, cons
 }
 
 static inline str
-STRlower(str *res, const str *arg1)
+STRlower(str *res, const char *const *arg1)
 {
str buf = NULL, msg = MAL_SUCCEED;
const char *s = *arg1;
@@ -3752,7 +3752,7 @@ str_upper(str *buf, size_t *buflen, cons
 }
 
 static str
-STRupper(str *res, const str *arg1)
+STRupper(str *res, const char *const *arg1)
 {
str buf = NULL, msg = MAL_SUCCEED;
const char *s = *arg1;
@@ -3948,10 +3948,11 @@ STRstr_search(Client cntxt, MalBlkPtr mb
(void) cntxt;
(void) mb;
bit *res = getArgReference(stk, pci, 0);
-   const str *haystack = getArgReference(stk, pci, 1),
-   *needle = getArgReference(stk, pci, 2);
+   const char *const *haystack = getArgReference(stk, pci, 1);
+   const char *const *needle = getArgReference(stk, pci, 2);
bit icase = pci->argc == 4 && *getArgReference_bit(stk, pci, 3);
-   str s = *haystack, h = *needle, msg = MAL_SUCCEED;
+   const char *s = *haystack, *h = *needle;
+   char *msg = MAL_SUCCEED;
if (strNil(s) || strNil(h)) {
*res = bit_nil;
} else {
@@ -4009,10 +4010,11 @@ STRrevstr_search(Client cntxt, MalBlkPtr
(void) cntxt;
(void) mb;
bit *res = getArgReference(stk, pci, 0);
-   const str *haystack = getArgReference(stk, pci, 1);
-   const str *needle = getArgReference(stk, pci, 2);
+   const char *const *haystack = getArgReference(stk, pci, 1);
+   const char *const *needle = getArgReference(stk, pci, 2);
bit icase = pci->argc == 4 && *getArgReference_bit(stk, pci, 3);
-   str s = *haystack, h = *needle, msg = MAL_SUCCEED;
+   const char *s = *haystack, *h = *needle;
+   char *msg = MAL_SUCCEED;
if (strNil(s) || strNil(h)) {
*res = bit_nil;
} else {
@@ -4181,7 +4183,7 @@ 

MonetDB: default - Merge with Dec2023 branch, not changing any f...

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

Merge with Dec2023 branch, not changing any files..

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


MonetDB: Dec2023 - Post release build.

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

Post release build.


diffs (191 lines):

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 11.49.9
+current_version = 11.49.10
 commit = False
 tag = False
 
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.9
+%global version 11.49.10
 %{!?buildno: %global buildno %(date +%Y%m%d)}
 
 # Use bcond_with to add a --with option; i.e., "without" is default.
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,9)
-  PRODUCTVERSION version(11,49,9)
+  FILEVERSION version(11,49,10)
+  PRODUCTVERSION version(11,49,10)
   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,9)
+  VALUE "FileVersion", sversion(11,49,10)
   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,9)
+  VALUE "ProductVersion", sversion(11,49,10)
   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,9)
-  PRODUCTVERSION version(11,49,9)
+  FILEVERSION version(11,49,10)
+  PRODUCTVERSION version(11,49,10)
   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,9)
+  VALUE "FileVersion", sversion(11,49,10)
   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"
-  VALUE "ProductVersion", sversion(11,49,9)
+  VALUE "ProductVersion", sversion(11,49,10)
   VALUE "SpecialBuild", "\0"
 END
   END
diff --git a/clients/odbc/winsetup/setup.rc b/clients/odbc/winsetup/setup.rc
--- a/clients/odbc/winsetup/setup.rc
+++ b/clients/odbc/winsetup/setup.rc
@@ -65,8 +65,8 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION version(11,49,9)
- PRODUCTVERSION version(11,49,9)
+ FILEVERSION version(11,49,10)
+ PRODUCTVERSION version(11,49,10)
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -83,12 +83,12 @@ BEGIN
 BEGIN
 VALUE "CompanyName", "MonetDB Foundation"
 VALUE "FileDescription", "MonetDB ODBC Setup DLL"
-VALUE "FileVersion", sversion(11,49,9)
+VALUE "FileVersion", sversion(11,49,10)
 VALUE "InternalName", "MonetODBCs.dll"
 VALUE "LegalCopyright", "Copyright (c) 2024 MonetDB Foundation"
 VALUE "OriginalFilename", "MonetODBCs.dll"
 VALUE "ProductName", "MonetDB SQL Server"
-VALUE "ProductVersion", sversion(11,49,9)
+VALUE "ProductVersion", sversion(11,49,10)
 END
 END
 BLOCK "VarFileInfo"
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -12,10 +12,10 @@
 
 set(MONETDB_VERSION_MAJOR "11")
 set(MONETDB_VERSION_MINOR "49")
-set(MONETDB_VERSION_PATCH "9")
+set(MONETDB_VERSION_PATCH "10")
 
 if(RELEASE_VERSION)
-  set(MONETDB_RELEASE "Dec2023-SP3")
+  set(MONETDB_RELEASE "unreleased")
 endif()
 set(MONETDB_VERSION 
"${MONETDB_VERSION_MAJOR}.${MONETDB_VERSION_MINOR}.${MONETDB_VERSION_PATCH}")
 
diff --git a/gdk/libbat.rc b/gdk/libbat.rc
--- a/gdk/libbat.rc
+++ b/gdk/libbat.rc
@@ -6,8 +6,8 @@ 

MonetDB: default - Merge with Dec2023 branch.

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

Merge with Dec2023 branch.


diffs (163 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -825,3 +825,4 @@ dcc8c702e685a4faf21ccf663028d1bc3d1165d1
 dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_SP1_release
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_7
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_SP2_release
+9a694c41042503a22d6c92aeab5bc4ca1912b62e Dec2023_9
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -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-SP2/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP3/%{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
@@ -916,6 +916,25 @@ fi
 %endif
 
 %changelog
+* Thu May 02 2024 Sjoerd Mullender  - 11.49.9-20240502
+- Rebuilt.
+- GH#7422: Aggregate functions with variadic arguments
+- GH#7472: MonetDB server crashes in `tail_type`
+- GH#7473: MonetDB server crashes in `SQLunionfunc`
+- GH#7478: MonetDB server crashes in `exp_equal`
+- GH#7496: Query on view fails to produce a resultset. Assertion triggered
+  in rel2bin_select.
+- GH#7499: create schema + set schema inside a transaction that is rolled
+  back causes the connection to be aborted
+- GH#7501: files remain in backup causing problems at restart
+- GH#7503: MonetDB server crashes using `WHEN MATCHED THEN UPDATE`
+- GH#7504: possible deadlock when a bat is made persistent when it is also
+  getting unloaded
+- GH#7506: MonetDB Dec2023-SP2 crashes at `rel_value_exp2`
+- GH#7507: BBPextend: ERROR: trying to extend BAT pool beyond the limit
+  (16384)
+- GH#7508: MonetDB Dec2023-SP2 crashes at `exp_ref`
+
 * Tue Apr 09 2024 Sjoerd Mullender  - 11.49.7-20240409
 - Rebuilt.
 - GH#7469: Crash when using `CONTAINS`
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -44,19 +44,19 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # common/options and common/utils)
 set(GDK_VERSION_MAJOR "28")
 set(GDK_VERSION_MINOR "1")
-set(GDK_VERSION_PATCH "2")
+set(GDK_VERSION_PATCH "3")
 set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 # version of the MAPI library (subdirectory clients/mapilib)
 set(MAPI_VERSION_MAJOR "26")
 set(MAPI_VERSION_MINOR "2")
-set(MAPI_VERSION_PATCH "1")
+set(MAPI_VERSION_PATCH "2")
 set(MAPI_VERSION 
"${MAPI_VERSION_MAJOR}.${MAPI_VERSION_MINOR}.${MAPI_VERSION_PATCH}")
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras 
or sql)
 set(MONETDB5_VERSION_MAJOR "35")
 set(MONETDB5_VERSION_MINOR "0")
-set(MONETDB5_VERSION_PATCH "3")
+set(MONETDB5_VERSION_PATCH "4")
 set(MONETDB5_VERSION 
"${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_MINOR}.${MONETDB5_VERSION_PATCH}")
 
 # version of the MONETDBE library (subdirectory tools/monetdbe)
@@ -74,5 +74,5 @@ set(STREAM_VERSION "${STREAM_VERSION_MAJ
 # version of the SQL library (subdirectory sql)
 set(SQL_VERSION_MAJOR "14")
 set(SQL_VERSION_MINOR "1")
-set(SQL_VERSION_PATCH "3")
+set(SQL_VERSION_PATCH "4")
 set(SQL_VERSION 
"${SQL_VERSION_MAJOR}.${SQL_VERSION_MINOR}.${SQL_VERSION_PATCH}")
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,25 @@
+monetdb (11.49.9) unstable; urgency=low
+
+  * Rebuilt.
+  * GH#7422: Aggregate functions with variadic arguments
+  * GH#7472: MonetDB server crashes in `tail_type`
+  * GH#7473: MonetDB server crashes in `SQLunionfunc`
+  * GH#7478: MonetDB server crashes in `exp_equal`
+  * GH#7496: Query on view fails to produce a resultset. Assertion triggered
+in rel2bin_select.
+  * GH#7499: create schema + set schema inside a transaction that is rolled
+back causes the connection to be aborted
+  * GH#7501: files remain in backup causing problems at restart
+  * GH#7503: MonetDB server crashes using `WHEN MATCHED THEN UPDATE`
+  * GH#7504: possible deadlock when a bat is made persistent when it is also
+getting unloaded
+  * GH#7506: MonetDB Dec2023-SP2 crashes at `rel_value_exp2`
+  * GH#7507: BBPextend: ERROR: trying to extend BAT pool beyond the limit
+(16384)
+  * GH#7508: MonetDB Dec2023-SP2 crashes at `exp_ref`
+
+ -- Sjoerd Mullender   Thu, 02 May 2024 12:35:52 +0200
+
 monetdb (11.49.7) unstable; urgency=low
 
   * Rebuilt.
diff --git a/misc/packages/deb/changelog b/misc/packages/deb/changelog
--- a/misc/packages/deb/changelog
+++ b/misc/packages/deb/changelog
@@ -1,3 +1,25 @@
+monetdb (11.49.9) unstable; urgency=low
+
+ 

MonetDB: Dec2023 - Setting tag Dec2023_9 for the release build.

2024-05-02 Thread Sjoerd Mullender via checkin-list
Changeset: 54bb3db4f9df for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/54bb3db4f9df
Modified Files:
.hgtags
Branch: Dec2023
Log Message:

Setting tag Dec2023_9 for the release build.


diffs (8 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -825,3 +825,4 @@ dcc8c702e685a4faf21ccf663028d1bc3d1165d1
 dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_SP1_release
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_7
 d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_SP2_release
+9a694c41042503a22d6c92aeab5bc4ca1912b62e Dec2023_9
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


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

2024-05-02 Thread Sjoerd Mullender via checkin-list
Changeset: 9a694c410425 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9a694c410425
Modified Files:
MonetDB.spec
debian/changelog
misc/packages/deb/changelog
misc/packages/rpm/changelog
Branch: Dec2023
Log Message:

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


diffs (122 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -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-SP2/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP3/%{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
@@ -917,6 +917,25 @@ fi
 %endif
 
 %changelog
+* Thu May 02 2024 Sjoerd Mullender  - 11.49.9-20240502
+- Rebuilt.
+- GH#7422: Aggregate functions with variadic arguments
+- GH#7472: MonetDB server crashes in `tail_type`
+- GH#7473: MonetDB server crashes in `SQLunionfunc`
+- GH#7478: MonetDB server crashes in `exp_equal`
+- GH#7496: Query on view fails to produce a resultset. Assertion triggered
+  in rel2bin_select.
+- GH#7499: create schema + set schema inside a transaction that is rolled
+  back causes the connection to be aborted
+- GH#7501: files remain in backup causing problems at restart
+- GH#7503: MonetDB server crashes using `WHEN MATCHED THEN UPDATE`
+- GH#7504: possible deadlock when a bat is made persistent when it is also
+  getting unloaded
+- GH#7506: MonetDB Dec2023-SP2 crashes at `rel_value_exp2`
+- GH#7507: BBPextend: ERROR: trying to extend BAT pool beyond the limit
+  (16384)
+- GH#7508: MonetDB Dec2023-SP2 crashes at `exp_ref`
+
 * Tue Apr 09 2024 Sjoerd Mullender  - 11.49.7-20240409
 - Rebuilt.
 - GH#7469: Crash when using `CONTAINS`
diff --git a/debian/changelog b/debian/changelog
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,25 @@
+monetdb (11.49.9) unstable; urgency=low
+
+  * Rebuilt.
+  * GH#7422: Aggregate functions with variadic arguments
+  * GH#7472: MonetDB server crashes in `tail_type`
+  * GH#7473: MonetDB server crashes in `SQLunionfunc`
+  * GH#7478: MonetDB server crashes in `exp_equal`
+  * GH#7496: Query on view fails to produce a resultset. Assertion triggered
+in rel2bin_select.
+  * GH#7499: create schema + set schema inside a transaction that is rolled
+back causes the connection to be aborted
+  * GH#7501: files remain in backup causing problems at restart
+  * GH#7503: MonetDB server crashes using `WHEN MATCHED THEN UPDATE`
+  * GH#7504: possible deadlock when a bat is made persistent when it is also
+getting unloaded
+  * GH#7506: MonetDB Dec2023-SP2 crashes at `rel_value_exp2`
+  * GH#7507: BBPextend: ERROR: trying to extend BAT pool beyond the limit
+(16384)
+  * GH#7508: MonetDB Dec2023-SP2 crashes at `exp_ref`
+
+ -- Sjoerd Mullender   Thu, 02 May 2024 12:35:52 +0200
+
 monetdb (11.49.7) unstable; urgency=low
 
   * Rebuilt.
diff --git a/misc/packages/deb/changelog b/misc/packages/deb/changelog
--- a/misc/packages/deb/changelog
+++ b/misc/packages/deb/changelog
@@ -1,3 +1,25 @@
+monetdb (11.49.9) unstable; urgency=low
+
+  * Rebuilt.
+  * GH#7422: Aggregate functions with variadic arguments
+  * GH#7472: MonetDB server crashes in `tail_type`
+  * GH#7473: MonetDB server crashes in `SQLunionfunc`
+  * GH#7478: MonetDB server crashes in `exp_equal`
+  * GH#7496: Query on view fails to produce a resultset. Assertion triggered
+in rel2bin_select.
+  * GH#7499: create schema + set schema inside a transaction that is rolled
+back causes the connection to be aborted
+  * GH#7501: files remain in backup causing problems at restart
+  * GH#7503: MonetDB server crashes using `WHEN MATCHED THEN UPDATE`
+  * GH#7504: possible deadlock when a bat is made persistent when it is also
+getting unloaded
+  * GH#7506: MonetDB Dec2023-SP2 crashes at `rel_value_exp2`
+  * GH#7507: BBPextend: ERROR: trying to extend BAT pool beyond the limit
+(16384)
+  * GH#7508: MonetDB Dec2023-SP2 crashes at `exp_ref`
+
+ -- Sjoerd Mullender   Thu, 02 May 2024 12:35:52 +0200
+
 monetdb (11.49.7) unstable; urgency=low
 
   * Rebuilt.
diff --git a/misc/packages/rpm/changelog b/misc/packages/rpm/changelog
--- a/misc/packages/rpm/changelog
+++ b/misc/packages/rpm/changelog
@@ -1,3 +1,22 @@
+* Thu May 02 2024 Sjoerd Mullender  - 11.49.9-20240502
+- Rebuilt.
+- GH#7422: Aggregate functions with variadic arguments
+- GH#7472: MonetDB server crashes in `tail_type`
+- GH#7473: MonetDB server crashes in `SQLunionfunc`
+- GH#7478: MonetDB server crashes in `exp_equal`
+- GH#7496: Query on view fails to produce a resultset. Assertion triggered
+  in rel2bin_select.
+- GH#7499: create schema + set schema inside a transaction that is rolled
+  

MonetDB: Dec2023 - Updated library versions.

2024-05-02 Thread Sjoerd Mullender via checkin-list
Changeset: 874ec6166517 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/874ec6166517
Modified Files:
cmake/monetdb-versions.cmake
Branch: Dec2023
Log Message:

Updated library versions.


diffs (33 lines):

diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -44,19 +44,19 @@ set(MONETDB_VERSION "${MONETDB_VERSION_M
 # common/options and common/utils)
 set(GDK_VERSION_MAJOR "28")
 set(GDK_VERSION_MINOR "1")
-set(GDK_VERSION_PATCH "2")
+set(GDK_VERSION_PATCH "3")
 set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 # version of the MAPI library (subdirectory clients/mapilib)
 set(MAPI_VERSION_MAJOR "26")
 set(MAPI_VERSION_MINOR "2")
-set(MAPI_VERSION_PATCH "1")
+set(MAPI_VERSION_PATCH "2")
 set(MAPI_VERSION 
"${MAPI_VERSION_MAJOR}.${MAPI_VERSION_MINOR}.${MAPI_VERSION_PATCH}")
 
 # version of the MONETDB5 library (subdirectory monetdb5, not including extras 
or sql)
 set(MONETDB5_VERSION_MAJOR "35")
 set(MONETDB5_VERSION_MINOR "0")
-set(MONETDB5_VERSION_PATCH "3")
+set(MONETDB5_VERSION_PATCH "4")
 set(MONETDB5_VERSION 
"${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_MINOR}.${MONETDB5_VERSION_PATCH}")
 
 # version of the MONETDBE library (subdirectory tools/monetdbe)
@@ -74,5 +74,5 @@ set(STREAM_VERSION "${STREAM_VERSION_MAJ
 # version of the SQL library (subdirectory sql)
 set(SQL_VERSION_MAJOR "14")
 set(SQL_VERSION_MINOR "1")
-set(SQL_VERSION_PATCH "3")
+set(SQL_VERSION_PATCH "4")
 set(SQL_VERSION 
"${SQL_VERSION_MAJOR}.${SQL_VERSION_MINOR}.${SQL_VERSION_PATCH}")
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch, not changing any f...

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

Merge with Dec2023 branch, not changing any files.

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


MonetDB: Dec2023 - Pre-release version number update.

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

Pre-release version number update.


diffs (191 lines):

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 11.49.8
+current_version = 11.49.9
 commit = False
 tag = False
 
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.8
+%global version 11.49.9
 %{!?buildno: %global buildno %(date +%Y%m%d)}
 
 # Use bcond_with to add a --with option; i.e., "without" is default.
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,8)
-  PRODUCTVERSION version(11,49,8)
+  FILEVERSION version(11,49,9)
+  PRODUCTVERSION version(11,49,9)
   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,8)
+  VALUE "FileVersion", sversion(11,49,9)
   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,8)
+  VALUE "ProductVersion", sversion(11,49,9)
   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,8)
-  PRODUCTVERSION version(11,49,8)
+  FILEVERSION version(11,49,9)
+  PRODUCTVERSION version(11,49,9)
   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,8)
+  VALUE "FileVersion", sversion(11,49,9)
   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"
-  VALUE "ProductVersion", sversion(11,49,8)
+  VALUE "ProductVersion", sversion(11,49,9)
   VALUE "SpecialBuild", "\0"
 END
   END
diff --git a/clients/odbc/winsetup/setup.rc b/clients/odbc/winsetup/setup.rc
--- a/clients/odbc/winsetup/setup.rc
+++ b/clients/odbc/winsetup/setup.rc
@@ -65,8 +65,8 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION version(11,49,8)
- PRODUCTVERSION version(11,49,8)
+ FILEVERSION version(11,49,9)
+ PRODUCTVERSION version(11,49,9)
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -83,12 +83,12 @@ BEGIN
 BEGIN
 VALUE "CompanyName", "MonetDB Foundation"
 VALUE "FileDescription", "MonetDB ODBC Setup DLL"
-VALUE "FileVersion", sversion(11,49,8)
+VALUE "FileVersion", sversion(11,49,9)
 VALUE "InternalName", "MonetODBCs.dll"
 VALUE "LegalCopyright", "Copyright (c) 2024 MonetDB Foundation"
 VALUE "OriginalFilename", "MonetODBCs.dll"
 VALUE "ProductName", "MonetDB SQL Server"
-VALUE "ProductVersion", sversion(11,49,8)
+VALUE "ProductVersion", sversion(11,49,9)
 END
 END
 BLOCK "VarFileInfo"
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -12,10 +12,10 @@
 
 set(MONETDB_VERSION_MAJOR "11")
 set(MONETDB_VERSION_MINOR "49")
-set(MONETDB_VERSION_PATCH "8")
+set(MONETDB_VERSION_PATCH "9")
 
 if(RELEASE_VERSION)
-  set(MONETDB_RELEASE "unreleased")
+  set(MONETDB_RELEASE "Dec2023-SP3")
 endif()
 set(MONETDB_VERSION 
"${MONETDB_VERSION_MAJOR}.${MONETDB_VERSION_MINOR}.${MONETDB_VERSION_PATCH}")
 
diff --git a/gdk/libbat.rc b/gdk/libbat.rc
--- a/gdk/libbat.rc
+++ b/gdk/libbat.rc
@@ -6,8 +6,8 @@ 

MonetDB: default - Merge with Dec2023 branch.

2024-05-02 Thread Sjoerd Mullender via checkin-list
Changeset: 90d39ff168f9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/90d39ff168f9
Modified Files:
sql/server/rel_optimize_proj.c
sql/server/rel_select.c
Branch: default
Log Message:

Merge with Dec2023 branch.


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
@@ -3299,6 +3299,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: Dec2023 - Only execuyte hg/git when we found the program.

2024-05-01 Thread Sjoerd Mullender via checkin-list
Changeset: 5270722c3891 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5270722c3891
Modified Files:
common/utils/GenerateVersionHeader.cmake
Branch: Dec2023
Log Message:

Only execuyte hg/git when we found the program.


diffs (54 lines):

diff --git a/common/utils/GenerateVersionHeader.cmake 
b/common/utils/GenerateVersionHeader.cmake
--- a/common/utils/GenerateVersionHeader.cmake
+++ b/common/utils/GenerateVersionHeader.cmake
@@ -18,34 +18,34 @@ elseif(EXISTS "${DIR}/.hg")
   find_package(Hg)
   if(HG_FOUND)
 message("hg found: ${HG_EXECUTABLE}")
+execute_process(COMMAND "${HG_EXECUTABLE}" "id" "-i" WORKING_DIRECTORY 
"${DIR}" RESULT_VARIABLE HG_RETURN_CODE
+  OUTPUT_VARIABLE HG_OUPUT_RES OUTPUT_STRIP_TRAILING_WHITESPACE)
+if(HG_RETURN_CODE EQUAL 0 AND HG_OUPUT_RES)
+  set(MERCURIAL_ID "${HG_OUPUT_RES}")
+else()
+  message(WARNING "Failed to find mercurial ID")
+  set(MERCURIAL_ID "Unknown")
+endif()
   else()
 message(WARNING "Failed to find mercurial")
 set(MERCURIAL_ID "Unknown")
   endif()
-  execute_process(COMMAND "${HG_EXECUTABLE}" "id" "-i" WORKING_DIRECTORY 
"${DIR}" RESULT_VARIABLE HG_RETURN_CODE
-OUTPUT_VARIABLE HG_OUPUT_RES OUTPUT_STRIP_TRAILING_WHITESPACE)
-  if(HG_RETURN_CODE EQUAL 0 AND HG_OUPUT_RES)
-set(MERCURIAL_ID "${HG_OUPUT_RES}")
-  else()
-message(WARNING "Failed to find mercurial ID")
-set(MERCURIAL_ID "Unknown")
-  endif()
 elseif(EXISTS "${DIR}/.git")
   find_package(Git)
   if(GIT_FOUND)
 message("git found: ${GIT_EXECUTABLE}")
+execute_process(COMMAND "${GIT_EXECUTABLE}" "rev-parse" "--short" "HEAD" 
WORKING_DIRECTORY "${DIR}"
+  RESULT_VARIABLE GIT_RETURN_CODE OUTPUT_VARIABLE GIT_OUPUT_RES 
OUTPUT_STRIP_TRAILING_WHITESPACE)
+if(GIT_RETURN_CODE EQUAL 0 AND GIT_OUPUT_RES)
+  set(MERCURIAL_ID "${GIT_OUPUT_RES}")
+else()
+  message(WARNING "Failed to find git ID")
+  set(MERCURIAL_ID "Unknown")
+endif()
   else()
 message(WARNING "Failed to find git")
 set(MERCURIAL_ID "Unknown")
   endif()
-  execute_process(COMMAND "${GIT_EXECUTABLE}" "rev-parse" "--short" "HEAD" 
WORKING_DIRECTORY "${DIR}"
-RESULT_VARIABLE GIT_RETURN_CODE OUTPUT_VARIABLE GIT_OUPUT_RES 
OUTPUT_STRIP_TRAILING_WHITESPACE)
-  if(GIT_RETURN_CODE EQUAL 0 AND GIT_OUPUT_RES)
-set(MERCURIAL_ID "${GIT_OUPUT_RES}")
-  else()
-message(WARNING "Failed to find git ID")
-set(MERCURIAL_ID "Unknown")
-  endif()
 else()
   set(MERCURIAL_ID "Unknown")
 endif()
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Approve header change.

2024-05-01 Thread Sjoerd Mullender via checkin-list
Changeset: 960be3294ecb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/960be3294ecb
Modified Files:
sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:

Approve header change.


diffs (14 lines):

diff --git a/sql/test/emptydb/Tests/check.stable.out.int128 
b/sql/test/emptydb/Tests/check.stable.out.int128
--- a/sql/test/emptydb/Tests/check.stable.out.int128
+++ b/sql/test/emptydb/Tests/check.stable.out.int128
@@ -7068,8 +7068,8 @@ select 'null in fkeys.delete_action', de
 % %14, table_id,   id, table_id,   type,   name,   rkey,   
update_action_id,   update_action,  delete_action_id,   delete_action # 
name
 % varchar, int,int,int,int,varchar,int,
smallint,   varchar,smallint,   varchar # type
 % 0,   1,  1,  1,  1,  0,  1,  1,  0,  1,  
0 # length
-% .%14,.fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, 
sys.fkeys,  .fkeys, sys.fkeys # table_name
-% %14, type,   id, table_id,   type,   name,   rkey,   
update_action_id,   update_action,  delete_action_id,   delete_action # 
name
+% .%15,.fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, 
.fkeys, .fkeys # table_name
+% %15, type,   id, table_id,   type,   name,   rkey,   
update_action_id,   update_action,  delete_action_id,   delete_action # 
name
 % varchar, int,int,int,int,varchar,int,
smallint,   varchar,smallint,   varchar # type
 % 0,   1,  1,  1,  1,  0,  1,  1,  0,  1,  
0 # length
 % .%14,.fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, .fkeys, 
sys.fkeys,  .fkeys, sys.fkeys # table_name
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch.

2024-05-01 Thread Sjoerd Mullender via checkin-list
Changeset: 086054b9400a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/086054b9400a
Modified Files:
gdk/gdk_bat.c
gdk/gdk_bbp.c
sql/backends/monet5/rel_bin.c
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (103 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -2550,6 +2550,7 @@ BATmode(BAT *b, bool transient)
 
BATiter bi = bat_iterator(b);
bool mustrelease = false;
+   bool mustretain = false;
bat bid = b->batCacheid;
 
if (transient != bi.transient) {
@@ -2564,16 +2565,20 @@ BATmode(BAT *b, bool transient)
}
}
 
-   /* persistent BATs get a logical reference */
+   /* we need to delay the calls to BBPretain and
+* BBPrelease until after we have released our reference
+* to the heaps (i.e. until after bat_iterator_end),
+* because in either case, BBPfree can be called (either
+* directly here or in BBPtrim) which waits for the heap
+* reference to come down.  BBPretain calls incref which
+* waits until the trim that is waiting for us is done,
+* so that causes deadlock, and BBPrelease can call
+* BBPfree which causes deadlock with a single thread */
if (!transient) {
-   BBPretain(bid);
+   /* persistent BATs get a logical reference */
+   mustretain = true;
} else if (!bi.transient) {
-   /* we need to delay the release because if there
-* is no fix and the bat is loaded, BBPrelease
-* can call BBPfree which calls BATfree which
-* may hang while waiting for the heap reference
-* that we have because of the BAT iterator to
-* come down, in other words, deadlock */
+   /* transient BATs loose their logical reference */
mustrelease = true;
}
MT_lock_set((bid));
@@ -2605,8 +2610,10 @@ BATmode(BAT *b, bool transient)
MT_lock_unset((bid));
}
bat_iterator_end();
-   /* release after bat_iterator_end because of refs to heaps */
-   if (mustrelease)
+   /* retain/release after bat_iterator_end because of refs to heaps */
+   if (mustretain)
+   BBPretain(bid);
+   else if (mustrelease)
BBPrelease(bid);
return GDK_SUCCEED;
 }
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4073,6 +4073,7 @@ BBPsync(int cnt, bat *restrict subcommit
/* move any tail/theap files we find for this bat that
 * are in the BACKUP directory to the SUBCOMMIT
 * directory */
+   assert(b->ttype > 0); /* no unknown types allowed */
char fname[16]; /* plenty big enough */
if (snprintf(fname, sizeof(fname), "%o", (unsigned) 
bid) < 16) {
/* the snprintf never fails, any of the
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
@@ -6661,7 +6661,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 - Delay calling BBPretain until after bat_itera...

2024-04-29 Thread Sjoerd Mullender via checkin-list
Changeset: 84f66ba47ea2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/84f66ba47ea2
Modified Files:
gdk/gdk_bat.c
Branch: Dec2023
Log Message:

Delay calling BBPretain until after bat_iterator_end.
This fixes bug #7504.


diffs (53 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -2575,6 +2575,7 @@ BATmode(BAT *b, bool transient)
 
BATiter bi = bat_iterator(b);
bool mustrelease = false;
+   bool mustretain = false;
bat bid = b->batCacheid;
 
if (transient != bi.transient) {
@@ -2591,16 +2592,20 @@ BATmode(BAT *b, bool transient)
}
}
 
-   /* persistent BATs get a logical reference */
+   /* we need to delay the calls to BBPretain and
+* BBPrelease until after we have released our reference
+* to the heaps (i.e. until after bat_iterator_end),
+* because in either case, BBPfree can be called (either
+* directly here or in BBPtrim) which waits for the heap
+* reference to come down.  BBPretain calls incref which
+* waits until the trim that is waiting for us is done,
+* so that causes deadlock, and BBPrelease can call
+* BBPfree which causes deadlock with a single thread */
if (!transient) {
-   BBPretain(bid);
+   /* persistent BATs get a logical reference */
+   mustretain = true;
} else if (!bi.transient) {
-   /* we need to delay the release because if there
-* is no fix and the bat is loaded, BBPrelease
-* can call BBPfree which calls BATfree which
-* may hang while waiting for the heap reference
-* that we have because of the BAT iterator to
-* come down, in other words, deadlock */
+   /* transient BATs loose their logical reference */
mustrelease = true;
}
MT_lock_set((bid));
@@ -2632,8 +2637,10 @@ BATmode(BAT *b, bool transient)
MT_lock_unset((bid));
}
bat_iterator_end();
-   /* release after bat_iterator_end because of refs to heaps */
-   if (mustrelease)
+   /* retain/release after bat_iterator_end because of refs to heaps */
+   if (mustretain)
+   BBPretain(bid);
+   else if (mustrelease)
BBPrelease(bid);
return GDK_SUCCEED;
 }
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Add an assert.

2024-04-29 Thread Sjoerd Mullender via checkin-list
Changeset: d14686f2294e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d14686f2294e
Modified Files:
gdk/gdk_bbp.c
Branch: Dec2023
Log Message:

Add an assert.


diffs (11 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4117,6 +4117,7 @@ BBPsync(int cnt, bat *restrict subcommit
/* move any tail/theap files we find for this bat that
 * are in the BACKUP directory to the SUBCOMMIT
 * directory */
+   assert(b->ttype > 0); /* no unknown types allowed */
char fname[16]; /* plenty big enough */
if (snprintf(fname, sizeof(fname), "%o", (unsigned) 
bid) < 16) {
/* the snprintf never fails, any of the
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch.

2024-04-29 Thread Sjoerd Mullender via checkin-list
Changeset: 6a013fec3b56 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6a013fec3b56
Modified Files:
gdk/gdk_bbp.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_user.c
sql/include/sql_catalog.h
sql/storage/bat/bat_storage.c
sql/storage/store.c
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (237 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1711,6 +1711,9 @@ BBPjson_upgrade(json_storage_conversion 
const char *nme;
 
nme = ATOMunknown_name(b->ttype);
+   int tt = ATOMindex(nme);
+   if (tt >= 0)
+   b->ttype = tt;
if (strcmp(nme, "json") != 0)
continue;
} else if (b->ttype != JSON_type) {
@@ -4065,34 +4068,41 @@ BBPsync(int cnt, bat *restrict subcommit
if (lock)
MT_lock_set((bid));
}
-   if (subcommit) {
+   BAT *b = BBP_desc(bid);
+   if (subcommit && b->ttype != TYPE_void) {
/* 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) {
+   if (snprintf(fname, sizeof(fname), "%o", (unsigned) 
bid) < 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",
+   uint8_t stpe = ATOMstorage(b->ttype);
+   if ((b->ttype != TYPE_str || b->twidth >= 8) &&
+   GDKmove(0, BAKDIR, fname, "tail", SUBDIR, 
fname, "tail", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "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",
+   if (stpe == TYPE_str &&
+   GDKmove(0, BAKDIR, fname, "tail1", SUBDIR, 
fname, "tail1", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "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",
+   if (stpe == TYPE_str && b->twidth >= 2 &&
+   GDKmove(0, BAKDIR, fname, "tail2", SUBDIR, 
fname, "tail2", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "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",
+   if (stpe == TYPE_str && b->twidth >= 4 &&
+   GDKmove(0, BAKDIR, fname, "tail4", SUBDIR, 
fname, "tail4", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "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",
+   if (ATOMvarsized(b->ttype) &&
+   GDKmove(0, BAKDIR, fname, "theap", SUBDIR, 
fname, "theap", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "moved %s.theap from %s 
to %s\n",
  fname, BAKDIR, SUBDIR);
}
}
-   BAT *b = dirty_bat(, subcommit != NULL);
+   b = dirty_bat(, subcommit != NULL);
if (i <= 0)
ret = GDK_FAIL;
else if (BBP_status(bid) & BBPEXISTING &&
diff --git a/sql/backends/monet5/sql_scenario.c 

MonetDB: Dec2023 - Fine tune: only attempt move if there is a po...

2024-04-27 Thread Sjoerd Mullender via checkin-list
Changeset: b4d475709877 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b4d475709877
Modified Files:
gdk/gdk_bbp.c
Branch: Dec2023
Log Message:

Fine tune: only attempt move if there is a possibility it might be needed.


diffs (58 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4109,34 +4109,41 @@ BBPsync(int cnt, bat *restrict subcommit
if (lock)
MT_lock_set((bid));
}
-   if (subcommit) {
+   BAT *b = BBP_desc(bid);
+   if (subcommit && b->ttype != TYPE_void) {
/* 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", (unsigned) i) 
< 16) {
+   if (snprintf(fname, sizeof(fname), "%o", (unsigned) 
bid) < 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",
+   uint8_t stpe = ATOMstorage(b->ttype);
+   if ((b->ttype != TYPE_str || b->twidth >= 8) &&
+   GDKmove(0, BAKDIR, fname, "tail", SUBDIR, 
fname, "tail", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "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",
+   if (stpe == TYPE_str &&
+   GDKmove(0, BAKDIR, fname, "tail1", SUBDIR, 
fname, "tail1", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "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",
+   if (stpe == TYPE_str && b->twidth >= 2 &&
+   GDKmove(0, BAKDIR, fname, "tail2", SUBDIR, 
fname, "tail2", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "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",
+   if (stpe == TYPE_str && b->twidth >= 4 &&
+   GDKmove(0, BAKDIR, fname, "tail4", SUBDIR, 
fname, "tail4", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "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",
+   if (ATOMvarsized(b->ttype) &&
+   GDKmove(0, BAKDIR, fname, "theap", SUBDIR, 
fname, "theap", false) == GDK_SUCCEED)
+   TRC_DEBUG(IO_, "moved %s.theap from %s 
to %s\n",
  fname, BAKDIR, SUBDIR);
}
}
-   BAT *b = dirty_bat(, subcommit != NULL);
+   b = dirty_bat(, subcommit != NULL);
if (i <= 0 ||
(BBP_status(bid) & BBPEXISTING &&
 b != NULL &&
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Also in mclient, use our own version of wc...

2024-04-26 Thread Sjoerd Mullender via checkin-list
Changeset: 28e8cb16451d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/28e8cb16451d
Modified Files:
clients/mapiclient/mclient.c
monetdb5/modules/atoms/str.c
Branch: ascii-flag
Log Message:

Also in mclient, use our own version of wcwidth.


diffs (truncated from 395 to 300 lines):

diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -47,10 +47,6 @@
 
 #include 
 
-#ifdef HAVE_WCWIDTH
-#include 
-#endif
-
 #ifdef HAVE_ICONV
 #include 
 #ifdef HAVE_NL_LANGINFO
@@ -332,6 +328,217 @@ timerHuman(int64_t sqloptimizer, int64_t
return;
 }
 
+struct interval {
+   uint32_t first;
+   uint32_t last;
+   int width;
+};
+
+static const struct interval intervals[] = {
+   /* sorted list of non-overlapping ranges;
+* ranges with width==0 represent all codepoints with
+* general_category Me, Mn or Cf except U+00AD (SOFT HYPHEN), all
+* codepoints \U+1160 through U+11FF (Hangul Jamo medial vowels and
+* final consonants) -- see
+* https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c from which this is
+* derived;
+* ranges with width==2 represent all codepoints in the East Asian
+* Wide (W) or East Asian Full-width (F) category as defined in the
+* EastAsianWidth.txt file;
+* also see monetdb5/modules/atoms/str.c which has a copy of this */
+   { 0x0300, 0x036F, 0 }, { 0x0483, 0x0489, 0 }, { 0x0591, 0x05BD, 0 },
+   { 0x05BF, 0x05BF, 0 }, { 0x05C1, 0x05C2, 0 }, { 0x05C4, 0x05C5, 0 },
+   { 0x05C7, 0x05C7, 0 }, { 0x0600, 0x0605, 0 }, { 0x0610, 0x061A, 0 },
+   { 0x061C, 0x061C, 0 }, { 0x064B, 0x065F, 0 }, { 0x0670, 0x0670, 0 },
+   { 0x06D6, 0x06DD, 0 }, { 0x06DF, 0x06E4, 0 }, { 0x06E7, 0x06E8, 0 },
+   { 0x06EA, 0x06ED, 0 }, { 0x070F, 0x070F, 0 }, { 0x0711, 0x0711, 0 },
+   { 0x0730, 0x074A, 0 }, { 0x07A6, 0x07B0, 0 }, { 0x07EB, 0x07F3, 0 },
+   { 0x07FD, 0x07FD, 0 }, { 0x0816, 0x0819, 0 }, { 0x081B, 0x0823, 0 },
+   { 0x0825, 0x0827, 0 }, { 0x0829, 0x082D, 0 }, { 0x0859, 0x085B, 0 },
+   { 0x0890, 0x0891, 0 }, { 0x0898, 0x089F, 0 }, { 0x08CA, 0x0902, 0 },
+   { 0x093A, 0x093A, 0 }, { 0x093C, 0x093C, 0 }, { 0x0941, 0x0948, 0 },
+   { 0x094D, 0x094D, 0 }, { 0x0951, 0x0957, 0 }, { 0x0962, 0x0963, 0 },
+   { 0x0981, 0x0981, 0 }, { 0x09BC, 0x09BC, 0 }, { 0x09C1, 0x09C4, 0 },
+   { 0x09CD, 0x09CD, 0 }, { 0x09E2, 0x09E3, 0 }, { 0x09FE, 0x09FE, 0 },
+   { 0x0A01, 0x0A02, 0 }, { 0x0A3C, 0x0A3C, 0 }, { 0x0A41, 0x0A42, 0 },
+   { 0x0A47, 0x0A48, 0 }, { 0x0A4B, 0x0A4D, 0 }, { 0x0A51, 0x0A51, 0 },
+   { 0x0A70, 0x0A71, 0 }, { 0x0A75, 0x0A75, 0 }, { 0x0A81, 0x0A82, 0 },
+   { 0x0ABC, 0x0ABC, 0 }, { 0x0AC1, 0x0AC5, 0 }, { 0x0AC7, 0x0AC8, 0 },
+   { 0x0ACD, 0x0ACD, 0 }, { 0x0AE2, 0x0AE3, 0 }, { 0x0AFA, 0x0AFF, 0 },
+   { 0x0B01, 0x0B01, 0 }, { 0x0B3C, 0x0B3C, 0 }, { 0x0B3F, 0x0B3F, 0 },
+   { 0x0B41, 0x0B44, 0 }, { 0x0B4D, 0x0B4D, 0 }, { 0x0B55, 0x0B56, 0 },
+   { 0x0B62, 0x0B63, 0 }, { 0x0B82, 0x0B82, 0 }, { 0x0BC0, 0x0BC0, 0 },
+   { 0x0BCD, 0x0BCD, 0 }, { 0x0C00, 0x0C00, 0 }, { 0x0C04, 0x0C04, 0 },
+   { 0x0C3C, 0x0C3C, 0 }, { 0x0C3E, 0x0C40, 0 }, { 0x0C46, 0x0C48, 0 },
+   { 0x0C4A, 0x0C4D, 0 }, { 0x0C55, 0x0C56, 0 }, { 0x0C62, 0x0C63, 0 },
+   { 0x0C81, 0x0C81, 0 }, { 0x0CBC, 0x0CBC, 0 }, { 0x0CBF, 0x0CBF, 0 },
+   { 0x0CC6, 0x0CC6, 0 }, { 0x0CCC, 0x0CCD, 0 }, { 0x0CE2, 0x0CE3, 0 },
+   { 0x0D00, 0x0D01, 0 }, { 0x0D3B, 0x0D3C, 0 }, { 0x0D41, 0x0D44, 0 },
+   { 0x0D4D, 0x0D4D, 0 }, { 0x0D62, 0x0D63, 0 }, { 0x0D81, 0x0D81, 0 },
+   { 0x0DCA, 0x0DCA, 0 }, { 0x0DD2, 0x0DD4, 0 }, { 0x0DD6, 0x0DD6, 0 },
+   { 0x0E31, 0x0E31, 0 }, { 0x0E34, 0x0E3A, 0 }, { 0x0E47, 0x0E4E, 0 },
+   { 0x0EB1, 0x0EB1, 0 }, { 0x0EB4, 0x0EBC, 0 }, { 0x0EC8, 0x0ECE, 0 },
+   { 0x0F18, 0x0F19, 0 }, { 0x0F35, 0x0F35, 0 }, { 0x0F37, 0x0F37, 0 },
+   { 0x0F39, 0x0F39, 0 }, { 0x0F71, 0x0F7E, 0 }, { 0x0F80, 0x0F84, 0 },
+   { 0x0F86, 0x0F87, 0 }, { 0x0F8D, 0x0F97, 0 }, { 0x0F99, 0x0FBC, 0 },
+   { 0x0FC6, 0x0FC6, 0 }, { 0x102D, 0x1030, 0 }, { 0x1032, 0x1037, 0 },
+   { 0x1039, 0x103A, 0 }, { 0x103D, 0x103E, 0 }, { 0x1058, 0x1059, 0 },
+   { 0x105E, 0x1060, 0 }, { 0x1071, 0x1074, 0 }, { 0x1082, 0x1082, 0 },
+   { 0x1085, 0x1086, 0 }, { 0x108D, 0x108D, 0 }, { 0x109D, 0x109D, 0 },
+   { 0x1100, 0x115F, 2 }, { 0x1160, 0x11FF, 0 }, { 0x135D, 0x135F, 0 },
+   { 0x1712, 0x1714, 0 }, { 0x1732, 0x1733, 0 }, { 0x1752, 0x1753, 0 },
+   { 0x1772, 0x1773, 0 }, { 0x17B4, 0x17B5, 0 }, { 0x17B7, 0x17BD, 0 },
+   { 0x17C6, 0x17C6, 0 }, { 0x17C9, 0x17D3, 0 }, { 0x17DD, 0x17DD, 0 },
+   { 0x180B, 0x180F, 0 }, { 0x1885, 0x1886, 0 }, { 0x18A9, 0x18A9, 0 },
+   { 0x1920, 0x1922, 0 }, { 0x1927, 0x1928, 0 }, { 0x1932, 0x1932, 0 },
+   { 0x1939, 0x193B, 0 }, { 0x1A17, 0x1A18, 0 }, { 0x1A1B, 0x1A1B, 

MonetDB: ascii-flag - Add some comments.

2024-04-26 Thread Sjoerd Mullender via checkin-list
Changeset: 1e06a9390269 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1e06a9390269
Modified Files:
gdk/gdk_string.c
Branch: ascii-flag
Log Message:

Add some comments.


diffs (43 lines):

diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -1453,9 +1453,13 @@ GDKanalytical_str_group_concat(BAT *r, B
return GDK_FAIL;
 }
 
-/* The two case conversion tables are specially crafted from the
+/* The three case conversion tables are specially crafted from the
  * UnicodeData.txt file for efficient lookup.
  *
+ * The lowercase and uppercase tables are derived from the
+ * UnicodeData.txt file (the respective columns from that file), the
+ * casefold table is derived from the CaseFold.txt file.
+ *
  * For the first byte of a UTF-8 encoding, use the value as index into
  * the table.  If the value is zero, there are no conversions for any
  * UTF-8 string starting with this byte (this includes both multi-byte
@@ -1469,7 +1473,10 @@ GDKanalytical_str_group_concat(BAT *r, B
  * The process then repeats: if zero, no conversions for any sequence
  * starting with the bytes looked up so far, if non-zero, if this is the
  * last byte of a sequence, it is the converted codepoint, and otherwise
- * a (new) offset into the same table. */
+ * a (new) offset into the same table.
+ * 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. */
 static const char *const specialcase[] = {
NULL,
"ss",
@@ -7086,6 +7093,12 @@ GDKstrcasestr(const char *haystack, cons
return NULL;
 }
 
+/* The asciify table uses the same technique as the case conversion
+ * tables, except that the value that is calculated is not a codepoint.
+ * Instead it is the index into the valtab table which contains the
+ * string that is to be used to replace the asciified character.
+ * This combination of tables is derived from the command
+ * ``iconv -futf-8 -tASCII//TRANSLIT`` */
 static const char *const valtab[] = {
NULL,
[1] = " ",
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Use our own implementation of wcwidth (wit...

2024-04-26 Thread Sjoerd Mullender via checkin-list
Changeset: 576412282797 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/576412282797
Modified Files:
monetdb5/modules/atoms/str.c
Branch: ascii-flag
Log Message:

Use our own implementation of wcwidth (with different name).


diffs (truncated from 477 to 300 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -65,9 +65,6 @@
 #include "monetdb_config.h"
 #include "str.h"
 #include 
-#ifdef HAVE_WCWIDTH
-#include 
-#endif
 #include "mal_interpreter.h"
 
 #define UTF8_assert(s) assert(checkUTF8(s))
@@ -167,251 +164,228 @@ str_strlen(const char *s)
return (int) strlen(s);
 }
 
-#ifndef HAVE_WCWIDTH
 struct interval {
-   int first;
-   int last;
+   uint32_t first;
+   uint32_t last;
+   int width;
 };
 
-static const struct interval zero_width[] = {
-   /* sorted list of non-overlapping ranges; ranges represent all
-* codepoints with general_category Me, Mn or Cf except U+00AD (SOFT
-* HYPHEN), all codepoints \U+1160 through U+11FF (Hangul Jamo
-* medial vowels and final consonants) -- see
+static const struct interval intervals[] = {
+   /* sorted list of non-overlapping ranges;
+* ranges with width==0 represent all codepoints with
+* general_category Me, Mn or Cf except U+00AD (SOFT HYPHEN), all
+* codepoints \U+1160 through U+11FF (Hangul Jamo medial vowels and
+* final consonants) -- see
 * https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c from which this is
-* derived */
-   { 0x0300, 0x036F }, { 0x0483, 0x0489 }, { 0x0591, 0x05BD },
-   { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, { 0x05C4, 0x05C5 },
-   { 0x05C7, 0x05C7 }, { 0x0600, 0x0605 }, { 0x0610, 0x061A },
-   { 0x061C, 0x061C }, { 0x064B, 0x065F }, { 0x0670, 0x0670 },
-   { 0x06D6, 0x06DD }, { 0x06DF, 0x06E4 }, { 0x06E7, 0x06E8 },
-   { 0x06EA, 0x06ED }, { 0x070F, 0x070F }, { 0x0711, 0x0711 },
-   { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 },
-   { 0x07FD, 0x07FD }, { 0x0816, 0x0819 }, { 0x081B, 0x0823 },
-   { 0x0825, 0x0827 }, { 0x0829, 0x082D }, { 0x0859, 0x085B },
-   { 0x0890, 0x0891 }, { 0x0898, 0x089F }, { 0x08CA, 0x0902 },
-   { 0x093A, 0x093A }, { 0x093C, 0x093C }, { 0x0941, 0x0948 },
-   { 0x094D, 0x094D }, { 0x0951, 0x0957 }, { 0x0962, 0x0963 },
-   { 0x0981, 0x0981 }, { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 },
-   { 0x09CD, 0x09CD }, { 0x09E2, 0x09E3 }, { 0x09FE, 0x09FE },
-   { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A42 },
-   { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A51, 0x0A51 },
-   { 0x0A70, 0x0A71 }, { 0x0A75, 0x0A75 }, { 0x0A81, 0x0A82 },
-   { 0x0ABC, 0x0ABC }, { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 },
-   { 0x0ACD, 0x0ACD }, { 0x0AE2, 0x0AE3 }, { 0x0AFA, 0x0AFF },
-   { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, { 0x0B3F, 0x0B3F },
-   { 0x0B41, 0x0B44 }, { 0x0B4D, 0x0B4D }, { 0x0B55, 0x0B56 },
-   { 0x0B62, 0x0B63 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 },
-   { 0x0BCD, 0x0BCD }, { 0x0C00, 0x0C00 }, { 0x0C04, 0x0C04 },
-   { 0x0C3C, 0x0C3C }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 },
-   { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C62, 0x0C63 },
-   { 0x0C81, 0x0C81 }, { 0x0CBC, 0x0CBC }, { 0x0CBF, 0x0CBF },
-   { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, { 0x0CE2, 0x0CE3 },
-   { 0x0D00, 0x0D01 }, { 0x0D3B, 0x0D3C }, { 0x0D41, 0x0D44 },
-   { 0x0D4D, 0x0D4D }, { 0x0D62, 0x0D63 }, { 0x0D81, 0x0D81 },
-   { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 },
-   { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E },
-   { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EBC }, { 0x0EC8, 0x0ECE },
-   { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 },
-   { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 },
-   { 0x0F86, 0x0F87 }, { 0x0F8D, 0x0F97 }, { 0x0F99, 0x0FBC },
-   { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1037 },
-   { 0x1039, 0x103A }, { 0x103D, 0x103E }, { 0x1058, 0x1059 },
-   { 0x105E, 0x1060 }, { 0x1071, 0x1074 }, { 0x1082, 0x1082 },
-   { 0x1085, 0x1086 }, { 0x108D, 0x108D }, { 0x109D, 0x109D },
-   { 0x1160, 0x11FF }, { 0x135D, 0x135F }, { 0x1712, 0x1714 },
-   { 0x1732, 0x1733 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 },
-   { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 },
-   { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180F },
-   { 0x1885, 0x1886 }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 },
-   { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B },
-   { 0x1A17, 0x1A18 }, { 0x1A1B, 0x1A1B }, { 0x1A56, 0x1A56 },
-   { 0x1A58, 0x1A5E }, { 0x1A60, 0x1A60 }, { 0x1A62, 0x1A62 },
-   { 0x1A65, 0x1A6C }, { 0x1A73, 0x1A7C }, { 0x1A7F, 0x1A7F },
-   { 0x1AB0, 0x1ACE }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 },
-   { 0x1B36, 0x1B3A }, { 0x1B3C, 

MonetDB: ascii-flag - Add line and paragraph separators to the l...

2024-04-26 Thread Sjoerd Mullender via checkin-list
Changeset: d5c304dce084 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d5c304dce084
Modified Files:
monetdb5/modules/atoms/str.c
Branch: ascii-flag
Log Message:

Add line and paragraph separators to the list of whitespace codepoints.


diffs (79 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -1057,9 +1057,9 @@ STRsplitpart(str *res, str *haystack, st
 
 /* returns number of bytes to remove from left to strip the codepoints in rm */
 static size_t
-lstrip(const char *s, size_t len, const int *rm, size_t nrm)
+lstrip(const char *s, size_t len, const uint32_t *rm, size_t nrm)
 {
-   int c;
+   uint32_t c;
size_t i, n, skip = 0;
 
while (len > 0) {
@@ -1082,9 +1082,9 @@ lstrip(const char *s, size_t len, const 
 /* returns the resulting length of s after stripping codepoints in rm
  * from the right */
 static size_t
-rstrip(const char *s, size_t len, const int *rm, size_t nrm)
+rstrip(const char *s, size_t len, const uint32_t *rm, size_t nrm)
 {
-   int c;
+   uint32_t c;
size_t i, n;
 
while (len > 0) {
@@ -1102,7 +1102,7 @@ rstrip(const char *s, size_t len, const 
return len;
 }
 
-const int whitespace[] = {
+const uint32_t whitespace[] = {
' ',/* space */
'\t',   /* tab (character 
tabulation) */
'\n',   /* line feed */
@@ -1126,6 +1126,11 @@ const int whitespace[] = {
0x202F, /* narrow no-break 
space */
0x205F, /* medium mathematical 
space */
0x3000, /* ideographic space */
+/* below the code points that have the Unicode Zl (line separator) property */
+   0x2028, /* line separator */
+/* below the code points that have the Unicode Zp (paragraph separator)
+ * property */
+   0x2029, /* paragraph separator 
*/
 };
 
 #define NSPACES(sizeof(whitespace) / sizeof(whitespace[0]))
@@ -1294,10 +1299,10 @@ str_strip2(str *buf, size_t *buflen, con
if ((msg = trimchars(buf, buflen, , s2, n2, "str.strip2")) 
!= MAL_SUCCEED)
return msg;
len = strlen(s);
-   n = lstrip(s, len, *(int **) buf, n3);
+   n = lstrip(s, len, *(uint32_t **) buf, n3);
s += n;
len -= n;
-   n = rstrip(s, len, *(int **) buf, n3);
+   n = rstrip(s, len, *(uint32_t **) buf, n3);
 
n++;
CHECK_STR_BUFFER_LENGTH(buf, buflen, n, "str.strip2");
@@ -1351,7 +1356,7 @@ str_ltrim2(str *buf, size_t *buflen, con
if ((msg = trimchars(buf, buflen, , s2, n2, "str.ltrim2")) 
!= MAL_SUCCEED)
return msg;
len = strlen(s);
-   n = lstrip(s, len, *(int **) buf, n3);
+   n = lstrip(s, len, *(uint32_t **) buf, n3);
nallocate = len - n + 1;
 
CHECK_STR_BUFFER_LENGTH(buf, buflen, nallocate, "str.ltrim2");
@@ -1405,7 +1410,7 @@ str_rtrim2(str *buf, size_t *buflen, con
if ((msg = trimchars(buf, buflen, , s2, n2, "str.ltrim2")) 
!= MAL_SUCCEED)
return msg;
len = strlen(s);
-   n = rstrip(s, len, *(int **) buf, n3);
+   n = rstrip(s, len, *(uint32_t **) buf, n3);
n++;
 
CHECK_STR_BUFFER_LENGTH(buf, buflen, n, "str.rtrim2");
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Merge with default branch.

2024-04-26 Thread Sjoerd Mullender via checkin-list
Changeset: 182cc9a91af4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/182cc9a91af4
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/MAL-signatures.test
clients/Tests/exports.stable.out
gdk/gdk.h
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_bbp.c
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/tablet.c
sql/backends/monet5/sql_result.c
Branch: ascii-flag
Log Message:

Merge with default branch.


diffs (truncated from 9493 to 300 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/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -823,3 +823,5 @@ 1230526af30f40eeea30fb87c47c3e414920561f
 95d8feaa1167b5ba87bd99253c3f4e62ebf528a1 Dec2023_3
 dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_5
 dcc8c702e685a4faf21ccf663028d1bc3d1165d1 Dec2023_SP1_release
+d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_7
+d656785f49ee62c19705722aa6b7c171904c64d5 Dec2023_SP2_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -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
@@ -151,7 +151,6 @@ BuildRequires: pkgconfig(libR)
 # BuildRequires: pkgconfig(gdal)# -DSHP=ON
 # BuildRequires: pkgconfig(netcdf)  # -DNETCDF=ON
 # BuildRequires: pkgconfig(proj)# -DWITH_PROJ=ON
-# BuildRequires: pkgconfig(snappy)  # -DWITH_SNAPPY=ON
 # BuildRequires: pkgconfig(valgrind)# -DWITH_VALGRIND=ON
 
 %if (0%{?fedora} >= 22)
@@ -868,7 +867,6 @@ sed -i 's/1\.2/1.1/' misc/selinux/monetd
 -DWITH_PCRE=ON \
 -DWITH_PROJ=OFF \
 -DWITH_READLINE=ON \
--DWITH_SNAPPY=OFF \
 -DWITH_VALGRIND=OFF \
 -DWITH_XML2=ON \
 -DWITH_ZLIB=ON
@@ -895,9 +893,6 @@ install -d -m 0775 %{buildroot}%{_locals
 install -d -m 0775 %{buildroot}%{_rundir}/monetdb
 
 # remove unwanted stuff
-# .la files
-rm -f %{buildroot}%{_libdir}/*.la
-rm -f %{buildroot}%{_libdir}/monetdb5/*.la
 rm -f %{buildroot}%{_libdir}/monetdb5/lib_opt_sql_append.so
 rm -f %{buildroot}%{_libdir}/monetdb5/lib_microbenchmark*.so
 rm -f %{buildroot}%{_libdir}/monetdb5/lib_udf*.so
@@ -921,6 +916,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 

MonetDB: Dec2023 - %o format expects an unsigned integer.

2024-04-26 Thread Sjoerd Mullender via checkin-list
Changeset: bef2f6636882 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bef2f6636882
Modified Files:
gdk/gdk_bbp.c
Branch: Dec2023
Log Message:

%o format expects an unsigned integer.


diffs (12 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4114,7 +4114,7 @@ BBPsync(int cnt, bat *restrict subcommit
 * are in the BACKUP directory to the SUBCOMMIT
 * directory */
char fname[16]; /* plenty big enough */
-   if (snprintf(fname, sizeof(fname), "%o", i) < 16) {
+   if (snprintf(fname, sizeof(fname), "%o", (unsigned) i) 
< 16) {
/* the snprintf never fails, any of the
 * below may fail */
if (GDKmove(0, BAKDIR, fname, "tail", SUBDIR, 
fname, "tail", false) == GDK_SUCCEED)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch.

2024-04-26 Thread Sjoerd Mullender via checkin-list
Changeset: 049f0782c886 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/049f0782c886
Modified Files:
gdk/gdk_bbp.c
monetdb5/modules/mal/tablet.c
sql/storage/bat/bat_storage.c
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (163 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
@@ -1945,8 +1945,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)
 {
@@ -1958,10 +1957,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);
-   BBPretain(*msg = cntxt->error_msg->batCacheid);
-   

MonetDB: Dec2023 - During subcommit, move already created backup...

2024-04-26 Thread Sjoerd Mullender via checkin-list
Changeset: 6538219ec0df for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6538219ec0df
Modified Files:
gdk/gdk_bbp.c
Branch: Dec2023
Log Message:

During subcommit, move already created backup files to subcommit directory.
This fixes bug #7501.


diffs (37 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4109,6 +4109,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 ||
(BBP_status(bid) & BBPEXISTING &&
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Make a copy of the rejects table.

2024-04-26 Thread Sjoerd Mullender via checkin-list
Changeset: 006e3f978a22 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/006e3f978a22
Modified Files:
monetdb5/modules/mal/tablet.c
Branch: Dec2023
Log Message:

Make a copy of the rejects table.


diffs (45 lines):

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
@@ -1922,8 +1922,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)
 {
@@ -1935,10 +1934,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);
-   BBPretain(*msg = cntxt->error_msg->batCacheid);
-   BBPretain(*inp = cntxt->error_input->batCacheid);
+   MT_lock_set();
+   BAT *bn1 = COLcopy(cntxt->error_row, cntxt->error_row->ttype, true, 
TRANSIENT);
+   BAT *bn2 = COLcopy(cntxt->error_fld, cntxt->error_fld->ttype, true, 
TRANSIENT);
+   BAT *bn3 = COLcopy(cntxt->error_msg, cntxt->error_msg->ttype, true, 
TRANSIENT);
+   BAT *bn4 = COLcopy(cntxt->error_input, cntxt->error_input->ttype, true, 
TRANSIENT);
+   MT_lock_unset();
+   if (bn1 == NULL || bn2 == NULL || bn3 == NULL || bn4 == NULL) {
+   BBPreclaim(bn1);
+   BBPreclaim(bn2);
+   BBPreclaim(bn3);
+   BBPreclaim(bn4);
+   throw(MAL, "sql.rejects", GDK_EXCEPTION);
+   }
+   *row = bn1->batCacheid;
+   *fld = bn2->batCacheid;
+   *msg = bn3->batCacheid;
+   *inp = bn4->batCacheid;
+   BBPkeepref(bn1);
+   BBPkeepref(bn2);
+   BBPkeepref(bn3);
+   BBPkeepref(bn4);
(void) mb;
return MAL_SUCCEED;
 }
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch.

2024-04-24 Thread Sjoerd Mullender via checkin-list
Changeset: 85413ad9ca49 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/85413ad9ca49
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (12 lines):

diff --git 
a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py 
b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
--- a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
+++ b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
@@ -1,7 +1,7 @@
 import pymonetdb, sys, threading, os
 
 query = '''
-select count(*) from tables;
+--select count(*) from tables;
 create table t1(i int);
 insert into t1 values(1);
 insert into t1 values(2);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Compatibility with pymonetdb 1.8.1.

2024-04-24 Thread Sjoerd Mullender via checkin-list
Changeset: bdde5951e4b0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/bdde5951e4b0
Modified Files:
sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
Branch: Dec2023
Log Message:

Compatibility with pymonetdb 1.8.1.


diffs (12 lines):

diff --git 
a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py 
b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
--- a/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
+++ b/sql/test/concurrent/Tests/crash_on_concurrent_use.SF-1411926.SQL.py
@@ -1,7 +1,7 @@
 import pymonetdb, sys, threading, os
 
 query = '''
-select count(*) from tables;
+--select count(*) from tables;
 create table t1(i int);
 insert into t1 values(1);
 insert into t1 values(2);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch.

2024-04-24 Thread Sjoerd Mullender via checkin-list
Changeset: 2b1939405e38 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2b1939405e38
Modified Files:
cmake/monetdb-defines.cmake
gdk/gdk_system.c
monetdb5/mal/mal_dataflow.c
monetdb_config.h.in
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (193 lines):

diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake
--- a/cmake/monetdb-defines.cmake
+++ b/cmake/monetdb-defines.cmake
@@ -85,6 +85,7 @@ function(monetdb_configure_defines)
 check_symbol_exists("getopt_long" "getopt.h" HAVE_GETOPT_LONG)
   cmake_pop_check_state()
   check_function_exists("getrlimit" HAVE_GETRLIMIT)
+  check_function_exists("gettid" HAVE_GETTID)
   check_function_exists("gettimeofday" HAVE_GETTIMEOFDAY)
   check_function_exists("getuid" HAVE_GETUID)
   check_symbol_exists("gmtime_r" "time.h" HAVE_GMTIME_R)
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -52,6 +52,8 @@
 
 #include "mutils.h"
 
+static ATOMIC_TYPE GDKthreadid = ATOMIC_VAR_INIT(1);
+
 #ifdef LOCK_STATS
 
 ATOMIC_TYPE GDKlockcnt = ATOMIC_VAR_INIT(0);
@@ -218,6 +220,9 @@ static struct mtthread {
HANDLE hdl;
DWORD wtid;
 #endif
+#ifdef HAVE_GETTID
+   pid_t lwptid;
+#endif
MT_Id tid;
uintptr_t sp;
char *errbuf;
@@ -227,6 +232,7 @@ struct mtthread mainthread = {
.threadname = "main thread",
.exited = ATOMIC_VAR_INIT(0),
.refs = 1,
+   .tid = 1,
 };
 #ifdef HAVE_PTHREAD_H
 static pthread_mutex_t posthread_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -285,9 +291,22 @@ dump_threads(void)
MT_Cond *cn = t->condwait;
struct mtthread *jn = t->joinwait;
int pos = snprintf(buf, sizeof(buf),
-  "%s, tid %zu, %"PRIu32" free bats, waiting 
for %s%s, working on %.200s",
+  "%s, tid %zu, "
+#ifdef HAVE_PTHREAD_H
+  "Thread 0x%lx, "
+#endif
+#ifdef HAVE_GETTID
+  "LWP %ld, "
+#endif
+  "%"PRIu32" free bats, waiting for %s%s, 
working on %.200s",
   t->threadname,
   t->tid,
+#ifdef HAVE_PTHREAD_H
+  (long) t->hdl,
+#endif
+#ifdef HAVE_GETTID
+  (long) t->lwptid,
+#endif
   t->freebats.nfreebats,
   lk ? "lock " : sm ? "semaphore " : cn ? 
"condvar " : jn ? "thread " : "",
   lk ? lk->name : sm ? sm->name : cn ? 
cn->name : jn ? jn->threadname : "nothing",
@@ -329,6 +348,9 @@ MT_thread_init(void)
 {
if (thread_initialized)
return true;
+#ifdef HAVE_GETTID
+   mainthread.lwptid = gettid();
+#endif
 #ifdef HAVE_PTHREAD_H
int ret;
 
@@ -356,7 +378,6 @@ MT_thread_init(void)
}
InitializeCriticalSection(_cs);
 #endif
-   mainthread.tid = (MT_Id) 
mainthread.next = NULL;
mtthreads = 
thread_initialized = true;
@@ -365,8 +386,6 @@ MT_thread_init(void)
 bool
 MT_thread_register(void)
 {
-   MT_Id mtid;
-
assert(thread_initialized);
if (!thread_initialized)
return false;
@@ -386,7 +405,6 @@ MT_thread_register(void)
if (self == NULL)
return false;
 
-   mtid = (MT_Id) self;
*self = (struct mtthread) {
.detached = false,
 #ifdef HAVE_PTHREAD_H
@@ -395,7 +413,7 @@ MT_thread_register(void)
.wtid = GetCurrentThreadId(),
 #endif
.refs = 1,
-   .tid = mtid,
+   .tid = (MT_Id) ATOMIC_INC(),
.exited = ATOMIC_VAR_INIT(0),
};
snprintf(self->threadname, sizeof(self->threadname), "foreign %zu", 
self->tid);
@@ -735,6 +753,9 @@ thread_starter(void *arg)
struct mtthread *self = (struct mtthread *) arg;
void *data = self->data;
 
+#ifdef HAVE_GETTID
+   self->lwptid = gettid();
+#endif
 #ifdef HAVE_PTHREAD_H
 #ifdef HAVE_PTHREAD_SETNAME_NP
/* name can be at most 16 chars including \0 */
@@ -848,7 +869,6 @@ int
 MT_create_thread(MT_Id *t, void (*f) (void *), void *arg, enum MT_thr_detach 
d, const char *threadname)
 {
struct mtthread *self;
-   MT_Id mtid;
 
assert(thread_initialized);
join_threads();
@@ -882,7 +902,6 @@ MT_create_thread(MT_Id *t, void (*f) (vo
 #endif
return -1;
}
-   mtid = (MT_Id) self;
 
*self = (struct mtthread) {
.func = f,
@@ -890,7 +909,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo
.waiting = false,
.detached = (d == MT_THR_DETACHED),
.refs = 1,
-   .tid = mtid,
+   .tid = (MT_Id) ATOMIC_INC(),
.exited = ATOMIC_VAR_INIT(0),
};

MonetDB: Dec2023 - Add a cast.

2024-04-24 Thread Sjoerd Mullender via checkin-list
Changeset: ace6995d64e0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ace6995d64e0
Modified Files:
gdk/gdk_system.c
Branch: Dec2023
Log Message:

Add a cast.


diffs (21 lines):

diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -414,7 +414,7 @@ MT_thread_register(void)
.wtid = GetCurrentThreadId(),
 #endif
.refs = 1,
-   .tid = ATOMIC_INC(),
+   .tid = (MT_Id) ATOMIC_INC(),
};
snprintf(self->threadname, sizeof(self->threadname), "foreign %zu", 
self->tid);
ATOMIC_INIT(>exited, 0);
@@ -910,7 +910,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo
.waiting = false,
.detached = (d == MT_THR_DETACHED),
.refs = 1,
-   .tid = ATOMIC_INC(),
+   .tid = (MT_Id) ATOMIC_INC(),
};
MT_lock_set(_init_lock);
/* remember the list of callback functions we need to call for
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Use ATOMIC_VAR_INIT and ATOMIC_PTR_VAR_INIT w...

2024-04-23 Thread Sjoerd Mullender via checkin-list
Changeset: fef11c1d442c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fef11c1d442c
Modified Files:
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_cand.c
gdk/gdk_heap.c
gdk/gdk_logger.c
gdk/gdk_orderidx.c
gdk/gdk_rtree.c
gdk/gdk_system.c
monetdb5/mal/mal_dataflow.c
monetdb5/mal/mal_instruction.c
sql/common/sql_types.c
sql/storage/bat/bat_storage.c
Branch: default
Log Message:

Use ATOMIC_VAR_INIT and ATOMIC_PTR_VAR_INIT where it makes sense.


diffs (truncated from 524 to 300 lines):

diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -258,6 +258,7 @@ BATmaterialize(BAT *b, BUN cap)
.farmid = BBPselectfarm(b->batRole, TYPE_oid, offheap),
.parentid = b->batCacheid,
.dirty = true,
+   .refs = ATOMIC_VAR_INIT(1),
};
settailname(tail, BBP_physical(b->batCacheid), TYPE_oid, 0);
if (HEAPalloc(tail, cap, sizeof(oid)) != GDK_SUCCEED) {
@@ -273,7 +274,6 @@ BATmaterialize(BAT *b, BUN cap)
for (p = 0; p < q; p++)
x[p] = t++;
}
-   ATOMIC_INIT(>refs, 1);
/* point of no return */
MT_lock_set(>theaplock);
assert((ATOMIC_GET(>theap->refs) & HEAPREFS) > 0);
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -74,6 +74,7 @@ BATcreatedesc(oid hseq, int tt, bool hea
*h = (Heap) {
.farmid = BBPselectfarm(role, tt, offheap),
.dirty = true,
+   .refs = ATOMIC_VAR_INIT(1),
};
 
if (ATOMneedheap(tt)) {
@@ -84,6 +85,7 @@ BATcreatedesc(oid hseq, int tt, bool hea
*vh = (Heap) {
.farmid = BBPselectfarm(role, tt, varheap),
.dirty = true,
+   .refs = ATOMIC_VAR_INIT(1),
};
}
}
@@ -124,13 +126,11 @@ BATcreatedesc(oid hseq, int tt, bool hea
 
if (bn->theap) {
bn->theap->parentid = bn->batCacheid;
-   ATOMIC_INIT(>theap->refs, 1);
const char *nme = BBP_physical(bn->batCacheid);
settailname(bn->theap, nme, tt, width);
 
if (bn->tvheap) {
bn->tvheap->parentid = bn->batCacheid;
-   ATOMIC_INIT(>tvheap->refs, 1);
strconcat_len(bn->tvheap->filename,
  sizeof(bn->tvheap->filename),
  nme, ".theap", NULL);
@@ -603,6 +603,7 @@ BATclear(BAT *b, bool force)
.parentid = b->tvheap->parentid,
.dirty = true,
.hasfile = b->tvheap->hasfile,
+   .refs = ATOMIC_VAR_INIT(1),
};
strcpy_len(th->filename, b->tvheap->filename, 
sizeof(th->filename));
if (ATOMheap(b->ttype, th, 0) != GDK_SUCCEED) {
@@ -610,7 +611,6 @@ BATclear(BAT *b, bool force)
return GDK_FAIL;
}
tvp = b->tvheap->parentid;
-   ATOMIC_INIT(>refs, 1);
HEAPdecref(b->tvheap, false);
b->tvheap = th;
}
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -34,6 +34,7 @@ unshare_varsized_heap(BAT *b)
*h = (Heap) {
.parentid = b->batCacheid,
.farmid = BBPselectfarm(b->batRole, TYPE_str, varheap),
+   .refs = ATOMIC_VAR_INIT(1),
};
strconcat_len(h->filename, sizeof(h->filename),
  BBP_physical(b->batCacheid), ".theap", NULL);
@@ -42,7 +43,6 @@ unshare_varsized_heap(BAT *b)
GDKfree(h);
return GDK_FAIL;
}
-   ATOMIC_INIT(>refs, 1);
MT_lock_set(>theaplock);
Heap *oh = b->tvheap;
b->tvheap = h;
@@ -415,6 +415,7 @@ append_varsized_bat(BAT *b, BATiter *ni,
*h = (Heap) {
.parentid = b->batCacheid,
.farmid = BBPselectfarm(b->batRole, b->ttype, varheap),
+   .refs = ATOMIC_VAR_INIT(1),
};
strconcat_len(h->filename, sizeof(h->filename),
  BBP_physical(b->batCacheid), ".theap", NULL);
@@ -423,7 +424,6 @@ append_varsized_bat(BAT *b, BATiter *ni,
GDKfree(h);
return GDK_FAIL;
}
-   ATOMIC_INIT(>refs, 

MonetDB: default - Get rid of ATOMIC_DESTROY. All versions were...

2024-04-23 Thread Sjoerd Mullender via checkin-list
Changeset: a860e78c6ec8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a860e78c6ec8
Modified Files:
common/utils/matomic.h
gdk/gdk_bat.c
gdk/gdk_heap.c
gdk/gdk_imprints.c
gdk/gdk_logger.c
gdk/gdk_rtree.c
gdk/gdk_strimps.c
gdk/gdk_system.c
gdk/gdk_system.h
monetdb5/mal/mal_client.c
monetdb5/mal/mal_instruction.c
sql/storage/bat/bat_storage.c
sql/storage/objectset.c
sql/storage/store.c
Branch: default
Log Message:

Get rid of ATOMIC_DESTROY.  All versions were just ((void)0).


diffs (232 lines):

diff --git a/common/utils/matomic.h b/common/utils/matomic.h
--- a/common/utils/matomic.h
+++ b/common/utils/matomic.h
@@ -18,7 +18,6 @@
  * The following operations are defined:
  * ATOMIC_VAR_INIT -- initializer for the variable (not necessarily atomic!);
  * ATOMIC_INIT -- initialize the variable (not necessarily atomic!);
- * ATOMIC_DESTROY -- destroy the variable
  * ATOMIC_GET -- return the value of a variable;
  * ATOMIC_SET -- set the value of a variable;
  * ATOMIC_XCG -- set the value of a variable, return original value;
@@ -114,7 +113,6 @@ typedef unsigned long ATOMIC_BASE_TYPE;
 #endif
 
 #define ATOMIC_INIT(var, val)  atomic_init(var, (ATOMIC_BASE_TYPE) (val))
-#define ATOMIC_DESTROY(var)((void) 0)
 #define ATOMIC_GET(var)((ATOMIC_BASE_TYPE) *(var))
 #define ATOMIC_SET(var, val)   (*(var) = (ATOMIC_BASE_TYPE) (val))
 #define ATOMIC_XCG(var, val)   atomic_exchange(var, (ATOMIC_BASE_TYPE) (val))
@@ -173,7 +171,6 @@ typedef __declspec(align(8)) volatile AT
 
 #define ATOMIC_VAR_INIT(val)   (val)
 #define ATOMIC_INIT(var, val)  (*(var) = (val))
-#define ATOMIC_DESTROY(var)((void) 0)
 
 #if SIZEOF_SIZE_T == 8
 
@@ -276,7 +273,6 @@ typedef volatile ATOMIC_BASE_TYPE ATOMIC
 
 #define ATOMIC_VAR_INIT(val)   (val)
 #define ATOMIC_INIT(var, val)  (*(var) = (val))
-#define ATOMIC_DESTROY(var)((void) 0)
 
 #define ATOMIC_GET(var)((ATOMIC_BASE_TYPE) 
__atomic_load_n(var, __ATOMIC_SEQ_CST))
 #define ATOMIC_SET(var, val)   __atomic_store_n(var, (ATOMIC_BASE_TYPE) (val), 
__ATOMIC_SEQ_CST)
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -708,7 +708,6 @@ void
 BATdestroy(BAT *b)
 {
if (b->tvheap) {
-   ATOMIC_DESTROY(>tvheap->refs);
GDKfree(b->tvheap);
}
PROPdestroy_nolock(b);
@@ -716,7 +715,6 @@ BATdestroy(BAT *b)
MT_lock_destroy(>batIdxLock);
MT_rwlock_destroy(>thashlock);
if (b->theap) {
-   ATOMIC_DESTROY(>theap->refs);
GDKfree(b->theap);
}
if (b->oldtail) {
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -697,7 +697,6 @@ HEAPdecref(Heap *h, bool remove)
//printf("dec ref(%d) %p %d\n", (int)h->refs, h, h->parentid);
switch (refs & HEAPREFS) {
case 0:
-   ATOMIC_DESTROY(>refs);
HEAPfree(h, (bool) (refs & HEAPREMOVE));
GDKfree(h);
break;
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -837,7 +837,6 @@ IMPSdecref(Imprints *imprints, bool remo
ATOMIC_OR(>imprints.refs, HEAPREMOVE);
ATOMIC_BASE_TYPE refs = ATOMIC_DEC(>imprints.refs);
if ((refs & HEAPREFS) == 0) {
-   ATOMIC_DESTROY(>imprints.refs);
HEAPfree(>imprints, (bool) (refs & HEAPREMOVE));
GDKfree(imprints);
}
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2319,8 +2319,6 @@ log_load(const char *fn, const char *log
logbat_destroy(lg->seqs_id);
logbat_destroy(lg->seqs_val);
logbat_destroy(lg->dseqs);
-   ATOMIC_DESTROY(>current->refcount);
-   ATOMIC_DESTROY(>nr_flushers);
MT_lock_destroy(>lock);
MT_lock_destroy(>rotation_lock);
GDKfree(lg->fn);
@@ -2462,10 +2460,6 @@ log_destroy(logger *lg)
log_close_output(lg);
for (logged_range * p = lg->pending; p; p = lg->pending) {
lg->pending = p->next;
-   ATOMIC_DESTROY(>refcount);
-   ATOMIC_DESTROY(>last_ts);
-   ATOMIC_DESTROY(>flushed_ts);
-   ATOMIC_DESTROY(>drops);
GDKfree(p);
}
if (LOG_DISABLED(lg)) {
@@ -2500,7 +2494,6 @@ log_destroy(logger *lg)
MT_lock_destroy(>lock);
MT_lock_destroy(>rotation_lock);
MT_lock_destroy(>flush_lock);
-   ATOMIC_DESTROY(>nr_flushers);
GDKfree(lg->fn);
GDKfree(lg->dir);
GDKfree(lg->rbuf);
diff --git a/gdk/gdk_rtree.c b/gdk/gdk_rtree.c
--- a/gdk/gdk_rtree.c
+++ b/gdk/gdk_rtree.c
@@ -61,7 +61,6 @@ RTREEdecref(BAT *b)
ATOMIC_BASE_TYPE refs = ATOMIC_DEC(>trtree->refs);
//If RTree is marked for 

  1   2   3   4   5   6   7   8   9   10   >