MonetDB: ts_and_tz_to_str_fix - Upgrade code timestamp_to_str fo...

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: 79a0a8c6e27e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/79a0a8c6e27e
Modified Files:
sql/backends/monet5/sql_upgrades.c
Branch: ts_and_tz_to_str_fix
Log Message:

Upgrade code timestamp_to_str for databases that are alrdy in Jun2023.


diffs (54 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
@@ -5786,6 +5786,38 @@ sql_update_jun2023(Client c, mvc *sql, s
return err; /* usually MAL_SUCCEED */
 }
 
+static str
+sql_update_jun2023_sp3(Client c, mvc *sql, sql_schema *s)
+{
+   (void)s;
+   char *err = NULL;
+   sql_subtype t1, t2;
+
+   sql_find_subtype(&t1, "timestamp", 0, 0);
+   sql_find_subtype(&t2, "varchar", 0, 0);
+
+   if (!sql_bind_func(sql, "sys", "timestamp_to_str", &t1, &t2, F_FUNC, 
true)) {
+   sql->session->status = 0;
+   sql->errstr[0] = '\0';
+
+   char *query = GDKmalloc(512);
+   if (query == NULL)
+   throw(SQL, __func__, SQLSTATE(HY013) MAL_MALLOC_FAIL);
+
+   snprintf(query, 512, "CREATE FUNCTION timestamp_to_str(d 
TIMESTAMP, format STRING) RETURNS STRING "
+"EXTERNAL NAME mtime.\"timestamp_to_str\";\n"
+"GRANT EXECUTE ON FUNCTION 
timestamp_to_str(TIMESTAMP, STRING) TO PUBLIC;\n"
+"UPDATE sys.functions SET system = true WHERE 
system <> true AND name = 'timestamp_to_str' "
+"AND schema_id = 2000 and type = %d;\n", 
F_FUNC);
+
+   printf("Running database upgrade commands:\n%s\n", query);
+   err = SQLstatementIntern(c, query, "update", true, false, NULL);
+   GDKfree(query);
+   }
+
+   return err; /* usually MAL_SUCCEED */
+}
+
 int
 SQLupgrades(Client c, mvc *m)
 {
@@ -5993,5 +6025,11 @@ SQLupgrades(Client c, mvc *m)
return -1;
}
 
+   if ((err = sql_update_jun2023_sp3(c, m, s)) != NULL) {
+   TRC_CRITICAL(SQL_PARSER, "%s\n", err);
+   freeException(err);
+   return -1;
+   }
+
return 0;
 }
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: monetdburl - merged with default

2023-10-25 Thread Niels Nes via checkin-list
Changeset: 54be80b70b50 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/54be80b70b50
Branch: monetdburl
Log Message:

merged with default


diffs (truncated from 2240 to 300 lines):

diff --git a/documentation/index.rst b/documentation/index.rst
--- a/documentation/index.rst
+++ b/documentation/index.rst
@@ -31,6 +31,7 @@ Welcome to MonetDB's documentation!
source/cmake
source/release
source/developers_handbook
+   source/binary-resultset
 
 Indices and tables
 ==
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2279,21 +2279,27 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3
}
if (maybeextend(r1, r2, r3, nlx, 
lci->next, lci->ncand, maxsize) != GDK_SUCCEED)
goto bailout;
+   if (r3)
+   r3->tnil = false;
while (nlx > 0) {
lv = canditer_next(lci);
if (mlci == NULL || 
canditer_contains(mlci, lv)) {
APPEND(r1, lv);
if (r2)
APPEND(r2, 
oid_nil);
-   if (r3)
-   ((bit *) 
r3->theap->base)[r3->batCount++] = defmark;
+   if (r3) {
+   if (rhasnil || 
cmp(VALUE(l, lv - l->hseqbase), nil) == 0) {
+   ((bit 
*) r3->theap->base)[r3->batCount++] = bit_nil;
+   
r3->tnil = true;
+   } else {
+   ((bit 
*) r3->theap->base)[r3->batCount++] = 0;
+   }
+   }
}
nlx--;
}
if (r1->trevsorted && BATcount(r1) > 1)
r1->trevsorted = false;
-   if (r3)
-   r3->tnil = rhasnil;
} else {
canditer_setidx(lci, lci->next + nlx);
}
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2421,10 +2421,15 @@ log_cleanup_range(logger *lg, ulng id)
 static void
 do_rotate(logger *lg)
 {
-   logged_range *next = lg->current->next;
+   logged_range *cur = lg->current;
+   logged_range *next = cur->next;
if (next) {
assert(ATOMIC_GET(&next->refcount) == 1);
-   lg->current = lg->current->next;
+   lg->current = next;
+   if (!LOG_DISABLED(lg) && ATOMIC_GET(&cur->refcount) == 1) {
+   close_stream(cur->output_log);
+   cur->output_log = NULL;
+   }
}
 }
 
@@ -3099,7 +3104,14 @@ log_tflush(logger *lg, ulng file_id, uln
}
/* else somebody else has flushed our log file */
 
-   ATOMIC_DEC(&frange->refcount);
+   if (ATOMIC_DEC(&frange->refcount) == 1 && !LOG_DISABLED(lg)) {
+   rotation_lock(lg);
+   if (frange != lg->current) {
+   close_stream(frange->output_log);
+   frange->output_log = NULL;
+   }
+   rotation_unlock(lg);
+   }
 
