MonetDB: Dec2023 - Don't just convert / but also \ into \\ for p...

2023-11-17 Thread Sjoerd Mullender via checkin-list
Changeset: ebf3cb2066e9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ebf3cb2066e9
Modified Files:
testing/CMakeLists.txt
Branch: Dec2023
Log Message:

Don't just convert / but also \ into \\ for proper quoting in strings.
Needed to run Mtest.py with Python 3.12.


diffs (21 lines):

diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt
--- a/testing/CMakeLists.txt
+++ b/testing/CMakeLists.txt
@@ -21,7 +21,7 @@ set(QXinfodir "${CMAKE_INSTALL_INFODIR}"
 set(QXlibdir "${CMAKE_INSTALL_FULL_LIBDIR}")
 set(QXlibexecdir "${CMAKE_INSTALL_LIBEXECDIR}")
 if (WIN32)
-  string(REPLACE "/" "" QXlocalstatedir 
"${CMAKE_INSTALL_FULL_LOCALSTATEDIR}")
+  string(REGEX REPLACE "[/\\]" "" QXlocalstatedir 
"${CMAKE_INSTALL_FULL_LOCALSTATEDIR}")
 else()
   set(QXlocalstatedir "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}")
 endif()
@@ -29,7 +29,7 @@ set(QXmandir "${CMAKE_INSTALL_MANDIR}")
 set(QXprefix "${CMAKE_INSTALL_PREFIX}")
 set(QXPYTHON "${Python3_EXECUTABLE}")
 if (WIN32)
-  string(REPLACE "/" "" QXPYTHON_LIBDIR "${PYTHON3_LIBDIR}")
+  string(REGEX REPLACE "[/\\]" "" QXPYTHON_LIBDIR "${PYTHON3_LIBDIR}")
 else()
   set(QXPYTHON_LIBDIR "${PYTHON3_LIBDIR}")
 endif()
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Jun2023 - Don't just convert / but also \ into \\ for p...

2023-11-17 Thread Sjoerd Mullender via checkin-list
Changeset: 11cd864c1dec for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/11cd864c1dec
Modified Files:
testing/CMakeLists.txt
Branch: Jun2023
Log Message:

Don't just convert / but also \ into \\ for proper quoting in strings.
Needed to run Mtest.py with Python 3.12.


diffs (21 lines):

diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt
--- a/testing/CMakeLists.txt
+++ b/testing/CMakeLists.txt
@@ -21,7 +21,7 @@ set(QXinfodir "${CMAKE_INSTALL_INFODIR}"
 set(QXlibdir "${CMAKE_INSTALL_FULL_LIBDIR}")
 set(QXlibexecdir "${CMAKE_INSTALL_LIBEXECDIR}")
 if (WIN32)
-  string(REPLACE "/" "" QXlocalstatedir 
"${CMAKE_INSTALL_FULL_LOCALSTATEDIR}")
+  string(REGEX REPLACE "[/\\]" "" QXlocalstatedir 
"${CMAKE_INSTALL_FULL_LOCALSTATEDIR}")
 else()
   set(QXlocalstatedir "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}")
 endif()
@@ -29,7 +29,7 @@ set(QXmandir "${CMAKE_INSTALL_MANDIR}")
 set(QXprefix "${CMAKE_INSTALL_PREFIX}")
 set(QXPYTHON "${Python3_EXECUTABLE}")
 if (WIN32)
-  string(REPLACE "/" "" QXPYTHON_LIBDIR "${PYTHON3_LIBDIR}")
+  string(REGEX REPLACE "[/\\]" "" QXPYTHON_LIBDIR "${PYTHON3_LIBDIR}")
 else()
   set(QXPYTHON_LIBDIR "${PYTHON3_LIBDIR}")
 endif()
___
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.

2023-11-17 Thread Sjoerd Mullender via checkin-list
Changeset: 2ee1d8519a68 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2ee1d8519a68
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (truncated from 329 to 300 lines):

diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Build-Depends: debhelper (>= 12), cmake 
  libxml2-dev, pkg-config,
  python3, python3-dev, python3-numpy,
  unixodbc-dev, zlib1g-dev, r-base-dev,
- libcfitsio-dev, openssl-dev (>= 1.1.1)
+ libcfitsio-dev, libssl-dev (>= 1.1.1)
 Standards-Version: 3.8.0
 X-Python-Version: >= 2.6
 
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1292,12 +1292,12 @@ BUNappendmulti(BAT *b, const void *value
(count > 1 ||
 b->tseqbase + b->batCount != ((oid *) 
values)[0]))
b->tseqbase = oid_nil;
-   if (b->tsorted && ((oid *) 
b->theap->base)[b->batCount - 1] > ((oid *) values)[0]) {
+   if (b->tsorted && !is_oid_nil(((oid *) 
b->theap->base)[b->batCount - 1]) && ((oid *) b->theap->base)[b->batCount - 1] 
> ((oid *) values)[0]) {
b->tsorted = false;
if (b->tnosorted == 0)
b->tnosorted = b->batCount;
}
-   if (b->trevsorted && ((oid *) 
b->theap->base)[b->batCount - 1] < ((oid *) values)[0]) {
+   if (b->trevsorted && !is_oid_nil(((oid *) 
values)[0]) && ((oid *) b->theap->base)[b->batCount - 1] < ((oid *) values)[0]) 
{
b->trevsorted = false;
if (b->tnorevsorted == 0)
b->tnorevsorted = b->batCount;
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -4028,6 +4028,13 @@ bailout:
return NULL;
 }
 
+#define HANDLE_TIMEOUT \
+   do {\
+   GDKerror("%s\n", GDKexiting() ? EXITING_MSG : TIMEOUT_MSG); \
+   BBPreclaim(bn); \
+   bn = NULL;  \
+   } while (0)
+
 BAT *
 BATcalcbetween(BAT *b, BAT *lo, BAT *hi, BAT *s, BAT *slo, BAT *shi,
   bool symmetric, bool linc, bool hinc, bool nils_false, bool anti)
@@ -4064,20 +4071,50 @@ BATcalcbetween(BAT *b, BAT *lo, BAT *hi,
BATiter bi = bat_iterator(b);
BATiter loi = bat_iterator(lo);
BATiter hii = bat_iterator(hi);
-   bn = BATcalcbetween_intern(bi.base, 1,
-  bi.vh ? bi.vh->base : NULL,
-  bi.width,
-  loi.base, 1,
-  loi.vh ? loi.vh->base : NULL,
-  loi.width,
-  hii.base, 1,
-  hii.vh ? hii.vh->base : NULL,
-  hii.width,
-  bi.type,
-  &ci, &cilo, &cihi,
-  b->hseqbase, lo->hseqbase, hi->hseqbase,
-  symmetric, anti, linc, hinc,
-  nils_false, __func__);
+   if (b->ttype == TYPE_void || lo->ttype == TYPE_void || hi->ttype == 
TYPE_void) {
+   lng timeoffset = 0;
+   QryCtx *qry_ctx = MT_thread_get_qry_ctx();
+   if (qry_ctx != NULL) {
+   timeoffset = (qry_ctx->starttime && 
qry_ctx->querytimeout) ? (qry_ctx->starttime + qry_ctx->querytimeout) : 0;
+   }
+   bn = COLnew(ci.seq, TYPE_bit, ci.ncand, TRANSIENT);
+   if (bn) {
+   bit *restrict dst = (bit *) Tloc(bn, 0);
+   BUN i, j, k, l;
+   BUN nils = 0;
+   TIMEOUT_LOOP_IDX(l, ci.ncand, timeoffset) {
+   i = canditer_next(&ci) - b->hseqbase;
+   j = canditer_next(&cilo) - lo->hseqbase;
+   k = canditer_next(&cihi) - hi->hseqbase;
+   dst[l] = BETWEEN(BUNtoid(b, i),
+BUNtoid(lo, j),
+BUNtoid(hi, k), oid);
+   nils += is_bit_nil(dst[l]);
+   }
+   BATsetcount(bn, ci.ncand);
+   bn->tsorted = ci.ncand <= 1 || nils == ci.ncand;
+   bn->trevsorted = ci.ncand <= 1 || nils == ci.ncand;
+

MonetDB: default - Adds test for joining remote merge table with...

2023-11-17 Thread stefanos mavros via checkin-list
Changeset: 93a742638f93 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/93a742638f93
Added Files:
sql/test/rel-optimizers/Tests/join-merge-remote-replica.py
Modified Files:
sql/test/rel-optimizers/Tests/All
Branch: default
Log Message:

Adds test for joining remote merge table with replicas


diffs (140 lines):

diff --git a/sql/test/rel-optimizers/Tests/All 
b/sql/test/rel-optimizers/Tests/All
--- a/sql/test/rel-optimizers/Tests/All
+++ b/sql/test/rel-optimizers/Tests/All
@@ -2,6 +2,7 @@ split-select
 groupby-cse
 groupjoin
 join-merge-remote-replica-plan
+join-merge-remote-replica
 replicas-base
 replicas-join
 local-replica
diff --git a/sql/test/rel-optimizers/Tests/join-merge-remote-replica.py 
b/sql/test/rel-optimizers/Tests/join-merge-remote-replica.py
new file mode 100644
--- /dev/null
+++ b/sql/test/rel-optimizers/Tests/join-merge-remote-replica.py
@@ -0,0 +1,124 @@
+import os, sys, tempfile, pymonetdb
+
+try:
+from MonetDBtesting import process
+except ImportError:
+import process
+
+with tempfile.TemporaryDirectory() as farm_dir:
+os.mkdir(os.path.join(farm_dir, 'master'))
+os.mkdir(os.path.join(farm_dir, 'node2'))
+os.mkdir(os.path.join(farm_dir, 'node3'))
+
+with (
+process.server(mapiport='0', dbname='master',
+   dbfarm=os.path.join(farm_dir, 'master'),
+   stdin=process.PIPE, stdout=process.PIPE,
+   stderr=process.PIPE) as prc_1,
+process.server(mapiport='0', dbname='node2',
+   dbfarm=os.path.join(farm_dir, 'node2'),
+   stdin=process.PIPE, stdout=process.PIPE,
+   stderr=process.PIPE) as prc_2,
+process.server(mapiport='0', dbname='node3',
+   dbfarm=os.path.join(farm_dir, 'node3'),
+   stdin=process.PIPE, stdout=process.PIPE,
+   stderr=process.PIPE) as prc_3
+):
+# create foo_p2 and members_n2 in node2
+conn2 = pymonetdb.connect(database='node2', port=prc_2.dbport, 
autocommit=True)
+cur2 = conn2.cursor()
+
+cur2.execute("create table foo_p2 (n int, m text)")
+if cur2.execute("insert into foo_p2 values (4, 'I'), (5, 'am'), (6, 
'node2!')") != 3:
+sys.stderr.write("3 rows inserted expected\n")
+
+cur2.execute("create table members_n2 (n int, m text)")
+if cur2.execute("insert into members_n2 values (1, 'alice'), (2, 
'bob')") != 2:
+sys.stderr.write("2 rows inserted expected\n")
+
+cur2.close()
+conn2.close()
+
+# create foo_p2 and members_n2 in node2
+conn3 = pymonetdb.connect(database='node3', port=prc_3.dbport, 
autocommit=True)
+cur3 = conn3.cursor()
+
+cur3.execute("create table foo_p3 (n int, m text)")
+if cur3.execute("insert into foo_p3 values (7, 'hi'), (8, 'from'), (9, 
'node3!')") != 3:
+sys.stderr.write("3 rows inserted expected\n")
+
+cur3.execute("create table members_n3 (n int, m text)")
+if cur3.execute("insert into members_n3 values (1, 'alice'), (2, 
'bob')") != 2:
+sys.stderr.write("2 rows inserted expected\n")
+
+cur3.close()
+conn3.close()
+
+# create foo_merge and member_rpl on master
+conn1 = pymonetdb.connect(database='master', port=prc_1.dbport, 
autocommit=True)
+cur1 = conn1.cursor()
+
+cur1.execute("create table foo_p1 (n int, m text)")
+if cur1.execute("insert into foo_p1 values (1, 'hello'), (2, 'world'), 
(3, '!!')") != 3:
+sys.stderr.write("3 rows inserted expected\n")
+cur1.execute("create remote table foo_p2 (n int, m text) on 
'mapi:monetdb://localhost:"+str(prc_2.dbport)+"/node2'")
+cur1.execute("create remote table foo_p3 (n int, m text) on 
'mapi:monetdb://localhost:"+str(prc_3.dbport)+"/node3'")
+cur1.execute("create merge table foo_merge (n int, m text)")
+cur1.execute("alter table foo_merge add table foo_p1")
+cur1.execute("alter table foo_merge add table foo_p2")
+cur1.execute("alter table foo_merge add table foo_p3")
+
+cur1.execute("create table members_n1 (n int, m text)")
+if cur1.execute("insert into members_n1 values (1, 'alice'), (2, 
'bob')") != 2:
+sys.stderr.write("2 rows inserted expected\n")
+cur1.execute("create remote table members_n2 (n int, m text) on 
'mapi:monetdb://localhost:"+str(prc_2.dbport)+"/node2'")
+cur1.execute("create remote table members_n3 (n int, m text) on 
'mapi:monetdb://localhost:"+str(prc_3.dbport)+"/node3'")
+cur1.execute("create replica table members_rpl (n int, m text)")
+cur1.execute("alter table members_rpl add table members_n1")
+cur1.execute("alter table members_rpl add table members_n2")
+cur1.execute("alter table members_rpl add table members_

MonetDB: default - Adds actual query execution in local replicas...

2023-11-17 Thread stefanos mavros via checkin-list
Changeset: 62c7534aa238 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/62c7534aa238
Modified Files:
sql/test/rel-optimizers/Tests/local-replica.test
sql/test/rel-optimizers/Tests/replicas-base.test
Branch: default
Log Message:

Adds actual query execution in local replicas test


diffs (62 lines):

diff --git a/sql/test/rel-optimizers/Tests/local-replica.test 
b/sql/test/rel-optimizers/Tests/local-replica.test
--- a/sql/test/rel-optimizers/Tests/local-replica.test
+++ b/sql/test/rel-optimizers/Tests/local-replica.test
@@ -28,6 +28,46 @@ project (
 | ) [  ]
 ) [ "foo_rpl_loc"."n", "foo_rpl_loc"."m", "bar_rpl_loc"."n", "bar_rpl_loc"."m" 
]
 
+query ITIT rowsort
+select * from foo_rpl_loc, bar_rpl_loc
+
+1
+hello
+10
+alice
+1
+hello
+20
+bob
+1
+hello
+30
+tom
+2
+world
+10
+alice
+2
+world
+20
+bob
+2
+world
+30
+tom
+3
+!!
+10
+alice
+3
+!!
+20
+bob
+3
+!!
+30
+tom
+
 query T nosort
 plan select * from foo_rpl_loc, buz_rmt
 
diff --git a/sql/test/rel-optimizers/Tests/replicas-base.test 
b/sql/test/rel-optimizers/Tests/replicas-base.test
--- a/sql/test/rel-optimizers/Tests/replicas-base.test
+++ b/sql/test/rel-optimizers/Tests/replicas-base.test
@@ -15,7 +15,7 @@ statement ok
 create table bar_local (n int, m text)
 
 statement ok
-insert into bar_local values (10, 'alice'), (2, 'bob'), (3, 'tom'), (4, 
'jerry')
+insert into bar_local values (10, 'alice'), (20, 'bob'), (30, 'tom')
 
 statement ok
 create remote table bar_r2 (n int, m text) on 
'mapi:monetdb://localhost:50002/node2'
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Adds test for local-replica with actual remote

2023-11-17 Thread stefanos mavros via checkin-list
Changeset: 358a56d45250 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/358a56d45250
Added Files:
sql/test/rel-optimizers/Tests/local-replica-with-actual-remote.py
Modified Files:
sql/test/rel-optimizers/Tests/All
Branch: default
Log Message:

Adds test for local-replica with actual remote


diffs (90 lines):

diff --git a/sql/test/rel-optimizers/Tests/All 
b/sql/test/rel-optimizers/Tests/All
--- a/sql/test/rel-optimizers/Tests/All
+++ b/sql/test/rel-optimizers/Tests/All
@@ -6,4 +6,5 @@ join-merge-remote-replica
 replicas-base
 replicas-join
 local-replica
+local-replica-with-actual-remote
 remote-replica
diff --git a/sql/test/rel-optimizers/Tests/local-replica-with-actual-remote.py 
b/sql/test/rel-optimizers/Tests/local-replica-with-actual-remote.py
new file mode 100644
--- /dev/null
+++ b/sql/test/rel-optimizers/Tests/local-replica-with-actual-remote.py
@@ -0,0 +1,76 @@
+import os, sys, tempfile, pymonetdb
+
+try:
+from MonetDBtesting import process
+except ImportError:
+import process
+
+with tempfile.TemporaryDirectory() as farm_dir:
+os.mkdir(os.path.join(farm_dir, 'master'))
+os.mkdir(os.path.join(farm_dir, 'node2'))
+os.mkdir(os.path.join(farm_dir, 'node3'))
+
+with (
+process.server(mapiport='0', dbname='master',
+   dbfarm=os.path.join(farm_dir, 'master'),
+   stdin=process.PIPE, stdout=process.PIPE,
+   stderr=process.PIPE) as prc_1,
+process.server(mapiport='0', dbname='node2',
+   dbfarm=os.path.join(farm_dir, 'node2'),
+   stdin=process.PIPE, stdout=process.PIPE,
+   stderr=process.PIPE) as prc_2
+):
+# create buz_rmt in node2
+conn2 = pymonetdb.connect(database='node2', port=prc_2.dbport, 
autocommit=True)
+cur2 = conn2.cursor()
+
+cur2.execute("create table buz_rmt (l int)")
+if cur2.execute("insert into buz_rmt values (10), (20), (30) ") != 3:
+sys.stderr.write("3 rows inserted expected\n")
+
+cur2.close()
+conn2.close()
+
+# create foo_rpl_loc and remote buz_rmt on master
+conn1 = pymonetdb.connect(database='master', port=prc_1.dbport, 
autocommit=True)
+cur1 = conn1.cursor()
+
+cur1.execute("create table foo_local (n int, m text)")
+if cur1.execute("insert into foo_local values (1, 'hello'), (2, 
'world'), (3, '!!')") != 3:
+sys.stderr.write("3 rows inserted expected\n")
+
+cur1.execute("create remote table buz_rmt (l int) on 
'mapi:monetdb://localhost:"+str(prc_2.dbport)+"/node2'")
+
+exp_no_rows = 9
+p = cur1.execute("select * from foo_local, buz_rmt")
+if p != exp_no_rows:
+sys.stderr.write(f'Expecting {exp_no_rows}: we got {p}\n')
+
+exp_rows = [
+(1, 'hello', 10),
+(1, 'hello', 20),
+(1, 'hello', 30),
+(2, 'world', 10),
+(2, 'world', 20),
+(2, 'world', 30),
+(3, '!!', 10),
+(3, '!!', 20),
+(3, '!!', 30)
+]
+res = cur1.fetchall()
+for r in res:
+if r not in exp_rows:
+sys.stderr.write(f'Result row {r} is not expected\n')
+else:
+exp_rows.remove(r)
+
+if len(exp_rows) != 0:
+sys.stderr.write(f'Some expected results where not detected:\n')
+for r in exp_rows:
+sys.stderr.write(str(r)+'\n')
+
+cur1.close()
+conn1.close()
+
+prc_1.communicate()
+prc_2.communicate()
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Renames replicas test

2023-11-17 Thread stefanos mavros via checkin-list
Changeset: 7806fd4c09f1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7806fd4c09f1
Added Files:
sql/test/rel-optimizers/Tests/replicas-join-plan.reqtests
sql/test/rel-optimizers/Tests/replicas-join-plan.test
Removed Files:
sql/test/rel-optimizers/Tests/replicas-join.reqtests
sql/test/rel-optimizers/Tests/replicas-join.test
Modified Files:
sql/test/rel-optimizers/Tests/All
Branch: default
Log Message:

Renames replicas test


diffs (18 lines):

diff --git a/sql/test/rel-optimizers/Tests/All 
b/sql/test/rel-optimizers/Tests/All
--- a/sql/test/rel-optimizers/Tests/All
+++ b/sql/test/rel-optimizers/Tests/All
@@ -4,7 +4,7 @@ groupjoin
 join-merge-remote-replica-plan
 join-merge-remote-replica
 replicas-base
-replicas-join
+replicas-join-plan
 local-replica
 local-replica-with-actual-remote
 remote-replica
diff --git a/sql/test/rel-optimizers/Tests/replicas-join.reqtests 
b/sql/test/rel-optimizers/Tests/replicas-join-plan.reqtests
rename from sql/test/rel-optimizers/Tests/replicas-join.reqtests
rename to sql/test/rel-optimizers/Tests/replicas-join-plan.reqtests
diff --git a/sql/test/rel-optimizers/Tests/replicas-join.test 
b/sql/test/rel-optimizers/Tests/replicas-join-plan.test
rename from sql/test/rel-optimizers/Tests/replicas-join.test
rename to sql/test/rel-optimizers/Tests/replicas-join-plan.test
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - mo_find_option returns string that should not...

2023-11-17 Thread Sjoerd Mullender via checkin-list
Changeset: 0f6e613ee580 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0f6e613ee580
Modified Files:
clients/Tests/exports.stable.out
common/options/monet_options.c
common/options/monet_options.h
tools/mserver/mserver5.c
Branch: Dec2023
Log Message:

mo_find_option returns string that should not be changed, so make it const.


diffs (75 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
@@ -570,7 +570,7 @@ void *mdlopen(const char *library, int m
 const char *mercurial_revision(void) __attribute__((__const__));
 int mo_add_option(opt **Set, int setlen, opt_kind kind, const char *name, 
const char *value);
 int mo_builtin_settings(opt **Set);
-char *mo_find_option(opt *set, int setlen, const char *name);
+const char *mo_find_option(opt *set, int setlen, const char *name);
 void mo_free_options(opt *set, int setlen);
 void mo_print_options(opt *set, int setlen);
 int mo_system_config(opt **Set, int setlen);
@@ -720,7 +720,7 @@ const char *mcrypt_getHashAlgorithms(voi
 char *mcrypt_hashPassword(const char *algo, const char *password, const char 
*challenge);
 int mo_add_option(opt **Set, int setlen, opt_kind kind, const char *name, 
const char *value);
 int mo_builtin_settings(opt **Set);
-char *mo_find_option(opt *set, int setlen, const char *name);
+const char *mo_find_option(opt *set, int setlen, const char *name);
 void mo_free_options(opt *set, int setlen);
 void mo_print_options(opt *set, int setlen);
 int mo_system_config(opt **Set, int setlen);
diff --git a/common/options/monet_options.c b/common/options/monet_options.c
--- a/common/options/monet_options.c
+++ b/common/options/monet_options.c
@@ -87,7 +87,7 @@ mo_print_options(opt *set, int setlen)
 }
 
 
-char *
+const char *
 mo_find_option(opt *set, int setlen, const char *name)
 {
opt *o = NULL;
@@ -105,7 +105,7 @@ mo_find_option(opt *set, int setlen, con
 }
 
 static int
-mo_config_file(opt **Set, int setlen, char *file)
+mo_config_file(opt **Set, int setlen, const char *file)
 {
char buf[BUFSIZ];
FILE *fd = NULL;
@@ -197,7 +197,7 @@ mo_config_file(opt **Set, int setlen, ch
 int
 mo_system_config(opt **Set, int setlen)
 {
-   char *cfg;
+   const char *cfg;
 
if (Set == NULL) {
if (default_set == NULL) {
diff --git a/common/options/monet_options.h b/common/options/monet_options.h
--- a/common/options/monet_options.h
+++ b/common/options/monet_options.h
@@ -36,7 +36,7 @@ moptions_export void mo_print_options(op
 
 /* mo_find_option, finds the option with the given name in the option set
(set,setlen). */
-moptions_export char *mo_find_option(opt *set, int setlen, const char *name);
+moptions_export const char *mo_find_option(opt *set, int setlen, const char 
*name);
 
 /* mo_system_config will add the options from the system config file
(returns the new setlen) */
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -194,7 +194,7 @@ monet_hello(void)
 }
 
 static str
-absolute_path(str s)
+absolute_path(const char *s)
 {
if (!MT_path_absolute(s)) {
str ret = (str) GDKmalloc(strlen(s) + strlen(monet_cwd) + 2);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Adds query for execution on replicas test

2023-11-17 Thread stefanos mavros via checkin-list
Changeset: efdfe26e75b5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/efdfe26e75b5
Modified Files:
sql/test/rel-optimizers/Tests/replicas-join-plan.test
Branch: default
Log Message:

Adds query for execution on replicas test


diffs (52 lines):

diff --git a/sql/test/rel-optimizers/Tests/replicas-join-plan.test 
b/sql/test/rel-optimizers/Tests/replicas-join-plan.test
--- a/sql/test/rel-optimizers/Tests/replicas-join-plan.test
+++ b/sql/test/rel-optimizers/Tests/replicas-join-plan.test
@@ -39,6 +39,48 @@ project (
 | ) [  ]
 ) [ "foo_rpl"."n", "foo_rpl"."m", "bar_rpl"."n", "bar_rpl"."m" ]
 
+# we can execute this test because we are not expecting any data send to
+# any remote. the crossproduct is going to be executed locally
+query ITIT rowsort
+select * from foo_rpl, bar_rpl
+
+1
+hello
+10
+alice
+1
+hello
+20
+bob
+1
+hello
+30
+tom
+2
+world
+10
+alice
+2
+world
+20
+bob
+2
+world
+30
+tom
+3
+!!
+10
+alice
+3
+!!
+20
+bob
+3
+!!
+30
+tom
+
 # In the next test and given the implentation of the remote optimizer we 
 # expect the replicas to be resolved to the remote tables. The optimizer 
 # could be in principle be adapted to resolve the replica crossproduct
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Adds new test for replicas-join with actual r...

2023-11-17 Thread stefanos mavros via checkin-list
Changeset: e5fda2c7200f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e5fda2c7200f
Added Files:
sql/test/rel-optimizers/Tests/replicas-join.py
Branch: default
Log Message:

Adds new test for replicas-join with actual remotes


diffs (154 lines):

diff --git a/sql/test/rel-optimizers/Tests/replicas-join.py 
b/sql/test/rel-optimizers/Tests/replicas-join.py
new file mode 100644
--- /dev/null
+++ b/sql/test/rel-optimizers/Tests/replicas-join.py
@@ -0,0 +1,149 @@
+import os, sys, tempfile, pymonetdb
+
+try:
+from MonetDBtesting import process
+except ImportError:
+import process
+
+with tempfile.TemporaryDirectory() as farm_dir:
+os.mkdir(os.path.join(farm_dir, 'master'))
+os.mkdir(os.path.join(farm_dir, 'node2'))
+os.mkdir(os.path.join(farm_dir, 'node3'))
+
+with (
+process.server(mapiport='0', dbname='master',
+   dbfarm=os.path.join(farm_dir, 'master'),
+   stdin=process.PIPE, stdout=process.PIPE,
+   stderr=process.PIPE) as prc_1,
+process.server(mapiport='0', dbname='node2',
+   dbfarm=os.path.join(farm_dir, 'node2'),
+   stdin=process.PIPE, stdout=process.PIPE,
+   stderr=process.PIPE) as prc_2,
+process.server(mapiport='0', dbname='node3',
+   dbfarm=os.path.join(farm_dir, 'node3'),
+   stdin=process.PIPE, stdout=process.PIPE,
+   stderr=process.PIPE) as prc_3
+):
+# create foo_p2 and members_n2 in node2
+conn2 = pymonetdb.connect(database='node2', port=prc_2.dbport, 
autocommit=True)
+cur2 = conn2.cursor()
+
+cur2.execute("create table foo_p2 (n int, m text)")
+if cur2.execute("insert into foo_p2 values (1, 'hello'), (2, 
'world')") != 2:
+sys.stderr.write("2 rows inserted expected\n")
+
+cur2.execute("create table bar_r2 (n int, m text)")
+if cur2.execute("insert into bar_r2 values (10, 'alice'), (20, 'bob'), 
(30, 'tom')") != 3:
+sys.stderr.write("3 rows inserted expected\n")
+
+cur2.execute("create table buz_rmt (l int)")
+if cur2.execute("insert into buz_rmt values (42), (43)") != 2:
+sys.stderr.write("2 rows inserted expected\n")
+
+cur2.close()
+conn2.close()
+
+# create foo_p2 and members_n2 in node2
+conn3 = pymonetdb.connect(database='node3', port=prc_3.dbport, 
autocommit=True)
+cur3 = conn3.cursor()
+
+cur3.execute("create table foo_p3 (n int, m text)")
+if cur3.execute("insert into foo_p3 values (1, 'hello'), (2, 
'world')") != 2:
+sys.stderr.write("2 row inserted expected\n")
+
+cur3.execute("create table bar_r3 (n int, m text)")
+if cur3.execute("insert into bar_r3 values (10, 'alice'), (20, 'bob'), 
(30, 'tom')") != 3:
+sys.stderr.write("3 rows inserted expected\n")
+
+cur3.close()
+conn3.close()
+
+# create foo_rpl and bar_rpl on master
+conn1 = pymonetdb.connect(database='master', port=prc_1.dbport, 
autocommit=True)
+cur1 = conn1.cursor()
+
+cur1.execute("create table foo_local (n int, m text)")
+if cur1.execute("insert into foo_local values (1, 'hello'), (2, 
'world')") != 2:
+sys.stderr.write("2 rows inserted expected\n")
+cur1.execute("create remote table foo_p2 (n int, m text) on 
'mapi:monetdb://localhost:"+str(prc_2.dbport)+"/node2'")
+cur1.execute("create remote table foo_p3 (n int, m text) on 
'mapi:monetdb://localhost:"+str(prc_3.dbport)+"/node3'")
+cur1.execute("create replica table foo_rpl (n int, m text)")
+cur1.execute("alter table foo_rpl add table foo_local")
+cur1.execute("alter table foo_rpl add table foo_p2")
+cur1.execute("alter table foo_rpl add table foo_p3")
+
+cur1.execute("create table bar_local (n int, m text)")
+if cur1.execute("insert into bar_local values (10, 'alice'), (20, 
'bob'), (30, 'tom')") != 3:
+sys.stderr.write("3 rows inserted expected\n")
+cur1.execute("create remote table bar_r2 (n int, m text) on 
'mapi:monetdb://localhost:"+str(prc_2.dbport)+"/node2'")
+cur1.execute("create remote table bar_r3 (n int, m text) on 
'mapi:monetdb://localhost:"+str(prc_3.dbport)+"/node3'")
+cur1.execute("create replica table bar_rpl (n int, m text)")
+cur1.execute("alter table bar_rpl add table bar_local")
+cur1.execute("alter table bar_rpl add table bar_r2")
+cur1.execute("alter table bar_rpl add table bar_r3")
+
+cur1.execute("create remote table buz_rmt (l int) on 
'mapi:monetdb://localhost:"+str(prc_2.dbport)+"/node2'")
+
+exp_no_rows = 6
+p = cur1.execute("select * from foo_rpl, bar_rpl")
+if p != exp_no_rows:
+sys.stderr.write(f'Expec

MonetDB: Dec2023 - Add missing test file.

2023-11-17 Thread Sjoerd Mullender via checkin-list
Changeset: 8d25134ecf35 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8d25134ecf35
Added Files:
sql/test/BugTracker-2023/Tests/between-crash-7413.test
Branch: Dec2023
Log Message:

Add missing test file.


diffs (14 lines):

diff --git a/sql/test/BugTracker-2023/Tests/between-crash-7413.test 
b/sql/test/BugTracker-2023/Tests/between-crash-7413.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2023/Tests/between-crash-7413.test
@@ -0,0 +1,9 @@
+statement ok
+CREATE TABLE v0 (v1 oid)
+
+statement ok
+INSERT INTO v0 (v1) VALUES (NULL) , (3) , (46) , (10) , (1)
+
+statement ok
+DELETE FROM v0 WHERE v1 <= (SELECT 2 AS zero WHERE (v1 BETWEEN 1 AND (SELECT 
MAX (v1) FROM v0 name)) >= v1)
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Updated manual pages.

2023-11-17 Thread Sjoerd Mullender via checkin-list
Changeset: 46fa5142a45f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/46fa5142a45f
Modified Files:
clients/mapiclient/mclient.1
documentation/source/manual_pages/mclient.rst
documentation/source/manual_pages/monetdb.rst
documentation/source/manual_pages/monetdbd.rst.in
documentation/source/manual_pages/mserver5.rst.in
tools/merovingian/client/monetdb.1
tools/merovingian/daemon/monetdbd.1.in
tools/mserver/mserver5.1.in
Branch: Dec2023
Log Message:

Updated manual pages.
Use proper code to represent glyphs that groff otherwise might render in
a way that we don't want.


diffs (truncated from 597 to 300 lines):

diff --git a/clients/mapiclient/mclient.1 b/clients/mapiclient/mclient.1
--- a/clients/mapiclient/mclient.1
+++ b/clients/mapiclient/mclient.1
@@ -58,7 +58,7 @@ or if the
 option is given,
 .I mclient
 interprets lines starting with
-.B \e
+.B \[rs]
 (backslash) specially.
 See the section BACKSLASH COMMANDS below.
 .PP
@@ -126,7 +126,7 @@ option but not to the contents of files 
 (except for
 .B \-
 which refers to standard input) or files specified using the
-.B \e<
+.B \[rs]<
 command (those must be encoded using UTF-8).
 The default encoding is taken from the locale.
 .TP
@@ -149,7 +149,7 @@ The \fB\-d\fP can be omitted if an equal
 the current directory.
 As such, the first non-option argument will be interpreted as database
 to connect to if the argument does not exist as file.
-Valid URIs are as returned by `monetdb discover`, see
+Valid URIs are as returned by ``monetdb discover'', see
 .IR monetdb (1),
 and look like
 \fBmapi:monetdb://\fP\fIhostname\fP\fB:\fP\fIport\fP\fB/\fP\fIdatabase\fP.
@@ -167,7 +167,7 @@ Specify the portnumber of the server (de
 .TP
 \fB\-\-interactive\fP (\fB\-i\fP)
 When reading from standard input, interpret lines starting with
-.B \e
+.B \[rs]
 (backslash) specially.
 See the section BACKSLASH COMMANDS below.
 .TP
@@ -175,13 +175,13 @@ See the section BACKSLASH COMMANDS below
 The \fItimer\fP command controls the format of the time reported for queries.
 The default mode is \fBnone\fP which turns off timing reporting.
 The timer mode \fBclock\fP reports the client-side wall-clock time
-("\fBclk\fP") in a human-friendly format.
+(``\fBclk\fP'') in a human-friendly format.
 The timer mode \fBperformance\fP reports client-side wall-clock time
-("\fBclk\fP") as well as detailed server-side timings, all in milliseconds
+(``\fBclk\fP'') as well as detailed server-side timings, all in milliseconds
 (ms): the time to parse the SQL query, optimize the logical relational plan
-and create the initial physical (MAL) plan ("\fBsql\fP"); the time to
-optimize the physical (MAL) plan ("\fBopt\fP"); the time to execute the
-physical (MAL) plan ("\fBrun\fP").
+and create the initial physical (MAL) plan (``\fBsql\fP''); the time to
+optimize the physical (MAL) plan (``\fBopt\fP''); the time to execute the
+physical (MAL) plan (``\fBrun\fP'').
 All timings are reported on stderr.
 .br
 \fBNote\fP that the client-measured wall-clock time is reported per query
@@ -296,11 +296,11 @@ SQL Options
 \fB\-\-null=\fP\fInullstr\fP (\fB\-n\fP \fInullstr\fP)
 Set the string to be used as NULL representation when using the
 sql, csv, or tab output formats.
-If not used, NULL values are represented by the string \(dqnull\(dq in
+If not used, NULL values are represented by the string \[dq]null\[dq] in
 the sql output format, and as the empty string in the csv and tab
 output formats.
 Note that an argument is required, so in order to use the empty
-string, use \fB\-n \(dq\(dq\fP (with the space) or \fB\-\-null=\fP.
+string, use \fB\-n \[dq]\[dq]\fP (with the space) or \fB\-\-null=\fP.
 .TP
 \fB\-\-autocommit\fP (\fB\-a\fP)
 Switch autocommit mode off.
@@ -340,25 +340,25 @@ the dump.
 .SS
 General Commands
 .TP
-\fB\e?\fP
+\fB\[rs]?\fP
 Show a help message explaining the backslash commands.
 .TP
-\fB\eq\fP
+\fB\[rs]q\fP
 Exit
 .IR mclient .
 .TP
-\fB\e<\fP \fIfile\fP
+\fB\[rs]<\fP \fIfile\fP
 Read input from the named
 .IR file .
 .TP
-\fB\e>\fP \fIfile\fP
+\fB\[rs]>\fP \fIfile\fP
 Write output to the named
 .IR file .
 If no
 .I file
 is specified, write to standard output.
 .TP
-\fB\e|\fP \fIcommand\fP
+\fB\[rs]|\fP \fIcommand\fP
 Pipe output to the given
 .IR command .
 Each query is piped to a new invocation of the
@@ -367,28 +367,28 @@ If no
 .I command
 is given, revert to writing output to standard output.
 .TP
-\fB\eh\fP
+\fB\[rs]h\fP
 Show the
 .IR readline (3)
 history.
 .TP
-\fB\eL\fP \fIfile\fP
+\fB\[rs]L\fP \fIfile\fP
 Log client/server interaction in the given
 .IR file .
 If no
 .I file
 is specified, stop logging information.
 .TP
-\fB\eX\fP
+\fB\[rs]X\fP
 Trace what
 .I mclient
 is doing.
 This is mostly for debugging purposes.
 .TP
-\fB\ee\fP
+\fB\[rs]e\fP
 Echo the query in SQL formatting mode.
 .TP
-\fB\ef\fP \fIformat\fP
+\fB\[rs]f\fP \fIformat\fP
 Use the specified
 .I format
 mode to format the output.
@