if (ATOMIC_DEC(&lg->nr_flushers) == 0) {
/* I am the last flusher
diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All
--- a/monetdb5/mal/Tests/All
+++ b/monetdb5/mal/Tests/All
@@ -46,7 +46,7 @@ tst045
 tst046
 tst047
 tst048
-tst049
+HAVE_LIBPCRE?tst049
 tst050
 tst051
 tst052
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
@@ -140,6 +140,14 @@ JSONtoStorageString(JSON *jt, int idx, j
size_t sz = 0;
str msg = MAL_SUCCEED;
 
+   if (THRhighwater()) {
+   msg = createException(MAL, "json.new",
+   
SQLSTATE(42000)
+   "JSON 
object too complex to render into string.");

MonetDB: insertonly - Merge with default branch.

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: 0be46e17ee10 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0be46e17ee10
Modified Files:
gdk/gdk_logger.c
sql/backends/monet5/sql_upgrades.c
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
Branch: insertonly
Log Message:

Merge with default branch.


diffs (truncated from 4321 to 300 lines):

diff --git a/clients/examples/C/bincopydata.c b/clients/examples/C/bincopydata.c
--- a/clients/examples/C/bincopydata.c
+++ b/clients/examples/C/bincopydata.c
@@ -265,7 +265,7 @@ gen_json(FILE *f, bool byteswap, long nr
if (i % 100 == 99) {
fputc('\x80', f);
} else {
-   fprintf(f, "{\"id\": %ld, \"msg\":\n\"int%ld\"}", i, i);
+   fprintf(f, "{\"id\":%ld,\"msg\":\"int%ld\"}", i, i);
}
fputc('\0', f);
}
diff --git a/documentation/index.rst b/documentation/index.rst
--- a/documentation/index.rst
+++ b/documentation/index.rst
@@ -31,6 +31,7 @@ Welcome to MonetDB's documentation!
source/cmake
source/release
source/developers_handbook
+   source/binary-resultset
 
 Indices and tables
 ==
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2279,21 +2279,27 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3
}
if (maybeextend(r1, r2, r3, nlx, 
lci->next, lci->ncand, maxsize) != GDK_SUCCEED)
goto bailout;
+   if (r3)
+   r3->tnil = false;
while (nlx > 0) {
lv = canditer_next(lci);
if (mlci == NULL || 
canditer_contains(mlci, lv)) {
APPEND(r1, lv);
if (r2)
APPEND(r2, 
oid_nil);
-   if (r3)
-   ((bit *) 
r3->theap->base)[r3->batCount++] = defmark;
+   if (r3) {
+   if (rhasnil || 
cmp(VALUE(l, lv - l->hseqbase), nil) == 0) {
+   ((bit 
*) r3->theap->base)[r3->batCount++] = bit_nil;
+   
r3->tnil = true;
+   } else {
+   ((bit 
*) r3->theap->base)[r3->batCount++] = 0;
+   }
+   }
}
nlx--;
}
if (r1->trevsorted && BATcount(r1) > 1)
r1->trevsorted = false;
-   if (r3)
-   r3->tnil = rhasnil;
} else {
canditer_setidx(lci, lci->next + nlx);
}
@@ -2881,7 +2887,7 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3
APPEND(r2, oid_nil);\
}   \
if (r3) {   \
-   r3->tnil = mark == bit_nil; \
+   r3->tnil |= mark == bit_nil; \
((bit *) 
r3->theap->base)[r3->batCount++] = mark; \
}   \
} else if (min_one) {   \
@@ -3236,7 +3242,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p
APPEND(r2, oid_nil);
}
if (r3) {
-   r3->tnil = mark == bit_nil;
+   r3->tnil |= mark == bit_nil;
((bit *) 
r3->theap->base)[r3->batCount++] = mark;
}
} else if (min_one) {
diff --git a/gdk/gdk_

MonetDB: monetdburl - Suppress DecrecationWarnings even harder

2023-10-25 Thread Joeri van Ruth via checkin-list
Changeset: fc05f05d3640 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fc05f05d3640
Modified Files:
clients/mapilib/Tests/tlstester.py
Branch: monetdburl
Log Message:

Suppress DecrecationWarnings even harder


diffs (14 lines):

diff --git a/clients/mapilib/Tests/tlstester.py 
b/clients/mapilib/Tests/tlstester.py
--- a/clients/mapilib/Tests/tlstester.py
+++ b/clients/mapilib/Tests/tlstester.py
@@ -20,9 +20,8 @@ from typing import Any, Callable, Dict, 
 
 
 import warnings
-from cryptography.utils import CryptographyDeprecationWarning
 with warnings.catch_warnings():
-warnings.filterwarnings('ignore', category=CryptographyDeprecationWarning)
+warnings.filterwarnings('ignore', category=UserWarning)
 from cryptography import x509
 from cryptography.hazmat.primitives import serialization, hashes
 from cryptography.hazmat.primitives.asymmetric import rsa
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: monetdburl - On Windows, exportutils.py doesn't like no...

2023-10-25 Thread Joeri van Ruth via checkin-list
Changeset: 83bd4421f68d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/83bd4421f68d
Modified Files:
clients/mapilib/mapi.c
Branch: monetdburl
Log Message:

On Windows, exportutils.py doesn't like non-ascii Unicode text


diffs (12 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -1271,7 +1271,7 @@ mapi_impl_log_data(Mapi mid, const char 
mapi_log_header(mid, filename, line, mark);
mnstr_write(mid->tracelog, start, 1, len);
if (len > 0 && start[len - 1] != '\n')
-   mnstr_writeStr(mid->tracelog, "⏎\n");
+   mnstr_writeStr(mid->tracelog, "\u23ce\n");
mnstr_flush(mid->tracelog, MNSTR_FLUSH_DATA);
 }
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: monetdburl - On Windows, a file cannot be open twice

2023-10-25 Thread Joeri van Ruth via checkin-list
Changeset: fd18b2f8d272 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fd18b2f8d272
Modified Files:
clients/mapilib/Tests/tlstester.py
Branch: monetdburl
Log Message:

On Windows, a file cannot be open twice


diffs (16 lines):

diff --git a/clients/mapilib/Tests/tlstester.py 
b/clients/mapilib/Tests/tlstester.py
--- a/clients/mapilib/Tests/tlstester.py
+++ b/clients/mapilib/Tests/tlstester.py
@@ -318,10 +318,11 @@ class TLSTester:
 context.set_servername_callback(sni_callback)
 
 # Turns out the ssl API forces us to write the certs to file. Yuk!
-with tempfile.NamedTemporaryFile(mode="wb") as f:
+with tempfile.NamedTemporaryFile(mode="wb", delete=True, 
delete_on_close=False) as f:
 f.write(self.certs.get_file(cert_name + ".key"))
 f.write(self.certs.get_file(cert_name + ".crt"))
 f.flush()
+f.close()   # Cannot open twice on Windows
 context.load_cert_chain(f.name)
 
 if client_cert:
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - use filter to remove old security warning

2023-10-25 Thread Niels Nes via checkin-list
Changeset: de220120f705 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/de220120f705
Modified Files:
sql/test/Tests/hot_snapshot.py
Branch: default
Log Message:

use filter to remove old security warning


diffs (13 lines):

diff --git a/sql/test/Tests/hot_snapshot.py b/sql/test/Tests/hot_snapshot.py
--- a/sql/test/Tests/hot_snapshot.py
+++ b/sql/test/Tests/hot_snapshot.py
@@ -21,6 +21,9 @@ import tarfile
 
 import pymonetdb
 
+import warnings
+warnings.filterwarnings("ignore", category=RuntimeWarning)
+
 dbfarm = os.getenv('GDK_DBFARM')
 tstdb = os.getenv('TSTDB')
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: monetdburl - Satisfy both Windows and old Pythons on th...

2023-10-25 Thread Joeri van Ruth via checkin-list
Changeset: 8b47244a28c5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8b47244a28c5
Modified Files:
clients/mapilib/Tests/tlstester.py
Branch: monetdburl
Log Message:

Satisfy both Windows and old Pythons on the topic of temp files


diffs (35 lines):

diff --git a/clients/mapilib/Tests/tlstester.py 
b/clients/mapilib/Tests/tlstester.py
--- a/clients/mapilib/Tests/tlstester.py
+++ b/clients/mapilib/Tests/tlstester.py
@@ -318,12 +318,25 @@ class TLSTester:
 context.set_servername_callback(sni_callback)
 
 # Turns out the ssl API forces us to write the certs to file. Yuk!
-with tempfile.NamedTemporaryFile(mode="wb", delete=True, 
delete_on_close=False) as f:
-f.write(self.certs.get_file(cert_name + ".key"))
-f.write(self.certs.get_file(cert_name + ".crt"))
-f.flush()
-f.close()   # Cannot open twice on Windows
-context.load_cert_chain(f.name)
+# Complicated code because the delete= and delete_on_close= flags
+# would be useful but are not available on old Pythons, and
+# Windows does not allow load_cert_chain to open the file while
+# the NamedTemporaryFile is not closed.
+to_delete = None
+try:
+temp_file = tempfile.NamedTemporaryFile(mode="wb", delete=False)
+to_delete = temp_file.name
+temp_file.write(self.certs.get_file(cert_name + ".key"))
+temp_file.write(self.certs.get_file(cert_name + ".crt"))
+temp_file.flush()
+temp_file.close()   # Cannot open twice on Windows
+context.load_cert_chain(temp_file.name)
+finally:
+try:
+if to_delete:
+os.unlink(to_delete)
+except OSError:
+pass
 
 if client_cert:
 context.verify_mode = ssl.CERT_REQUIRED
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - approved move of trim functions

2023-10-25 Thread Niels Nes via checkin-list
Changeset: 2f4d1b970757 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2f4d1b970757
Modified Files:
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:

approved move of trim functions


diffs (114 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
@@ -1610,6 +1610,8 @@ select 'null in fkeys.delete_action', de
 [ "sys.functions", "sys",  "analyze",  "SYSTEM",   "create 
procedure sys.\"analyze\"(\"sname\" varchar(1024), \"tname\" varchar(1024), 
\"cname\" varchar(1024)) external name sql.\"analyze\";",   "sql",  "MAL",  
"Procedure",true,   false,  false,  true,   NULL,   "sname",
"varchar",  1024,   0,  "in",   "tname","varchar",  1024,   
0,  "in",   "cname","varchar",  1024,   0,  "in",   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL]
 [ "sys.functions", "sys",  "analyze",  "SYSTEM",   "create 
procedure sys.\"analyze\"() external name sql.\"analyze\";","sql",  "MAL",  
"Procedure",true,   false,  false,  true,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL]
 [ "sys.functions", "sys",  "and",  "SYSTEM",   "and",  "calc", 
"Internal C",   "Scalar function",  false,  false,  false,  true,   NULL,   
"res_0","boolean",  1,  0,  "out",  "arg_1",
"boolean",  1,  0,  "in",   "arg_2","boolean",  1,  
0,  "in",   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL]
+[ "sys.functions", "sys",  "any_value","SYSTEM",   "min",  "aggr", 
"Internal C",   "Aggregate function",   false,  false,  false,  false,  NULL,   
"res_0","any",  0,  0,  "out",  "arg_1","any",  0,  
0,  "in",   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL]
+[ "sys.functions", "sys",  "any_value","SYSTEM",   "min",  "sql",  
"Internal C",   "Analytic function",false,  false,  false,  true,   NULL,   
"res_0","any",  0,  0,  "out",  "arg_1","any",  0,  
0,  "in",   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL]
 [ "sys.functions", "sys",  "ascii",

MonetDB: Jun2023 - Remove test for local_timezone because it doe...

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: fcb40072d5a2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fcb40072d5a2
Modified Files:
sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
Branch: Jun2023
Log Message:

Remove test for local_timezone because it doesn't take into account different 
timezones.


diffs (15 lines):

diff --git 
a/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test 
b/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
--- a/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
+++ b/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
@@ -260,11 +260,6 @@ select least(time '15:15:15', time '16:1
 
 15:15:15
 
-query T nosort
-select local_timezone()
-
-2:00:00
-
 query I nosort
 select localtime() <> time '13:16:57.734639'
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Remove test for local_timezone because it doe...

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: cacecff71b0d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cacecff71b0d
Modified Files:
sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
Branch: default
Log Message:

Remove test for local_timezone because it doesn't take into account different 
timezones.
(grafted from fcb40072d5a2fcd917629cad066c2e45d2187b32)


diffs (15 lines):

diff --git 
a/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test 
b/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
--- a/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
+++ b/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
@@ -260,11 +260,6 @@ select least(time '15:15:15', time '16:1
 
 15:15:15
 
-query T nosort
-select local_timezone()
-
-2:00:00
-
 query I nosort
 select localtime() <> time '13:16:57.734639'
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge heads.

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: fb5710a8bad2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fb5710a8bad2
Branch: default
Log Message:

Merge heads.


diffs (truncated from 2090 to 300 lines):

diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2279,21 +2279,27 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3
}
if (maybeextend(r1, r2, r3, nlx, 
lci->next, lci->ncand, maxsize) != GDK_SUCCEED)
goto bailout;
+   if (r3)
+   r3->tnil = false;
while (nlx > 0) {
lv = canditer_next(lci);
if (mlci == NULL || 
canditer_contains(mlci, lv)) {
APPEND(r1, lv);
if (r2)
APPEND(r2, 
oid_nil);
-   if (r3)
-   ((bit *) 
r3->theap->base)[r3->batCount++] = defmark;
+   if (r3) {
+   if (rhasnil || 
cmp(VALUE(l, lv - l->hseqbase), nil) == 0) {
+   ((bit 
*) r3->theap->base)[r3->batCount++] = bit_nil;
+   
r3->tnil = true;
+   } else {
+   ((bit 
*) r3->theap->base)[r3->batCount++] = 0;
+   }
+   }
}
nlx--;
}
if (r1->trevsorted && BATcount(r1) > 1)
r1->trevsorted = false;
-   if (r3)
-   r3->tnil = rhasnil;
} else {
canditer_setidx(lci, lci->next + nlx);
}
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2421,10 +2421,15 @@ log_cleanup_range(logger *lg, ulng id)
 static void
 do_rotate(logger *lg)
 {
-   logged_range *next = lg->current->next;
+   logged_range *cur = lg->current;
+   logged_range *next = cur->next;
if (next) {
assert(ATOMIC_GET(&next->refcount) == 1);
-   lg->current = lg->current->next;
+   lg->current = next;
+   if (!LOG_DISABLED(lg) && ATOMIC_GET(&cur->refcount) == 1) {
+   close_stream(cur->output_log);
+   cur->output_log = NULL;
+   }
}
 }
 
@@ -3099,7 +3104,14 @@ log_tflush(logger *lg, ulng file_id, uln
}
/* else somebody else has flushed our log file */
 
-   ATOMIC_DEC(&frange->refcount);
+   if (ATOMIC_DEC(&frange->refcount) == 1 && !LOG_DISABLED(lg)) {
+   rotation_lock(lg);
+   if (frange != lg->current) {
+   close_stream(frange->output_log);
+   frange->output_log = NULL;
+   }
+   rotation_unlock(lg);
+   }
 
if (ATOMIC_DEC(&lg->nr_flushers) == 0) {
/* I am the last flusher
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
@@ -140,6 +140,14 @@ JSONtoStorageString(JSON *jt, int idx, j
size_t sz = 0;
str msg = MAL_SUCCEED;
 
+   if (THRhighwater()) {
+   msg = createException(MAL, "json.new",
+   
SQLSTATE(42000)
+   "JSON 
object too complex to render into string.");
+   return msg;
+   }
+
+
switch(jt->elm[idx].kind) {
case JSON_OBJECT:
*p++ = '{';
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
@@ -2837,7 +2837,6 @@ rel2bin_groupjoin(backend *be, sql_rel *
 
en = jexps?jexps->h:NULL;
if (list_empty(jexps) || !(is_equi_exp_((sql_exp*)en->data) && 
can_join_exp(rel, en->data, false))) {
-   printf("# outer cross\n");

MonetDB: insertonly - Merge with default branch.

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: 78d4a6bc0c29 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/78d4a6bc0c29
Modified Files:
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
Branch: insertonly
Log Message:

Merge with default branch.


diffs (142 lines):

diff --git a/sql/test/Tests/hot_snapshot.py b/sql/test/Tests/hot_snapshot.py
--- a/sql/test/Tests/hot_snapshot.py
+++ b/sql/test/Tests/hot_snapshot.py
@@ -21,6 +21,9 @@ import tarfile
 
 import pymonetdb
 
+import warnings
+warnings.filterwarnings("ignore", category=RuntimeWarning)
+
 dbfarm = os.getenv('GDK_DBFARM')
 tstdb = os.getenv('TSTDB')
 
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
@@ -1610,6 +1610,8 @@ select 'null in fkeys.delete_action', de
 [ "sys.functions", "sys",  "analyze",  "SYSTEM",   "create 
procedure sys.\"analyze\"(\"sname\" varchar(1024), \"tname\" varchar(1024), 
\"cname\" varchar(1024)) external name sql.\"analyze\";",   "sql",  "MAL",  
"Procedure",true,   false,  false,  true,   NULL,   "sname",
"varchar",  1024,   0,  "in",   "tname","varchar",  1024,   
0,  "in",   "cname","varchar",  1024,   0,  "in",   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL]
 [ "sys.functions", "sys",  "analyze",  "SYSTEM",   "create 
procedure sys.\"analyze\"() external name sql.\"analyze\";","sql",  "MAL",  
"Procedure",true,   false,  false,  true,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL]
 [ "sys.functions", "sys",  "and",  "SYSTEM",   "and",  "calc", 
"Internal C",   "Scalar function",  false,  false,  false,  true,   NULL,   
"res_0","boolean",  1,  0,  "out",  "arg_1",
"boolean",  1,  0,  "in",   "arg_2","boolean",  1,  
0,  "in",   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL]
+[ "sys.functions", "sys",  "any_value","SYSTEM",   "min",  "aggr", 
"Internal C",   "Aggregate function",   false,  false,  false,  false,  NULL,   
"res_0","any",  0,  0,  "out",  "arg_1","any",  0,  
0,  "in",   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL]
+[ "sys.functions", "sys",  "any_value","SYSTEM",   "min",  "sql",  
"Internal C",   "Analytic function",false,  false,  false,  true,   NULL,   
"res_0","any",  0,  0,  "out",  "arg_1","any",  0,  
0,  "in",   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NUL

MonetDB: monetdburl - Let tlstester catch OSError during TLS han...

2023-10-25 Thread Joeri van Ruth via checkin-list
Changeset: a4bfd50dd73e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a4bfd50dd73e
Modified Files:
clients/mapilib/Tests/tlstester.py
Branch: monetdburl
Log Message:

Let tlstester catch OSError during TLS handshake


diffs (13 lines):

diff --git a/clients/mapilib/Tests/tlstester.py 
b/clients/mapilib/Tests/tlstester.py
--- a/clients/mapilib/Tests/tlstester.py
+++ b/clients/mapilib/Tests/tlstester.py
@@ -512,6 +512,9 @@ class MapiHandler(socketserver.BaseReque
 except SSLError as e:
 log.info(f"port '{self.name}': TLS handshake failed: {e}")
 return
+except OSError as e:
+log.info(f"port '{self.name}': error during TLS handshake: 
{e}")
+return
 if self.check_alpn:
 alpn = self.conn.selected_alpn_protocol()
 if alpn is None:
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: monetdburl - Enable verbose logging in tlssecurity test

2023-10-25 Thread Joeri van Ruth via checkin-list
Changeset: c9b0525579c3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c9b0525579c3
Modified Files:
clients/mapilib/Tests/tlssecurity.py
Branch: monetdburl
Log Message:

Enable verbose logging in tlssecurity test

It will now fail even if it succeeds but at least we know what's going on


diffs (17 lines):

diff --git a/clients/mapilib/Tests/tlssecurity.py 
b/clients/mapilib/Tests/tlssecurity.py
--- a/clients/mapilib/Tests/tlssecurity.py
+++ b/clients/mapilib/Tests/tlssecurity.py
@@ -9,8 +9,11 @@ import threading
 sys.path.append(os.environ.get('TSTSRCDIR','.'))
 import tlstester
 
-logging.basicConfig(level=logging.WARNING)
-# logging.basicConfig(level=logging.DEBUG)
+level = logging.WARNING
+if sys.platform == 'win32':
+level=logging.DEBUG
+#level = logging.DEBUG
+logging.basicConfig(level=level)
 
 tgtdir = os.environ['TSTTRGDIR']
 assert os.path.isdir(tgtdir)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with insertonly branch.

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: 8f8320c3b327 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8f8320c3b327
Branch: default
Log Message:

Merge with insertonly branch.


diffs (truncated from 574 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
@@ -49764,6 +49764,21 @@ pattern sql.percent_rank(X_0:any_1, X_1:
 SQLpercent_rank;
 return the percentage into the total number of groups for each row
 sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged() (X_0:bat[:str], X_1:bat[:int], 
X_2:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only tables in current schema
+sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged(X_0:str) (X_1:bat[:str], X_2:bat[:int], 
X_3:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only tables in schema s
+sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged(X_0:str, X_1:str) (X_2:bat[:str], 
X_3:bat[:int], X_4:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only table in schema s table t
+sql
 predicate
 unsafe pattern sql.predicate(X_0:str, X_1:str, X_2:str):void 
 mvc_add_column_predicate;
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
@@ -38169,6 +38169,21 @@ pattern sql.percent_rank(X_0:any_1, X_1:
 SQLpercent_rank;
 return the percentage into the total number of groups for each row
 sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged() (X_0:bat[:str], X_1:bat[:int], 
X_2:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only tables in current schema
+sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged(X_0:str) (X_1:bat[:str], X_2:bat[:int], 
X_3:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only tables in schema s
+sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged(X_0:str, X_1:str) (X_2:bat[:str], 
X_3:bat[:int], X_4:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only table in schema s table t
+sql
 predicate
 unsafe pattern sql.predicate(X_0:str, X_1:str, X_2:str):void 
 mvc_add_column_predicate;
diff --git a/sql/backends/monet5/CMakeLists.txt 
b/sql/backends/monet5/CMakeLists.txt
--- a/sql/backends/monet5/CMakeLists.txt
+++ b/sql/backends/monet5/CMakeLists.txt
@@ -113,6 +113,7 @@ set(include_sql_files
   58_hot_snapshot
   75_storagemodel
   76_dump
+  77_storage
   80_statistics
   81_tracer
   91_information_schema)
diff --git a/sql/backends/monet5/Tests/All b/sql/backends/monet5/Tests/All
--- a/sql/backends/monet5/Tests/All
+++ b/sql/backends/monet5/Tests/All
@@ -33,3 +33,5 @@ limithack
 shutdown
 
 HAVE_HGE?int_notation_1e5
+
+!NOWAL?persist_unlogged
diff --git a/sql/backends/monet5/Tests/persist_unlogged.SQL.py 
b/sql/backends/monet5/Tests/persist_unlogged.SQL.py
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/Tests/persist_unlogged.SQL.py
@@ -0,0 +1,38 @@
+import os, tempfile
+
+from MonetDBtesting.sqltest import SQLTestCase
+try:
+from MonetDBtesting import process
+except ImportError:
+import process
+
+with tempfile.TemporaryDirectory() as farm_dir:
+os.mkdir(os.path.join(farm_dir, 'db1'))
+
+with process.server(mapiport='0', dbname='db1',
+dbfarm=os.path.join(farm_dir, 'db1'),
+stdin=process.PIPE,
+stdout=process.PIPE, stderr=process.PIPE) as s:
+with SQLTestCase() as tc:
+tc.connect(username="monetdb", password="monetdb", port=s.dbport, 
database='db1')
+tc.execute("CREATE UNLOGGED TABLE foo (x INT)").assertSucceeded()
+tc.execute("ALTER TABLE foo SET INSERT ONLY").assertSucceeded()
+tc.execute("INSERT INTO foo SELECT * FROM generate_series(0,500)")
+tc.execute("SELECT count(*) FROM 
foo").assertSucceeded().assertDataResultMatch([(500,)])
+tc.execute("SELECT table, rowcount FROM 
persist_unlogged()").assertSucceeded().assertDataResultMatch([('foo', 0)])
+
+# Simulate some work in order to trigger WAL flush(note that 
Mtests runs with --forcemito)
+tc.execute("CREATE TABLE bar (x INT)").assertSucceeded()
+tc.execute("INSERT INTO bar SELECT * FROM 
generate_series(0,10)").assertSucceeded()
+
+tc.execute("SELECT table, rowcount FROM 
persist_unlogged()").assertSucceeded().assertDataResultMatch([('foo', 500)])
+s.communicate()
+
+with process.server(mapiport='0', dbname='db1',
+dbfarm=os.path.join(farm_dir, 'db1'),
+stdin=process.PIPE,
+stdout=process.PIPE, stderr=process.PIPE) as s:
+with SQLTestCase() as tc:
+tc.connect(username="monetdb", password="monetdb", port=s.dbport, 
database='db1')
+tc.execute("SELECT COUNT(*) FROM 
foo").assertSucceeded().assertDataResultMatc

MonetDB: insertonly - Close branch insertonly.

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: a6c283867cfa for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a6c283867cfa
Branch: insertonly
Log Message:

Close branch insertonly.

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


MonetDB: default - test common/stream/urlstream: bind 127.0.0.1 ...

2023-10-25 Thread Joeri van Ruth via checkin-list
Changeset: 72f11f478213 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/72f11f478213
Modified Files:
common/stream/Tests/urlstream.py
Branch: default
Log Message:

test common/stream/urlstream: bind 127.0.0.1 to avoid timeouts


diffs (17 lines):

diff --git a/common/stream/Tests/urlstream.py b/common/stream/Tests/urlstream.py
--- a/common/stream/Tests/urlstream.py
+++ b/common/stream/Tests/urlstream.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
 
 import http.server
 import io
@@ -69,7 +68,7 @@ class Handler(http.server.BaseHTTPReques
 
 def runserver():
 global port
-addr = ('', 0)
+addr = ('127.0.0.1', 0)
 srv = http.server.HTTPServer(addr, Handler)
 port = srv.server_port
 print(f"Listening on {port}", file=OUTPUT)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ts_and_tz_to_str_fix - Merge with Jun2023 branch.

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: 8650a56f5c6a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8650a56f5c6a
Branch: ts_and_tz_to_str_fix
Log Message:

Merge with Jun2023 branch.


diffs (15 lines):

diff --git 
a/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test 
b/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
--- a/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
+++ b/sql/test/sys-schema/Tests/webExamplesDateTimeFunctionsOperators.test
@@ -260,11 +260,6 @@ select least(time '15:15:15', time '16:1
 
 15:15:15
 
-query T nosort
-select local_timezone()
-
-2:00:00
-
 query I nosort
 select localtime() <> time '13:16:57.734639'
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ts_and_tz_to_str_fix - Approve test output.

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: 592b7567b108 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/592b7567b108
Modified Files:
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
Branch: ts_and_tz_to_str_fix
Log Message:

Approve test output.


diffs (39 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
@@ -2476,8 +2476,8 @@ select 'null in fkeys.delete_action', de
 [ "sys.functions", "sys",  "tanh", "SYSTEM",   "tanh", "mmath",
"Internal C",   "Scalar function",  false,  false,  false,  false,  NULL,   
"res_0","real", 24, 0,  "out",  "arg_1","real", 24, 
0,  "in",   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL]
 [ "sys.functions", "sys",  "text", "SYSTEM",   "create function 
\"text\" (p inet) returns clob external name inet.\"text\";",  "inet", "MAL",  
"Scalar function",  false,  false,  false,  true,   NULL,   "result",   
"clob", 0,  0,  "out",  "p","inet", 0,  0,  "in",   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL]
 [ "sys.functions", "sys",  "time_to_str",  "SYSTEM",   "create 
function time_to_str(d time with time zone, format string) returns string 
external name mtime.\"time_to_str\";","mtime","MAL",  "Scalar 
function",  false,  false,  false,  true,   NULL,   "result",   "clob", 
0,  0,  "out",  "d","timetz",   1,  0,  "in",   
"format",   "clob", 0,  0,  "in",   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL]
-[ "sys.functions", "sys",  "timestamp_to_str", "SYSTEM",   "create 
function \"timestamp_to_str\"(d timestamp, format string) returns string 
external name mtime.\"timestamp_to_str\";","mtime","MAL",  "Scalar 
function",  false,  false,  false,  true,   NULL,   "result",   "clob", 
0,  0,  "out",  "d","timestamp",7,  0,  "in",   
"format",   "clob", 0,  0,  "in",   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL]
 [ "sys.functions", "sys",  "timestamp_to_str", "SYSTEM",   "create 
function timestamp_to_str(d timestamp with time zone, format string) returns 
string external name mtime.\"timestamp_to_str\";", "mtime","MAL",  
"Scalar function",  false,  false,  false,  true,   NULL,   "result",   
"clob", 0,  0,  "out",  "d","timestamptz",  7,  0,  "in",   
"format",   "clob", 0,  0,  "in",   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   

MonetDB: ts_and_tz_to_str_fix - timestamp_to_str upgrade code fr...

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: 56b2a2fd3b79 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/56b2a2fd3b79
Modified Files:
sql/backends/monet5/sql_upgrades.c
Branch: ts_and_tz_to_str_fix
Log Message:

timestamp_to_str upgrade code from sql_update_jun2023. sql_update_jun2023_sp3 
is sufficient.


diffs (32 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
@@ -5760,28 +5760,6 @@ sql_update_jun2023(Client c, mvc *sql, s
BBPunfix(rt_deleted->batCacheid);
}
 
-   sql_find_subtype(&t1, "timestamp", 0, 0);
-   sql_find_subtype(&t2, "varchar", 0, 0);
-
-   if (!sql_bind_func(sql, "sys", "timestamp_to_str", &t1, &t2, F_FUNC, 
true)) {
-   sql->session->status = 0;
-   sql->errstr[0] = '\0';
-
-   char *query = GDKmalloc(512);
-   if (query == NULL)
-   throw(SQL, __func__, SQLSTATE(HY013) MAL_MALLOC_FAIL);
-
-   snprintf(query, 512, "CREATE FUNCTION timestamp_to_str(d 
TIMESTAMP, format STRING) RETURNS STRING "
-"EXTERNAL NAME mtime.\"timestamp_to_str\";\n"
-"GRANT EXECUTE ON FUNCTION 
timestamp_to_str(TIMESTAMP, STRING) TO PUBLIC;\n"
-"UPDATE sys.functions SET system = true WHERE 
system <> true AND name = 'timestamp_to_str' "
-"AND schema_id = 2000 and type = %d;\n", 
F_FUNC);
-
-   printf("Running database upgrade commands:\n%s\n", query);
-   err = SQLstatementIntern(c, query, "update", true, false, NULL);
-   GDKfree(query);
-   }
-
GDKfree(buf);
return err; /* usually MAL_SUCCEED */
 }
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Jun2023 - Merge with ts_and_tz_to_str_fix branch.

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: 5f1f6307fc99 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5f1f6307fc99
Branch: Jun2023
Log Message:

Merge with ts_and_tz_to_str_fix branch.


diffs (truncated from 724 to 300 lines):

diff --git a/monetdb5/modules/atoms/Tests/All b/monetdb5/modules/atoms/Tests/All
--- a/monetdb5/modules/atoms/Tests/All
+++ b/monetdb5/modules/atoms/Tests/All
@@ -38,3 +38,5 @@ startswith
 endswith
 contains
 HAVE_ICONV?asciify
+
+ts_and_tstz_to_str_bug
diff --git a/monetdb5/modules/atoms/Tests/ts_and_tstz_to_str_bug.test 
b/monetdb5/modules/atoms/Tests/ts_and_tstz_to_str_bug.test
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/atoms/Tests/ts_and_tstz_to_str_bug.test
@@ -0,0 +1,16 @@
+statement ok
+CREATE TABLE t2 (dt TIMESTAMP)
+
+statement ok
+INSERT INTO t2 (dt) VALUES('2023-10-11 11:36')
+
+query I
+SELECT
+levenshtein(sys.timestamp_to_str(cast(dt as timestamp with time zone), 
'%Y-%d-%d %H:%M:%S'),
+sys.timestamp_to_str(dt, '%Y-%d-%d %H:%M:%S'))
+FROM t2
+
+0
+
+statement ok
+DROP TABLE t2
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
@@ -5164,6 +5164,7 @@ sql_update_jun2023(Client c, mvc *sql, s
char *err = NULL, *buf = GDKmalloc(bufsize);
res_table *output;
BAT *b;
+   sql_subtype t1, t2;
 
(void) sql;
if (buf == NULL)
@@ -5530,7 +5531,6 @@ sql_update_jun2023(Client c, mvc *sql, s
/* Add new sysadmin procedure calls: stop, pause and resume with two
   arguments, first arg is query OID and second the user username that
   the query in bound to. */
-   sql_subtype t1, t2;
sql_find_subtype(&t1, "bigint", 64, 0);
sql_find_subtype(&t2, "varchar", 0, 0);
if (!sql_bind_func(sql, "sys", "pause", &t1, &t2, F_PROC, true)) {
@@ -5764,6 +5764,38 @@ sql_update_jun2023(Client c, mvc *sql, s
return err; /* usually MAL_SUCCEED */
 }
 
+static str
+sql_update_jun2023_sp3(Client c, mvc *sql, sql_schema *s)
+{
+   (void)s;
+   char *err = NULL;
+   sql_subtype t1, t2;
+
+   sql_find_subtype(&t1, "timestamp", 0, 0);
+   sql_find_subtype(&t2, "varchar", 0, 0);
+
+   if (!sql_bind_func(sql, "sys", "timestamp_to_str", &t1, &t2, F_FUNC, 
true)) {
+   sql->session->status = 0;
+   sql->errstr[0] = '\0';
+
+   char *query = GDKmalloc(512);
+   if (query == NULL)
+   throw(SQL, __func__, SQLSTATE(HY013) MAL_MALLOC_FAIL);
+
+   snprintf(query, 512, "CREATE FUNCTION timestamp_to_str(d 
TIMESTAMP, format STRING) RETURNS STRING "
+"EXTERNAL NAME mtime.\"timestamp_to_str\";\n"
+"GRANT EXECUTE ON FUNCTION 
timestamp_to_str(TIMESTAMP, STRING) TO PUBLIC;\n"
+"UPDATE sys.functions SET system = true WHERE 
system <> true AND name = 'timestamp_to_str' "
+"AND schema_id = 2000 and type = %d;\n", 
F_FUNC);
+
+   printf("Running database upgrade commands:\n%s\n", query);
+   err = SQLstatementIntern(c, query, "update", true, false, NULL);
+   GDKfree(query);
+   }
+
+   return err; /* usually MAL_SUCCEED */
+}
+
 int
 SQLupgrades(Client c, mvc *m)
 {
@@ -5971,5 +6003,11 @@ SQLupgrades(Client c, mvc *m)
return -1;
}
 
+   if ((err = sql_update_jun2023_sp3(c, m, s)) != NULL) {
+   TRC_CRITICAL(SQL_PARSER, "%s\n", err);
+   freeException(err);
+   return -1;
+   }
+
return 0;
 }
diff --git a/sql/scripts/13_date.sql b/sql/scripts/13_date.sql
--- a/sql/scripts/13_date.sql
+++ b/sql/scripts/13_date.sql
@@ -21,6 +21,9 @@ create function time_to_str(d time with 
 create function str_to_timestamp(s string, format string) returns timestamp 
with time zone
external name mtime."str_to_timestamp";
 
+create function timestamp_to_str(d timestamp, format string) returns string
+   external name mtime."timestamp_to_str";
+
 create function timestamp_to_str(d timestamp with time zone, format string) 
returns string
external name mtime."timestamp_to_str";
 
@@ -29,4 +32,5 @@ grant execute on function date_to_str to
 grant execute on function str_to_time to public;
 grant execute on function time_to_str to public;
 grant execute on function str_to_timestamp to public;
-grant execute on function timestamp_to_str to public;
+grant execute on function timestamp_to_str(timestamp, string) to public;
+grant execute on function timestamp_to_str(timestamp with time zone, string) 
to public;
diff --git 
a/sql/test/BugTracker-2019/Tests/duplicates-not-eliminated-long-CASE-stmt.Bug-6697.test
 
b/sql/test/BugTracker-2019/Tests/duplicates-not-eliminated-long-CASE-stmt.Bug-6697.test
--- 
a/sql/test/BugTracker-2019/Tests/duplicate

MonetDB: ts_and_tz_to_str_fix - Close branch ts_and_tz_to_str_fix.

2023-10-25 Thread Lucas Pereira via checkin-list
Changeset: 0efd619eb699 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0efd619eb699
Branch: ts_and_tz_to_str_fix
Log Message:

Close branch ts_and_tz_to_str_fix.

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


MonetDB: monetdburl - Disable logging, now expect tlssecurity.py...

2023-10-25 Thread Joeri van Ruth via checkin-list
Changeset: b0fd9df9edf1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b0fd9df9edf1
Modified Files:
clients/mapilib/Tests/tlssecurity.py
Branch: monetdburl
Log Message:

Disable logging, now expect tlssecurity.py to succeed on Windows


diffs (14 lines):

diff --git a/clients/mapilib/Tests/tlssecurity.py 
b/clients/mapilib/Tests/tlssecurity.py
--- a/clients/mapilib/Tests/tlssecurity.py
+++ b/clients/mapilib/Tests/tlssecurity.py
@@ -10,8 +10,8 @@ sys.path.append(os.environ.get('TSTSRCDI
 import tlstester
 
 level = logging.WARNING
-if sys.platform == 'win32':
-level=logging.DEBUG
+# if sys.platform == 'win32':
+# level=logging.DEBUG
 #level = logging.DEBUG
 logging.basicConfig(level=level)
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: nilmask - merged with default

2023-10-25 Thread Niels Nes via checkin-list
Changeset: 79458994ca20 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/79458994ca20
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/MAL-signatures.test
clients/Tests/exports.stable.out
clients/odbc/tests/ODBCmetadata.c
gdk/gdk.h
gdk/gdk_bat.c
monetdb5/mal/mal_builder.c
monetdb5/mal/mal_builder.h
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_prelude.c
monetdb5/modules/mal/tablet.c
monetdb5/modules/mal/tablet.h
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/sql_statement.h
sql/common/sql_types.c
sql/include/sql_catalog.h
sql/storage/bat/bat_storage.c
sql/storage/bat/bat_storage.h
sql/storage/sql_storage.h
sql/storage/store.c
tools/monetdbe/monetdbe.c
Branch: nilmask
Log Message:

merged with default


diffs (truncated from 134029 to 300 lines):

diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
new file mode 100644
--- /dev/null
+++ b/.github/workflows/linux.yml
@@ -0,0 +1,57 @@
+name: MonetDB build and test
+
+on:
+  push:
+branches: 
+  - '*'
+  - 'branches/*'
+  pull_request:
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+  schedule:
+- cron:  '15 1 * * *'
+
+jobs:
+  test:
+strategy:
+  fail-fast: false  # don't stop other jobs
+  matrix:
+branch: [ master ]
+os: [ ubuntu-latest, macos-latest ]
+runs-on: ${{ matrix.os }}
+steps:
+  - name: Checkout
+uses: actions/checkout@v3
+with:
+  ref: ${{ matrix.branch }}
+
+  - name: make MonetDB on linux
+run: |
+  mkdir build
+  cd build 
+  cmake ..  -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.branch }} 
-DPY3INTEGRATION=OFF -DCMAKE_BUILD_TYPE=Release -DASSERT=OFF -DRINTEGRATION=OFF
+  make install -j3
+if: runner.os == 'Linux'
+  -
+name: brew packages
+run: brew install bison
+if: runner.os == 'macOS'
+  - name: make MonetDB on macos
+run: |
+  mkdir build
+  cd build 
+  cmake ..  -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.branch }} 
-DPY3INTEGRATION=OFF -DCMAKE_BUILD_TYPE=Release -DASSERT=OFF -DRINTEGRATION=OFF 
 \
+-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
+  make install -j3
+if: runner.os == 'macOS'
+  - name: ctest 
+run: |
+  cd build 
+  cmake --build . --target test
+  #-
+  #uses: actions/upload-artifact@v3
+  #name: Publish Linux binary wheels
+  #with:
+  #name: monetdbe-linux-wheel-${{ matrix.branch }}-${{ 
matrix.python-version }}
+  #path: dist/*.whl
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -805,3 +805,11 @@ d11af9398029c117b92a9be9efa971ac0299ffc4
 8b736d6dcfd63d0560c99fc5427b504c116b74b0 Sep2022_17
 8b736d6dcfd63d0560c99fc5427b504c116b74b0 Sep2022_SP3_release
 aba8c31c60480148cd388a09ac99b42679406258 Jun2023_1
+79dbf838f04483a2d9ccce8332090ff91b18caec Jun2023_3
+79dbf838f04483a2d9ccce8332090ff91b18caec Jun2023_release
+573511e0e7bf2f7ab11f00b45711aab5f1aff6f2 Jun2023_5
+573511e0e7bf2f7ab11f00b45711aab5f1aff6f2 Jun2023_SP1_release
+ce63ebe9a78c52ef0cbe8fd6f2159d2637f0387c Jun2023_7
+1efa83c6409769d13b2ee30e497d5f7ab42fa955 Jun2023_9
+6f88424ebfd9d82c072cf21d89070e04321983da Jun2023_11
+6f88424ebfd9d82c072cf21d89070e04321983da Jun2023_SP2_release
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
 # ChangeLog file for devel
 # This file is updated with Maddlog
 
+* Thu Jul 27 2023 Niels Nes 
+- Removed the PYTHON MAP external language option, as after a fork the
+  synchronization primitives could be in any state, leading to deadlocks.
+  During the upgrade function definitions will fallback to the normal
+  PYTHON language option.
+
+* Mon Jul 17 2023 Panagiotis Koutsourakis 
+- Implemented direct masking for strimp construction. The strimps
+  datastructure now keeps an array of 65K 64-bit integers that is zero
+  everywhere except at the indexes that correspond to header pairs. The
+  entry for the nth pair in order has the nth bit of the bitstring
+  on. These can be used to quickly construct bitstrings.
diff --git a/ChangeLog-Archive b/ChangeLog-Archive
--- a/ChangeLog-Archive
+++ b/ChangeLog-Archive
@@ -1,6 +1,19 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Fri Sep 29 2023 Sjoerd Mullender  - 11.47.11-20230929
+- Fixed an installation issue on Debian and Ubuntu introduced in the
+  last build.
+
+* Wed Aug 30 2023 Sjoerd Mullender  - 11.47.7-20230925
+- Do a lot more error checking, mostly for allocation failures.  More is
+  still needed, though.
+
+*

MonetDB: Jun2023 - Remove declaration of non-existent function.

2023-10-25 Thread Sjoerd Mullender via checkin-list
Changeset: f4e4c30f4480 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f4e4c30f4480
Modified Files:
sql/backends/monet5/sql.h
Branch: Jun2023
Log Message:

Remove declaration of non-existent function.


diffs (11 lines):

diff --git a/sql/backends/monet5/sql.h b/sql/backends/monet5/sql.h
--- a/sql/backends/monet5/sql.h
+++ b/sql/backends/monet5/sql.h
@@ -282,7 +282,6 @@ extern str SQLflush_log(Client cntxt, Ma
 extern str SQLsuspend_log_flushing(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 extern str SQLresume_log_flushing(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 extern str SQLhot_snapshot(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-extern str SQLhot_snapshot_wrap(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 
 extern str SQLsession_prepared_statements(Client cntxt, MalBlkPtr mb, 
MalStkPtr stk, InstrPtr pci);
 extern str SQLsession_prepared_statements_args(Client cntxt, MalBlkPtr mb, 
MalStkPtr stk, InstrPtr pci);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Jun2023 - Fix upgrade output.

2023-10-25 Thread Sjoerd Mullender via checkin-list
Changeset: 5d16b384dec7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5d16b384dec7
Modified Files:

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/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: Jun2023
Log Message:

Fix upgrade output.


diffs (truncated from 611 to 300 lines):

diff --git 
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- 
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ 
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -367,7 +367,7 @@ update sys.functions set system = true w
 delete from sys.triggers where name = 'system_update_tables' and table_id = 
2067;
 
 Running database upgrade commands:
-CREATE FUNCTION "timestamp_to_str"(d TIMESTAMP, format STRING) RETURNS STRING 
EXTERNAL NAME mtime."timestamp_to_str";
-GRANT EXECUTE ON FUNCTION "timestamp_to_str"(TIMESTAMP, STRING) TO PUBLIC;
+CREATE FUNCTION timestamp_to_str(d TIMESTAMP, format STRING) RETURNS STRING 
EXTERNAL NAME mtime."timestamp_to_str";
+GRANT EXECUTE ON FUNCTION timestamp_to_str(TIMESTAMP, STRING) TO PUBLIC;
 UPDATE sys.functions SET system = true WHERE system <> true AND name = 
'timestamp_to_str' AND schema_id = 2000 and type = 1;
 
diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out 
b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
--- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
@@ -367,7 +367,7 @@ update sys.functions set system = true w
 delete from sys.triggers where name = 'system_update_tables' and table_id = 
2067;
 
 Running database upgrade commands:
-CREATE FUNCTION "timestamp_to_str"(d TIMESTAMP, format STRING) RETURNS STRING 
EXTERNAL NAME mtime."timestamp_to_str";
-GRANT EXECUTE ON FUNCTION "timestamp_to_str"(TIMESTAMP, STRING) TO PUBLIC;
+CREATE FUNCTION timestamp_to_str(d TIMESTAMP, format STRING) RETURNS STRING 
EXTERNAL NAME mtime."timestamp_to_str";
+GRANT EXECUTE ON FUNCTION timestamp_to_str(TIMESTAMP, STRING) TO PUBLIC;
 UPDATE sys.functions SET system = true WHERE system <> true AND name = 
'timestamp_to_str' AND schema_id = 2000 and type = 1;
 
diff --git 
a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
@@ -436,7 +436,7 @@ update sys.functions set system = true w
 delete from sys.triggers where name = 'system_update_tables' and table_id = 
2067;
 
 Running database upgrade commands:
-CREATE FUNCTION "timestamp_to_str"(d TIMESTAMP, format STRING) RETURNS STRING 
EXTERNAL NAME mtime."timestamp_to_str";
-GRANT EXECUTE ON FUNCTION "timestamp_to_str"(TIMESTAMP, STRING) TO PUBLIC;
+CREATE FUNCTION timestamp_to_str(d TIMESTAMP, format STRING) RETURNS STRING 
EXTERNAL NAME mtime."timestamp_to_str";
+GRANT EXECUTE ON FUNCTION timestamp_to_str(TIMESTAMP, STRING) TO PUBLIC;
 UPDATE sys.functions SET system = true WHERE system <> true AND name = 
'timestamp_to_str' AND schema_id = 2000 and type = 1;
 
diff --git 
a/sql/test/emptydb-previous-upgrade-hg

MonetDB: monetdburl - merged with default

2023-10-25 Thread Niels Nes via checkin-list
Changeset: 60390d593888 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/60390d593888
Branch: monetdburl
Log Message:

merged with default


diffs (truncated from 724 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
@@ -49764,6 +49764,21 @@ pattern sql.percent_rank(X_0:any_1, X_1:
 SQLpercent_rank;
 return the percentage into the total number of groups for each row
 sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged() (X_0:bat[:str], X_1:bat[:int], 
X_2:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only tables in current schema
+sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged(X_0:str) (X_1:bat[:str], X_2:bat[:int], 
X_3:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only tables in schema s
+sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged(X_0:str, X_1:str) (X_2:bat[:str], 
X_3:bat[:int], X_4:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only table in schema s table t
+sql
 predicate
 unsafe pattern sql.predicate(X_0:str, X_1:str, X_2:str):void 
 mvc_add_column_predicate;
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
@@ -38169,6 +38169,21 @@ pattern sql.percent_rank(X_0:any_1, X_1:
 SQLpercent_rank;
 return the percentage into the total number of groups for each row
 sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged() (X_0:bat[:str], X_1:bat[:int], 
X_2:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only tables in current schema
+sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged(X_0:str) (X_1:bat[:str], X_2:bat[:int], 
X_3:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only tables in schema s
+sql
+persist_unlogged
+unsafe pattern sql.persist_unlogged(X_0:str, X_1:str) (X_2:bat[:str], 
X_3:bat[:int], X_4:bat[:lng]) 
+SQLpersist_unlogged;
+Persist deltas on append only table in schema s table t
+sql
 predicate
 unsafe pattern sql.predicate(X_0:str, X_1:str, X_2:str):void 
 mvc_add_column_predicate;
diff --git a/common/stream/Tests/urlstream.py b/common/stream/Tests/urlstream.py
--- a/common/stream/Tests/urlstream.py
+++ b/common/stream/Tests/urlstream.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
 
 import http.server
 import io
@@ -69,7 +68,7 @@ class Handler(http.server.BaseHTTPReques
 
 def runserver():
 global port
-addr = ('', 0)
+addr = ('127.0.0.1', 0)
 srv = http.server.HTTPServer(addr, Handler)
 port = srv.server_port
 print(f"Listening on {port}", file=OUTPUT)
diff --git a/sql/backends/monet5/CMakeLists.txt 
b/sql/backends/monet5/CMakeLists.txt
--- a/sql/backends/monet5/CMakeLists.txt
+++ b/sql/backends/monet5/CMakeLists.txt
@@ -113,6 +113,7 @@ set(include_sql_files
   58_hot_snapshot
   75_storagemodel
   76_dump
+  77_storage
   80_statistics
   81_tracer
   91_information_schema)
diff --git a/sql/backends/monet5/Tests/All b/sql/backends/monet5/Tests/All
--- a/sql/backends/monet5/Tests/All
+++ b/sql/backends/monet5/Tests/All
@@ -33,3 +33,5 @@ limithack
 shutdown
 
 HAVE_HGE?int_notation_1e5
+
+!NOWAL?persist_unlogged
diff --git a/sql/backends/monet5/Tests/persist_unlogged.SQL.py 
b/sql/backends/monet5/Tests/persist_unlogged.SQL.py
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/Tests/persist_unlogged.SQL.py
@@ -0,0 +1,38 @@
+import os, tempfile
+
+from MonetDBtesting.sqltest import SQLTestCase
+try:
+from MonetDBtesting import process
+except ImportError:
+import process
+
+with tempfile.TemporaryDirectory() as farm_dir:
+os.mkdir(os.path.join(farm_dir, 'db1'))
+
+with process.server(mapiport='0', dbname='db1',
+dbfarm=os.path.join(farm_dir, 'db1'),
+stdin=process.PIPE,
+stdout=process.PIPE, stderr=process.PIPE) as s:
+with SQLTestCase() as tc:
+tc.connect(username="monetdb", password="monetdb", port=s.dbport, 
database='db1')
+tc.execute("CREATE UNLOGGED TABLE foo (x INT)").assertSucceeded()
+tc.execute("ALTER TABLE foo SET INSERT ONLY").assertSucceeded()
+tc.execute("INSERT INTO foo SELECT * FROM generate_series(0,500)")
+tc.execute("SELECT count(*) FROM 
foo").assertSucceeded().assertDataResultMatch([(500,)])
+tc.execute("SELECT table, rowcount FROM 
persist_unlogged()").assertSucceeded().assertDataResultMatch([('foo', 0)])
+
+# Simulate some work in order to trigger WAL flush(note that 
Mtests runs with --forcemito)
+tc.execute("CREATE TABLE bar (x INT)").assertSucceeded()
+tc.execute("INSERT INTO bar SELECT * FROM 
generate_series(0,10)").assertSucceeded()
+
+tc.execute("SELECT table, rowcount FROM 
persist_unlogged()").assertSucceeded().assertDataResultMatch([('f

MonetDB: nilmask - fixed output

2023-10-25 Thread Niels Nes via checkin-list
Changeset: f4279c7d5b06 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f4279c7d5b06
Modified Files:
clients/Tests/exports.stable.out
Branch: nilmask
Log Message:

fixed output


diffs (12 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
@@ -1575,7 +1575,7 @@ sql_table *mvc_bind_table(mvc *c, sql_sc
 str mvc_commit(mvc *c, int chain, const char *name, bool enabling_auto_commit);
 int mvc_create_column(sql_column **col, mvc *m, sql_table *t, const char 
*name, sql_subtype *tpe);
 int mvc_create_table(sql_table **t, mvc *m, sql_schema *s, const char *name, 
int tt, bit system, int persistence, int commit_action, int sz, bit properties);
-int mvc_result_column(backend *be, const char *tn, const char *name, const 
char *typename, int digits, int scale, BAT *b);
+int mvc_result_column(backend *be, const char *tn, const char *name, const 
char *typename, int digits, int scale, BAT *b, BAT *mask);
 int mvc_result_table(backend *be, oid query_id, int nr_cols, mapi_query_t 
type);
 str mvc_rollback(mvc *c, int chain, const char *name, bool 
disabling_auto_commit);
 str number2name(str s, int len, int i);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Jun2023 - Approve powerpc upgrade output.

2023-10-25 Thread Sjoerd Mullender via checkin-list
Changeset: 5c16ae49b8e7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5c16ae49b8e7
Modified Files:
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
Branch: Jun2023
Log Message:

Approve powerpc upgrade output.


diffs (13 lines):

diff --git 
a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
@@ -70,7 +70,7 @@ update sys.functions set system = true w
 update sys.functions set system = true where system <> true and name = 
'filter' and schema_id = (select id from sys.schemas where name = 'json') and 
type = 1;
 
 Running database upgrade commands:
-CREATE FUNCTION "timestamp_to_str"(d TIMESTAMP, format STRING) RETURNS STRING 
EXTERNAL NAME mtime."timestamp_to_str";
-GRANT EXECUTE ON FUNCTION "timestamp_to_str"(TIMESTAMP, STRING) TO PUBLIC;
+CREATE FUNCTION timestamp_to_str(d TIMESTAMP, format STRING) RETURNS STRING 
EXTERNAL NAME mtime."timestamp_to_str";
+GRANT EXECUTE ON FUNCTION timestamp_to_str(TIMESTAMP, STRING) TO PUBLIC;
 UPDATE sys.functions SET system = true WHERE system <> true AND name = 
'timestamp_to_str' AND schema_id = 2000 and type = 1;
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Approve upgrades for recent changes.

2023-10-25 Thread Sjoerd Mullender via checkin-list
Changeset: 314bef24a7e2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/314bef24a7e2
Modified Files:

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-chain/Tests/upgrade.stable.out.ppc64.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:

Approve upgrades for recent changes.


diffs (truncated from 3268 to 300 lines):

diff --git 
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- 
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ 
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -599,15 +599,15 @@ CREATE VIEW INFORMATION_SCHEMA.COLUMNS A
   cast(c."number" +1 AS int) AS ORDINAL_POSITION,
   c."default" AS COLUMN_DEFAULT,
   cast(sys.ifthenelse(c."null", 'YES', 'NO') AS varchar(3)) AS IS_NULLABLE,
-  c."type" AS DATA_TYPE,
+  CASE c."type" WHEN 'day_interval' THEN 'interval day' WHEN 'month_interval' 
THEN 'interval month' WHEN 'sec_interval' THEN 'interval second' ELSE c."type" 
END AS DATA_TYPE,
   cast(sys.ifthenelse(c."type" IN 
('varchar','clob','char','json','url','xml'), c."type_digits", NULL) AS int) AS 
CHARACTER_MAXIMUM_LENGTH,
   cast(sys.ifthenelse(c."type" IN 
('varchar','clob','char','json','url','xml'), c."type_digits" * 3, NULL) AS 
int) AS CHARACTER_OCTET_LENGTH,
   cast(sys.ifthenelse(c."type" IN 
('int','smallint','tinyint','bigint','hugeint','float','real','double','decimal','numeric','oid'),
 c."type_digits", NULL) AS int) AS NUMERIC_PRECISION,
   cast(sys.ifthenelse(c."type" IN 
('int','smallint','tinyint','bigint','hugeint','float','real','double','oid'), 
2, sys.ifthenelse(c."type" IN ('decimal','numeric'), 10, NULL)) AS int) AS 
NUMERIC_PRECISION_RADIX,
   cast(sys.ifthenelse(c."type" IN 
('int','smallint','tinyint','bigint','hugeint','float','real','double','decimal','numeric','oid'),
 c."type_scale", NULL) AS int) AS NUMERIC_SCALE,
   cast(sys.ifthenelse(c."type" IN 
('date','timestamp','timestamptz','time','timetz'), c."type_scale" -1, NULL) AS 
int) AS DATETIME_PRECISION,
-  cast(CASE c."type" WHEN 'day_interval' THEN 'interval day' WHEN 
'month_interval' THEN 'interval month' WHEN 'sec_interval' THEN 'interval 
second' ELSE NULL END AS varchar(40)) AS INTERVAL_TYPE,
-  cast(sys.ifthenelse(c."type" IN 
('day_interval','month_interval','sec_interval'), c."type_scale" -1, NULL) AS 
int) AS INTERVAL_PRECISION,
+  cast(CASE c."type" WHEN 'day_interval' THEN 'interval day' WHEN 
'month_interval' THEN (CASE c."type_digits" WHEN 1 THEN 'interval year' WHEN 2 
THEN 'interval year to month' WHEN 3 THEN 'interval month' ELSE NULL END) WHEN 
'sec_interval' THEN (CASE c."type_digits" WHEN 5 THEN 'interval day to hour' 
WHEN 6 THEN 'interval day to minute' WHEN 7 THEN 'interval day to second' WHEN 
8 THEN 'interval hour' WHEN 9 THEN 'interval hour to minute' WHEN 10 THEN 
'interval hour to second' WHEN 11 THEN 'interval minute' WHEN 12 THEN 'interval 
minute to second' WHEN 13 THEN 'interval second' ELSE NULL END) ELSE NULL END 
AS varchar(40)) AS INTERVAL_TYPE,
+  cast(CASE c."type" WHEN 'day_interval' THEN 0 WHEN 'month_interval' THEN 0 
WHEN 'sec_interval' THEN (sys.ifthenelse(c."type_digits" IN (7, 10, 12, 13), 

MonetDB: default - Merge with Jun2023 branch.

2023-10-25 Thread Sjoerd Mullender via checkin-list
Changeset: 23904801fe79 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/23904801fe79
Modified Files:
sql/backends/monet5/sql.h
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-chain/Tests/upgrade.stable.out.ppc64.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/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 Jun2023 branch.


diffs (truncated from 764 to 300 lines):

diff --git a/monetdb5/modules/atoms/Tests/All b/monetdb5/modules/atoms/Tests/All
--- a/monetdb5/modules/atoms/Tests/All
+++ b/monetdb5/modules/atoms/Tests/All
@@ -38,3 +38,5 @@ startswith
 endswith
 contains
 HAVE_ICONV?asciify
+
+ts_and_tstz_to_str_bug
diff --git a/monetdb5/modules/atoms/Tests/ts_and_tstz_to_str_bug.test 
b/monetdb5/modules/atoms/Tests/ts_and_tstz_to_str_bug.test
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/atoms/Tests/ts_and_tstz_to_str_bug.test
@@ -0,0 +1,16 @@
+statement ok
+CREATE TABLE t2 (dt TIMESTAMP)
+
+statement ok
+INSERT INTO t2 (dt) VALUES('2023-10-11 11:36')
+
+query I
+SELECT
+levenshtein(sys.timestamp_to_str(cast(dt as timestamp with time zone), 
'%Y-%d-%d %H:%M:%S'),
+sys.timestamp_to_str(dt, '%Y-%d-%d %H:%M:%S'))
+FROM t2
+
+0
+
+statement ok
+DROP TABLE t2
diff --git a/sql/backends/monet5/sql.h b/sql/backends/monet5/sql.h
--- a/sql/backends/monet5/sql.h
+++ b/sql/backends/monet5/sql.h
@@ -282,7 +282,6 @@ extern str SQLflush_log(Client cntxt, Ma
 extern str SQLsuspend_log_flushing(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 extern str SQLresume_log_flushing(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 extern str SQLhot_snapshot(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-extern str SQLhot_snapshot_wrap(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 extern str SQLpersist_unlogged(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 
 extern str SQLsession_prepared_statements(Client cntxt, MalBlkPtr mb, 
MalStkPtr stk, InstrPtr pci);
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
@@ -5179,6 +5179,7 @@ sql_update_jun2023(Client c, mvc *sql, s
char *err = NULL, *buf = GDKmalloc(bufsize);
res_table *output;
BAT *b;
+   sql_subtype t1, t2;
 
(void) sql;
if (buf == NULL)
@@ -5546,7 +5547,6 @@ sql_update_jun2023(Client c, mvc *sql, s
/* Add new sysadmin procedure calls: stop, pause and resume with two
   arguments, first arg is query OID and second the user username that
   the query in bound to. */
-   sql_subtype t1, t2;
sql_find_subtype(&t1, "bigint", 64, 0);
sql_find_subtype(&t2, "varchar", 0, 0);
if (!sql_bind_func(sql, "sys", "pause", &t1, &t2, F_PROC, true)) {
@@ -5781,6 +5781,38 @@ sql_update_jun2023(Client c, mvc *sql, s
 }
 
 static str
+sql_update_jun2023_sp3(Client c, mvc *sql, sql_schema *s)
+{
+   (void)s;
+   char *err = NULL;
+   sql_subtype t1, t2;
+
+   sql_find_subtype(&t1, "timestamp", 0, 0);
+   sql_find_subtype(&t2, "varchar", 0, 0);
+
+   

MonetDB: nilmask - merged with default

2023-10-25 Thread Niels Nes via checkin-list
Changeset: befa1b10e22b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/befa1b10e22b
Branch: nilmask
Log Message:

merged with default


diffs (truncated from 3604 to 300 lines):

diff --git a/monetdb5/modules/atoms/Tests/All b/monetdb5/modules/atoms/Tests/All
--- a/monetdb5/modules/atoms/Tests/All
+++ b/monetdb5/modules/atoms/Tests/All
@@ -38,3 +38,5 @@ startswith
 endswith
 contains
 HAVE_ICONV?asciify
+
+ts_and_tstz_to_str_bug
diff --git a/monetdb5/modules/atoms/Tests/ts_and_tstz_to_str_bug.test 
b/monetdb5/modules/atoms/Tests/ts_and_tstz_to_str_bug.test
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/atoms/Tests/ts_and_tstz_to_str_bug.test
@@ -0,0 +1,16 @@
+statement ok
+CREATE TABLE t2 (dt TIMESTAMP)
+
+statement ok
+INSERT INTO t2 (dt) VALUES('2023-10-11 11:36')
+
+query I
+SELECT
+levenshtein(sys.timestamp_to_str(cast(dt as timestamp with time zone), 
'%Y-%d-%d %H:%M:%S'),
+sys.timestamp_to_str(dt, '%Y-%d-%d %H:%M:%S'))
+FROM t2
+
+0
+
+statement ok
+DROP TABLE t2
diff --git a/sql/backends/monet5/sql.h b/sql/backends/monet5/sql.h
--- a/sql/backends/monet5/sql.h
+++ b/sql/backends/monet5/sql.h
@@ -282,7 +282,6 @@ extern str SQLflush_log(Client cntxt, Ma
 extern str SQLsuspend_log_flushing(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 extern str SQLresume_log_flushing(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 extern str SQLhot_snapshot(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
pci);
-extern str SQLhot_snapshot_wrap(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 extern str SQLpersist_unlogged(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 
 extern str SQLsession_prepared_statements(Client cntxt, MalBlkPtr mb, 
MalStkPtr stk, InstrPtr pci);
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
@@ -5179,6 +5179,7 @@ sql_update_jun2023(Client c, mvc *sql, s
char *err = NULL, *buf = GDKmalloc(bufsize);
res_table *output;
BAT *b;
+   sql_subtype t1, t2;
 
(void) sql;
if (buf == NULL)
@@ -5546,7 +5547,6 @@ sql_update_jun2023(Client c, mvc *sql, s
/* Add new sysadmin procedure calls: stop, pause and resume with two
   arguments, first arg is query OID and second the user username that
   the query in bound to. */
-   sql_subtype t1, t2;
sql_find_subtype(&t1, "bigint", 64, 0);
sql_find_subtype(&t2, "varchar", 0, 0);
if (!sql_bind_func(sql, "sys", "pause", &t1, &t2, F_PROC, true)) {
@@ -5781,6 +5781,38 @@ sql_update_jun2023(Client c, mvc *sql, s
 }
 
 static str
+sql_update_jun2023_sp3(Client c, mvc *sql, sql_schema *s)
+{
+   (void)s;
+   char *err = NULL;
+   sql_subtype t1, t2;
+
+   sql_find_subtype(&t1, "timestamp", 0, 0);
+   sql_find_subtype(&t2, "varchar", 0, 0);
+
+   if (!sql_bind_func(sql, "sys", "timestamp_to_str", &t1, &t2, F_FUNC, 
true)) {
+   sql->session->status = 0;
+   sql->errstr[0] = '\0';
+
+   char *query = GDKmalloc(512);
+   if (query == NULL)
+   throw(SQL, __func__, SQLSTATE(HY013) MAL_MALLOC_FAIL);
+
+   snprintf(query, 512, "CREATE FUNCTION timestamp_to_str(d 
TIMESTAMP, format STRING) RETURNS STRING "
+"EXTERNAL NAME mtime.\"timestamp_to_str\";\n"
+"GRANT EXECUTE ON FUNCTION 
timestamp_to_str(TIMESTAMP, STRING) TO PUBLIC;\n"
+"UPDATE sys.functions SET system = true WHERE 
system <> true AND name = 'timestamp_to_str' "
+"AND schema_id = 2000 and type = %d;\n", 
F_FUNC);
+
+   printf("Running database upgrade commands:\n%s\n", query);
+   err = SQLstatementIntern(c, query, "update", true, false, NULL);
+   GDKfree(query);
+   }
+
+   return err; /* usually MAL_SUCCEED */
+}
+
+static str
 sql_update_default_geom(Client c, mvc *sql, sql_schema *s)
 {
sql_subtype tp;
@@ -6278,10 +6310,10 @@ sql_update_default(Client c, mvc *sql, s
"EXTERNAL NAME sql.persist_unlogged;\n"
"CREATE FUNCTION sys.persist_unlogged(sname STRING)\n"
"RETURNS TABLE(\"table\" STRING, \"table_id\" INT, 
\"rowcount\" BIGINT)\n"
-   "EXTERNAL NAME sql.persist_unlogged(string);\n"
+   "EXTERNAL NAME sql.persist_unlogged;\n"
"CREATE FUNCTION sys.persist_unlogged(sname STRING, 
tname STRING)\n"
"RETURNS TABLE(\"table\" STRING, \"table_id\" INT, 
\"rowcount\" BIGINT)\n"
-   "EXTERNAL NAME sql.persist_unlogged(string, string);\n"
+   "EXTERNAL NAME sql.persist_unlogged;\n"
"GRANT EXECUTE ON FUNCTION 

MonetDB: monetdburl - Gather detailed tlssecurity.py logging on ...

2023-10-25 Thread Joeri van Ruth via checkin-list
Changeset: 62c65ce2ff87 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/62c65ce2ff87
Modified Files:
clients/mapilib/Tests/tlssecurity.py
Branch: monetdburl
Log Message:

Gather detailed tlssecurity.py logging on all platforms


diffs (135 lines):

diff --git a/clients/mapilib/Tests/tlssecurity.py 
b/clients/mapilib/Tests/tlssecurity.py
--- a/clients/mapilib/Tests/tlssecurity.py
+++ b/clients/mapilib/Tests/tlssecurity.py
@@ -12,8 +12,9 @@ import tlstester
 level = logging.WARNING
 # if sys.platform == 'win32':
 # level=logging.DEBUG
-#level = logging.DEBUG
+level = logging.DEBUG
 logging.basicConfig(level=level)
+logging.warning("For once this test will fail intentionally")
 
 tgtdir = os.environ['TSTTRGDIR']
 assert os.path.isdir(tgtdir)
@@ -52,13 +53,14 @@ server = tlstester.TLSTester(
 server_thread = threading.Thread(target=server.serve_forever, daemon=True)
 server_thread.start()
 
-def attempt(portname: str, expected_error: str, tls=True, **params):
+def attempt(experiment: str, portname: str, expected_error: str, tls=True, 
**params):
 port = server.get_port(portname)
 scheme = 'monetdbs' if tls else 'monetdb'
 url = f"{scheme}://localhost:{port}/demo"
 if params:
 # should be percent-escaped
 url += '?' + '&'.join(f"{k}={v}" for k, v in params.items())
+logging.debug(f" START TEST {experiment}")
 logging.debug(f"Connecting to {url}, expected_error={expected_error}")
 cmd = ['mclient', '-d', url]
 logging.debug(f"cmd={cmd}")
@@ -68,14 +70,16 @@ def attempt(portname: str, expected_erro
 output = str(proc.stderr, 'utf-8').rstrip()
 actual_error = None if 'Sorry, this is not' in output else output
 
+ok = False
 if expected_error is None and actual_error is None:
-logging.debug("Test succeeded")
+ok = True
+elif  expected_error is not None and actual_error is not None and 
expected_error in actual_error:
+ok = True
+if ok:
+logging.debug(f" END SUCCESFUL TEST {experiment} ")
 return
-if expected_error is not None and actual_error is not None and 
expected_error in actual_error:
-logging.debug("Test succeeded")
-return
-logging.error(f"Unexpected result when connecting to port {port} 
('{portname}')")
-logging.error(f"Using URL {url}")
+logging.error(f"Unexpected result for test {experiment}")
+logging.error(f"When connecting to port '{portname}' using URL {url}")
 message = f"expected_error={expected_error} but 
actual_error={actual_error}"
 logging.error(message)
 raise Exception(message)
@@ -89,28 +93,28 @@ def attempt(portname: str, expected_erro
 #
 # Connect to port 'plain', without using TLS. Have a succesful MAPI exchange.
 
-attempt('plain', None, tls=False)
+attempt('connect_plain', 'plain', None, tls=False)
 
 # connect_tls
 #
 # Connect to port 'server1' over TLS, verifying the connection using ca1.crt.
 # Have a succesful MAPI exchange.
 
-attempt('server1', None, cert=certpath('ca1.crt'))
+attempt('connect_tls', 'server1', None, cert=certpath('ca1.crt'))
 
 # refuse_no_cert
 #
 # Connect to port 'server1' over TLS, without passing a certificate. The
 # connection should fail because ca1.crt is not in the system trust root store.
 
-attempt('server1', "verify failed")
+attempt('refuse_no_cert', 'server1', "verify failed")
 
 # refuse_wrong_cert
 #
 # Connect to port 'server1' over TLS, verifying the connection using ca2.crt.
 # The client should refuse to let the connection proceed.
 
-attempt('server1', 'verify failed', cert=certpath('ca2.crt'))
+attempt('refuse_wrong_cert', 'server1', 'verify failed', 
cert=certpath('ca2.crt'))
 
 # refuse_tlsv12
 #
@@ -118,14 +122,14 @@ attempt('server1', 'verify failed', cert
 # client should refuse to let the connection proceed because it should require
 # at least TLSv1.3.
 
-attempt('tls12', 'protocol version', cert=certpath('ca1.crt'))
+attempt('refuse_tlsv12', 'tls12', 'protocol version', cert=certpath('ca1.crt'))
 
 # refuse_expired
 #
 # Connect to port 'expiredcert' over TLS, verifying the connection using
 # ca1.crt. The client should refuse to let the connection proceed.
 
-attempt('expiredcert', 'verify failed', cert=certpath('ca1.crt'))
+attempt('refuse_expired', 'expiredcert', 'verify failed', 
cert=certpath('ca1.crt'))
 
 # connect_client_auth
 #
@@ -134,19 +138,19 @@ attempt('expiredcert', 'verify failed', 
 # exchange.
 
 # TODO
-#attempt('clientauth', None, 
cert=certpath('ca1.crt'),clientcert=certpath('client2.crt'), 
clientkey=certpath('client2.key'))
+#attempt('connect_client_auth', 'clientauth', None, 
cert=certpath('ca1.crt'),clientcert=certpath('client2.crt'), 
clientkey=certpath('client2.key'))
 
 # fail_plain_to_tls
 #
 # Connect to port 'plain' over TLS. This should fail, not hang.
 
-attempt('plain', 'wrong version number', tls=True)
+attempt('fail_plain_to_tls', 'plain', 'wrong version number', tls=True)
 
 # fail_tls_to_plain
 #
 # Make a p