MonetDB: ascii-flag - Some cleanup; also check for timeouts a bi...

2024-03-05 Thread Sjoerd Mullender via checkin-list
Changeset: 0d1cdbcc9ea7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0d1cdbcc9ea7
Modified Files:
monetdb5/modules/mal/pcre.c
Branch: ascii-flag
Log Message:

Some cleanup; also check for timeouts a bit more often.


diffs (86 lines):

diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -1162,39 +1162,30 @@ re_like_build(struct RE **re, const char
return MAL_SUCCEED;
 }
 
-#define proj_scanloop(TEST)\
-   do {\
-   if (strNil(s))  \
-   return bit_nil; \
-   else\
-   return TEST;\
-   } while (0)
-
 static inline bit
 re_like_proj_apply(const char *s, const struct RE *restrict re,
   const char *pat,
   bool caseignore, bool anti, bool use_strcmp)
 {
+   if (strNil(s))
+   return bit_nil;
if (use_strcmp) {
if (caseignore) {
if (anti)
-   proj_scanloop(GDKstrcasecmp(s, pat) != 0);
+   return GDKstrcasecmp(s, pat) != 0;
else
-   proj_scanloop(GDKstrcasecmp(s, pat) == 0);
+   return GDKstrcasecmp(s, pat) == 0;
} else {
if (anti)
-   proj_scanloop(strcmp(s, pat) != 0);
+   return strcmp(s, pat) != 0;
else
-   proj_scanloop(strcmp(s, pat) == 0);
+   return strcmp(s, pat) == 0;
}
} else {
-   /* Use re_match_ignore only if the pattern is UTF-8
-* and we need to ignore case
-*/
if (anti)
-   proj_scanloop(!re_match(s, re));
+   return !re_match(s, re);
else
-   proj_scanloop(re_match(s, re));
+   return re_match(s, re);
}
 }
 
@@ -1825,8 +1816,6 @@ PCRElikeselect(bat *ret, const bat *bid,
 #define pcre_join_loop(STRCMP, RE_MATCH, PCRE_COND)
\
do {
\
for (BUN ridx = 0; ridx < rci.ncand; ridx++) {  
\
-   GDK_CHECK_TIMEOUT(qry_ctx, counter, 
\
- 
GOTO_LABEL_TIMEOUT_HANDLER(bailout, qry_ctx)); \
ro = canditer_next(&rci);   
\
vr = VALUE(r, ro - rbase);  
\
nl = 0; 
\
@@ -1844,7 +1833,7 @@ PCRElikeselect(bat *ret, const bat *bid,
pcrepat = NULL; 
\
}   
\
canditer_reset(&lci);   
\
-   for (BUN lidx = 0; lidx < lci.ncand; lidx++) {  
\
+   TIMEOUT_LOOP_IDX_DECL(lidx, lci.ncand, qry_ctx) 
{   \
lo = canditer_next(&lci);   
\
vl = VALUE(l, lo - lbase);  
\
if (strNil(vl)) {   
\
@@ -1899,6 +1888,8 @@ PCRElikeselect(bat *ret, const bat *bid,
}   
\
re_like_clean(&re); 
\
pcre_clean(&pcrere, &pcreex);   
\
+   TIMEOUT_CHECK(qry_ctx,  
\
+ 
GOTO_LABEL_TIMEOUT_HANDLER(bailout, qry_ctx)); \
}

MonetDB: ascii-flag - Convert inputs to lowercase for ILIKE join.

2024-03-05 Thread Sjoerd Mullender via checkin-list
Changeset: 7fb8f288cf97 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7fb8f288cf97
Modified Files:
monetdb5/modules/mal/pcre.c
Branch: ascii-flag
Log Message:

Convert inputs to lowercase for ILIKE join.


diffs (153 lines):

diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -1835,10 +1835,10 @@ PCRElikeselect(bat *ret, const bat *bid,
goto bailout;   
\
if (!empty) {   
\
if (use_re) {   
\
-   if ((msg = re_like_build(&re, vr, 
caseignore, use_strcmp, (unsigned char) *esc)) != MAL_SUCCEED) \
+   if ((msg = re_like_build(&re, vr, 
false, use_strcmp, (unsigned char) *esc)) != MAL_SUCCEED) \
goto bailout;   
\
} else if (pcrepat) {   
\
-   if ((msg = pcre_like_build(&pcrere, 
&pcreex, pcrepat, caseignore, lci.ncand)) != MAL_SUCCEED) \
+   if ((msg = pcre_like_build(&pcrere, 
&pcreex, pcrepat, false, lci.ncand)) != MAL_SUCCEED) \
goto bailout;   
\
GDKfree(pcrepat);   
\
pcrepat = NULL; 
\
@@ -1937,31 +1937,30 @@ pcrejoin(BAT *r1, BAT *r2, BAT *l, BAT *
regex_t pcrere = (regex_t) { 0 };
void *pcreex = NULL;
 #endif
+   lng t0 = 0;
 
size_t counter = 0;
QryCtx *qry_ctx = MT_thread_get_qry_ctx();
qry_ctx = qry_ctx ? qry_ctx : &(QryCtx) {.endtime = 0};
 
-   TRC_DEBUG(ALGO,
- "pcrejoin(l=%s#" BUNFMT "[%s]%s%s,"
- "r=%s#" BUNFMT "[%s]%s%s,sl=%s#" BUNFMT "%s%s,"
- "sr=%s#" BUNFMT "%s%s)\n",
- BATgetId(l), BATcount(l), ATOMname(l->ttype),
- l->tsorted ? "-sorted" : "",
- l->trevsorted ? "-revsorted" : "",
- BATgetId(r), BATcount(r), ATOMname(r->ttype),
- r->tsorted ? "-sorted" : "",
- r->trevsorted ? "-revsorted" : "",
- sl ? BATgetId(sl) : "NULL", sl ? BATcount(sl) : 0,
- sl && sl->tsorted ? "-sorted" : "",
- sl && sl->trevsorted ? "-revsorted" : "",
- sr ? BATgetId(sr) : "NULL", sr ? BATcount(sr) : 0,
- sr && sr->tsorted ? "-sorted" : "",
- sr && sr->trevsorted ? "-revsorted" : "");
+   TRC_DEBUG_IF(ALGO) t0 = GDKusec();
 
assert(ATOMtype(l->ttype) == ATOMtype(r->ttype));
assert(ATOMtype(l->ttype) == TYPE_str);
 
+   BAT *ol = NULL, *or = NULL;
+   if (caseignore) {
+   ol = l;
+   or = r;
+   l = BATtolower(l, NULL);
+   r = BATtolower(r, NULL);
+   if (l == NULL || r == NULL) {
+   BBPreclaim(l);
+   BBPreclaim(r);
+   throw(MAL, "pcre.join", GDK_EXCEPTION);
+   }
+   }
+
canditer_init(&lci, l, sl);
canditer_init(&rci, r, sr);
 
@@ -1989,22 +1988,18 @@ pcrejoin(BAT *r1, BAT *r2, BAT *l, BAT *
}
 
if (anti) {
-   if (caseignore) {
-   pcre_join_loop(GDKstrcasecmp(vl, vr) == 0,
-  re_match(vl, re), 
!PCRE_EXEC_COND);
-   } else {
-   pcre_join_loop(strcmp(vl, vr) == 0, re_match(vl, re), 
!PCRE_EXEC_COND);
-   }
+   pcre_join_loop(strcmp(vl, vr) == 0, re_match(vl, re), 
!PCRE_EXEC_COND);
} else {
-   if (caseignore) {
-   pcre_join_loop(GDKstrcasecmp(vl, vr) != 0,
-  !re_match(vl, re), 
PCRE_EXEC_COND);
-   } else {
-   pcre_join_loop(strcmp(vl, vr) != 0, !re_match(vl, re), 
PCRE_EXEC_COND);
-   }
+   pcre_join_loop(strcmp(vl, vr) != 0, !re_match(vl, re), 
PCRE_EXEC_COND);
}
bat_iterator_end(&li);
bat_iterator_end

MonetDB: sw_ew_c_sorting - Add -Xutf8 option to Python invocation.

2024-03-05 Thread Sjoerd Mullender via checkin-list
Changeset: c617ce8239f7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c617ce8239f7
Modified Files:
testing/Mtest.py.bat
Branch: sw_ew_c_sorting
Log Message:

Add -Xutf8 option to Python invocation.


diffs (9 lines):

diff --git a/testing/Mtest.py.bat b/testing/Mtest.py.bat
--- a/testing/Mtest.py.bat
+++ b/testing/Mtest.py.bat
@@ -8,4 +8,4 @@
 @REM Copyright August 2008 - 2023 MonetDB B.V.;
 @REM Copyright 1997 - July 2008 CWI.
 
-@python "%~dpn0" %*
+@python -Xutf8 "%~dpn0" %*
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: sw_ew_c_sorting - Merge with Dec2023 branch.

2024-03-05 Thread Sjoerd Mullender via checkin-list
Changeset: c452c76864e1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c452c76864e1
Branch: sw_ew_c_sorting
Log Message:

Merge with Dec2023 branch.


diffs (truncated from 1020 to 300 lines):

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 11.49.2
+current_version = 11.49.4
 commit = False
 tag = False
 
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -820,3 +820,4 @@ c9e6096e7519636a4e840c7a0c2e27cccb7dc0fe
 c9e6096e7519636a4e840c7a0c2e27cccb7dc0fe Jun2023_SP3_release
 1230526af30f40eeea30fb87c47c3e414920561f Dec2023_1
 1230526af30f40eeea30fb87c47c3e414920561f Dec2023_release
+95d8feaa1167b5ba87bd99253c3f4e62ebf528a1 Dec2023_3
diff --git a/ChangeLog-Archive b/ChangeLog-Archive
--- a/ChangeLog-Archive
+++ b/ChangeLog-Archive
@@ -1,6 +1,12 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Thu Jan 11 2024 Sjoerd Mullender  - 11.49.3-20240304
+- The copyright for the MonetDB software has been transferred to the newly
+  established MonetDB Foundation, a not-for-profit foundation with the
+  express goal of furthering the MonetDB database system.  The license
+  for the software does not change: MonetDB remains fully open source.
+
 * Fri Dec  1 2023 Sjoerd Mullender  - 11.49.1-20231221
 - All binary packages are now signed with a new key with key fingerprint
   DBCE 5625 94D7 1959 7B54  CE85 3F1A D47F 5521 A603.
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -9,7 +9,7 @@
 # Copyright 1997 - July 2008 CWI.
 
 %global name MonetDB
-%global version 11.49.2
+%global version 11.49.4
 %{!?buildno: %global buildno %(date +%Y%m%d)}
 
 # Use bcond_with to add a --with option; i.e., "without" is default.
@@ -91,7 +91,7 @@ Group: Applications/Databases
 License: MPL-2.0
 URL: https://www.monetdb.org/
 BugURL: https://github.com/MonetDB/MonetDB/issues
-Source: 
https://www.monetdb.org/downloads/sources/Dec2023/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP1/%{name}-%{version}.tar.bz2
 
 # The Fedora packaging document says we need systemd-rpm-macros for
 # the _unitdir and _tmpfilesdir macros to exist; however on RHEL 7
@@ -917,6 +917,69 @@ fi
 %endif
 
 %changelog
+* Mon Mar 04 2024 Sjoerd Mullender  - 11.49.3-20240304
+- Rebuilt.
+- GH#6800: Please add information_schema (ANSI SQL norm)
+- GH#7152: Occasional dbfarm corruption upon database restart
+- GH#7412: MonetDB server crashes in `vscanf`
+- GH#7415: MonetDB server crashes in `HEAP_malloc`
+- GH#7416: MonetDB server crashes in `atom_get_int`
+- GH#7417: MonetDB server crashes in `trimchars`.
+- GH#7418: MonetDB server crashes in `bind_col_exp`
+- GH#7420: Performance issue with lower(string)
+- GH#7425: The last statement, execution error, is a false positive?
+- GH#7426: Unexpected result for INNER JOIN with IS NOT NULL
+- GH#7428: Unexpected result when using BETWEEN operator
+- GH#7429: Unexpected result when using `CASE WHEN`
+- GH#7430: Unexpected result when using `AND` and `IS NOT NULL`
+- GH#7431: [bug] Error code found, please confirm
+- GH#7432: MonetDB server crashes in `dameraulevenshtein`
+- GH#7433: MonetDB server crashes in `exp_atom`
+- GH#7434: MonetDB server crashes in `exp_bin`
+- GH#7435: MonetDB server crashes in `exp_copy`
+- GH#7436: MonetDB server crashes in `exp_ref`
+- GH#7437: MonetDB server crashes in `exp_values_set_supertype`
+- GH#7438: MonetDB server crashes in `exps_bind_column`
+- GH#7439: MonetDB server crashes in `exps_card`
+- GH#7440: MonetDB server crashes in `gc_col`
+- GH#7441: MonetDB server crashes in `is_column_unique`
+- GH#7442: MonetDB server crashes in `mat_join2`
+- GH#7443: MonetDB server crashes in `merge_table_prune_and_unionize`
+- GH#7444: [bug] the table cannot be created because the reserved word is
+  incorrectly set
+- GH#7447: Unexpected result when using `BETWEEN` in `INNER JOIN`
+- GH#7448: Unexpected result when using `AND`/`OR` chain
+- GH#7450: Unexpected result when `CREATE VIEW` with `WHERE NULL`
+- GH#7451: Unexpected result when using `BETWEEN` and `CAST`
+- GH#7453: Cannot recover an msqldump
+- GH#7455: Unexpected result when using `BETWEEN` with `BOOLEAN` values
+- GH#7456: Crash when `INNER JOIN` with `VIEW`
+- GH#7457: Unexpected result when using `AND` with `INTEGER`
+- GH#7458: Unexpected result when using `SIGN`
+- GH#7461: Crash by potentially use of bad escape characters
+- GH#7462: Crash when using `BETWEEN AND`
+
+* Fri Mar  1 2024 Sjoerd Mullender  - 11.49.3-20240304
+- gdk: Fixed a regression where bats weren't always cleaned up when they
+  weren't needed anymore.  In particular, after a DELETE FROM table query
+  without a WHERE clause (which deletes all rows from the table), the
+  bats for the table get replaced by new ones, and the old, now unused,
+  bats weren't removed from the database.
+
+* Mon Jan 15 2024 Sjoerd Mullende

MonetDB: sw_ew_c_sorting - Check for nil values in contains join.

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

Check for nil values in contains join.


diffs (129 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -5472,74 +5472,76 @@ STRcontainsselect(Client cntxt, MalBlkPt
 
 #define CONTAINS_JOIN_LOOP(STR_CMP, STR_LEN)   
\
do {
\
-   canditer_init(&rci, r, cr); 
\
+   canditer_init(&rci, r, cr); 
\
for (BUN ridx = 0; ridx < rci.ncand; ridx++) {  
\
BAT *filtered_sl = NULL;
\
GDK_CHECK_TIMEOUT(timeoffset, counter, 
GOTO_LABEL_TIMEOUT_HANDLER(exit)); \
ro = canditer_next(&rci);   
\
vr = VALUE(r, ro - rbase);  
\
-   vr_len = STR_LEN;   
\
matches = 0;
\
-   if (with_strimps)   
\
-   filtered_sl = STRMPfilter(l, cl, vr, anti); 
\
-   if (filtered_sl)
\
-   canditer_init(&lci, l, filtered_sl);
\
-   else
\
-   canditer_init(&lci, l, cl); 
\
-   for (BUN lidx = 0; lidx < lci.ncand; lidx++) {  
\
-   lo = canditer_next(&lci);   
\
-   vl = VALUE(l, lo - lbase);  
\
-   if (strNil(vl)) 
\
-   continue;   
\
-   if (STR_CMP)
\
-   continue;   
\
-   if (BATcount(rl) == BATcapacity(rl)) {  
\
-   newcap = BATgrows(rl);  
\
-   BATsetcount(rl, BATcount(rl));  
\
-   if (rr) 
\
-   BATsetcount(rr, BATcount(rr));  
\
-   if (BATextend(rl, newcap) != 
GDK_SUCCEED || \
-   (rr && BATextend(rr, newcap) != 
GDK_SUCCEED)) { \
-   msg = createException(MAL, 
fname, SQLSTATE(HY013) MAL_MALLOC_FAIL); \
-   goto exit;  
\
+   if (!strNil(vr)) {  
\
+   vr_len = STR_LEN;   
\
+   if (with_strimps)   
\
+   filtered_sl = STRMPfilter(l, cl, vr, 
anti); \
+   if (filtered_sl)
  

MonetDB: sw_ew_c_sorting - Skipping because of nil works the sam...

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

Skipping because of nil works the same as not having a match.
Fixes the tdense property.


diffs (118 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -5546,69 +5546,69 @@ STRcontainsselect(Client cntxt, MalBlkPt
 
 #define STR_JOIN_NESTED_LOOP(STR_CMP, STR_LEN, FNAME)  
\
do {
\
-   canditer_init(&rci, r, cr); 
\
+   canditer_init(&rci, r, cr); 
\
for (BUN ridx = 0; ridx < rci.ncand; ridx++) {  
\
GDK_CHECK_TIMEOUT(timeoffset, counter, 
GOTO_LABEL_TIMEOUT_HANDLER(exit)); \
ro = canditer_next(&rci);   
\
vr = VALUE(r, ro - rbase);  
\
-   if (strNil(vr)) 
\
-   continue;   
\
-   vr_len = STR_LEN;   
\
matches = 0;
\
-   canditer_init(&lci, l, cl); 
\
-   for (BUN lidx = 0; lidx < lci.ncand; lidx++) {  
\
-   lo = canditer_next(&lci);   
\
-   vl = VALUE(l, lo - lbase);  
\
-   if (strNil(vl)) 
\
-   continue;   
\
-   if (!(STR_CMP)) 
\
-   continue;   
\
-   if (BATcount(rl) == BATcapacity(rl)) {  
\
-   newcap = BATgrows(rl);  
\
-   BATsetcount(rl, BATcount(rl));  
\
-   if (rr) 
\
-   BATsetcount(rr, BATcount(rr));  
\
-   if (BATextend(rl, newcap) != 
GDK_SUCCEED || \
-   (rr && BATextend(rr, newcap) != 
GDK_SUCCEED)) { \
-   msg = createException(MAL, 
FNAME, SQLSTATE(HY013) MAL_MALLOC_FAIL); \
-   goto exit;  
\
+   if (!strNil(vr)) {  
\
+   vr_len = STR_LEN;   
\
+   canditer_init(&lci, l, cl); 
\
+   for (BUN lidx = 0; lidx < lci.ncand; lidx++) {  
\
+   lo = canditer_next(&lci);   
\
+   vl = VALUE(l, lo - lbase);  
\
+   if (strNil(vl)) 
\
+   continue;   
\
+

MonetDB: sw_ew_c_sorting - make code somewhat more inline with e...

2024-03-05 Thread Niels Nes via checkin-list
Changeset: 23f676d97916 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/23f676d97916
Modified Files:
monetdb5/modules/atoms/str.c
Branch: sw_ew_c_sorting
Log Message:

make code somewhat more inline with expected output of str_cmp (strcmp).


diffs (27 lines):

diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -5559,9 +5559,9 @@ STRcontainsselect(Client cntxt, MalBlkPt
for (BUN lidx = 0; lidx < lci.ncand; lidx++) {  
\
lo = canditer_next(&lci);   
\
vl = VALUE(l, lo - lbase);  
\
-   if (strNil(vl)) 
\
+   if (strNil(vl)) 
\
continue;   
\
-   if (STR_CMP)
\
+   if (!(STR_CMP)) 
\
continue;   
\
if (BATcount(rl) == BATcapacity(rl)) {  
\
newcap = BATgrows(rl);  
\
@@ -5878,9 +5878,9 @@ str_join_nested(BAT *rl, BAT *rr, BAT *l
size_t counter = 0;
 
if (anti)
-   STR_JOIN_NESTED_LOOP((str_cmp(vl, vr, vr_len) == 0), 
str_strlen(vr), fname);
+   STR_JOIN_NESTED_LOOP((str_cmp(vl, vr, vr_len) != 0), 
str_strlen(vr), fname);
else
-   STR_JOIN_NESTED_LOOP((str_cmp(vl, vr, vr_len) != 0), 
str_strlen(vr), fname);
+   STR_JOIN_NESTED_LOOP((str_cmp(vl, vr, vr_len) == 0), 
str_strlen(vr), fname);
 
assert(!rr || BATcount(rl) == BATcount(rr));
BATsetcount(rl, BATcount(rl));
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - in case the remote user info is missing still...

2024-03-05 Thread Niels Nes via checkin-list
Changeset: aeb5dcbc8b7d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/aeb5dcbc8b7d
Added Files:
sql/test/remote/Tests/remote_info_missing.test
Modified Files:
sql/server/sql_mvc.c
sql/test/remote/Tests/All
Branch: Dec2023
Log Message:

in case the remote user info is missing still drop the remote table definition.
Added test as well.


diffs (59 lines):

diff --git a/sql/server/sql_mvc.c b/sql/server/sql_mvc.c
--- a/sql/server/sql_mvc.c
+++ b/sql/server/sql_mvc.c
@@ -1296,8 +1296,9 @@ mvc_create_remote(sql_table **t, mvc *m,
 }
 
 static str
-remote_drop(mvc *m, sqlid id)
+remote_drop(mvc *m, sql_table *t)
 {
+   sqlid id = t->base.id;
int log_res = 0;
sql_trans *tr = m->session->tr;
sqlstore *store = tr->store;
@@ -1305,7 +1306,9 @@ remote_drop(mvc *m, sqlid id)
sql_table *remote_user_info = find_sql_table(tr, sys, REMOTE_USER_INFO);
sql_column *remote_user_info_id = find_sql_column(remote_user_info, 
"table_id");
oid rid = store->table_api.column_find_row(tr, remote_user_info_id, 
&id, NULL);
-   if (is_oid_nil(rid) || (log_res = store->table_api.table_delete(tr, 
remote_user_info, rid)) != 0)
+   if (is_oid_nil(rid)) {
+   TRC_WARNING(SQL_TRANS, "Drop table: %s %s no remote info\n", 
t->s->base.name, t->base.name);
+   } else if ((log_res = store->table_api.table_delete(tr, 
remote_user_info, rid)) != 0)
throw(SQL, "sql.drop_table", SQLSTATE(42000) "Drop table 
failed%s", log_res == LOG_CONFLICT ? " due to conflict with another 
transaction" : "");
return MAL_SUCCEED;
 }
@@ -1316,7 +1319,7 @@ mvc_drop_table(mvc *m, sql_schema *s, sq
char *msg = NULL;
TRC_DEBUG(SQL_TRANS, "Drop table: %s %s\n", s->base.name, t->base.name);
 
-   if (isRemote(t) && (msg = remote_drop(m, t->base.id)) != NULL)
+   if (isRemote(t) && (msg = remote_drop(m, t)) != NULL)
return msg;
 
switch (sql_trans_drop_table(m->session->tr, s, t->base.name, 
drop_action ? DROP_CASCADE_START : DROP_RESTRICT)) {
diff --git a/sql/test/remote/Tests/All b/sql/test/remote/Tests/All
--- a/sql/test/remote/Tests/All
+++ b/sql/test/remote/Tests/All
@@ -3,3 +3,4 @@ HAVE_DATA_PATH?creds
 HAVE_DATA_PATH?invalid_creds
 HAVE_DATA_PATH?different_user
 THREADS>=2?partition_elim
+remote_info_missing
diff --git a/sql/test/remote/Tests/remote_info_missing.test 
b/sql/test/remote/Tests/remote_info_missing.test
new file mode 100644
--- /dev/null
+++ b/sql/test/remote/Tests/remote_info_missing.test
@@ -0,0 +1,12 @@
+statement ok
+create remote table t1234 (c int) on 'mapi:monetdb://localhost:5/demo/t1'
+
+statement ok
+delete from remote_user_info where table_id = (select id from sys._tables 
where name = 't1234')
+
+statement ok
+drop table t1234;
+
+query T
+select name from sys._tables where name = 't1234';
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: literal_features - merge with default

2024-03-05 Thread Yunus Koning via checkin-list
Changeset: e6c5993ce41c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e6c5993ce41c
Modified Files:
sql/server/rel_schema.c
Branch: literal_features
Log Message:

merge with default


diffs (truncated from 840 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -820,3 +820,4 @@ c9e6096e7519636a4e840c7a0c2e27cccb7dc0fe
 c9e6096e7519636a4e840c7a0c2e27cccb7dc0fe Jun2023_SP3_release
 1230526af30f40eeea30fb87c47c3e414920561f Dec2023_1
 1230526af30f40eeea30fb87c47c3e414920561f Dec2023_release
+95d8feaa1167b5ba87bd99253c3f4e62ebf528a1 Dec2023_3
diff --git a/ChangeLog-Archive b/ChangeLog-Archive
--- a/ChangeLog-Archive
+++ b/ChangeLog-Archive
@@ -1,6 +1,12 @@
 # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY
 # This file contains past ChangeLog entries
 
+* Thu Jan 11 2024 Sjoerd Mullender  - 11.49.3-20240304
+- The copyright for the MonetDB software has been transferred to the newly
+  established MonetDB Foundation, a not-for-profit foundation with the
+  express goal of furthering the MonetDB database system.  The license
+  for the software does not change: MonetDB remains fully open source.
+
 * Fri Dec  1 2023 Sjoerd Mullender  - 11.49.1-20231221
 - All binary packages are now signed with a new key with key fingerprint
   DBCE 5625 94D7 1959 7B54  CE85 3F1A D47F 5521 A603.
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -91,7 +91,7 @@ Group: Applications/Databases
 License: MPL-2.0
 URL: https://www.monetdb.org/
 BugURL: https://github.com/MonetDB/MonetDB/issues
-Source: 
https://www.monetdb.org/downloads/sources/Dec2023/%{name}-%{version}.tar.bz2
+Source: 
https://www.monetdb.org/downloads/sources/Dec2023-SP1/%{name}-%{version}.tar.bz2
 
 # The Fedora packaging document says we need systemd-rpm-macros for
 # the _unitdir and _tmpfilesdir macros to exist; however on RHEL 7
@@ -917,6 +917,69 @@ fi
 %endif
 
 %changelog
+* Mon Mar 04 2024 Sjoerd Mullender  - 11.49.3-20240304
+- Rebuilt.
+- GH#6800: Please add information_schema (ANSI SQL norm)
+- GH#7152: Occasional dbfarm corruption upon database restart
+- GH#7412: MonetDB server crashes in `vscanf`
+- GH#7415: MonetDB server crashes in `HEAP_malloc`
+- GH#7416: MonetDB server crashes in `atom_get_int`
+- GH#7417: MonetDB server crashes in `trimchars`.
+- GH#7418: MonetDB server crashes in `bind_col_exp`
+- GH#7420: Performance issue with lower(string)
+- GH#7425: The last statement, execution error, is a false positive?
+- GH#7426: Unexpected result for INNER JOIN with IS NOT NULL
+- GH#7428: Unexpected result when using BETWEEN operator
+- GH#7429: Unexpected result when using `CASE WHEN`
+- GH#7430: Unexpected result when using `AND` and `IS NOT NULL`
+- GH#7431: [bug] Error code found, please confirm
+- GH#7432: MonetDB server crashes in `dameraulevenshtein`
+- GH#7433: MonetDB server crashes in `exp_atom`
+- GH#7434: MonetDB server crashes in `exp_bin`
+- GH#7435: MonetDB server crashes in `exp_copy`
+- GH#7436: MonetDB server crashes in `exp_ref`
+- GH#7437: MonetDB server crashes in `exp_values_set_supertype`
+- GH#7438: MonetDB server crashes in `exps_bind_column`
+- GH#7439: MonetDB server crashes in `exps_card`
+- GH#7440: MonetDB server crashes in `gc_col`
+- GH#7441: MonetDB server crashes in `is_column_unique`
+- GH#7442: MonetDB server crashes in `mat_join2`
+- GH#7443: MonetDB server crashes in `merge_table_prune_and_unionize`
+- GH#7444: [bug] the table cannot be created because the reserved word is
+  incorrectly set
+- GH#7447: Unexpected result when using `BETWEEN` in `INNER JOIN`
+- GH#7448: Unexpected result when using `AND`/`OR` chain
+- GH#7450: Unexpected result when `CREATE VIEW` with `WHERE NULL`
+- GH#7451: Unexpected result when using `BETWEEN` and `CAST`
+- GH#7453: Cannot recover an msqldump
+- GH#7455: Unexpected result when using `BETWEEN` with `BOOLEAN` values
+- GH#7456: Crash when `INNER JOIN` with `VIEW`
+- GH#7457: Unexpected result when using `AND` with `INTEGER`
+- GH#7458: Unexpected result when using `SIGN`
+- GH#7461: Crash by potentially use of bad escape characters
+- GH#7462: Crash when using `BETWEEN AND`
+
+* Fri Mar  1 2024 Sjoerd Mullender  - 11.49.3-20240304
+- gdk: Fixed a regression where bats weren't always cleaned up when they
+  weren't needed anymore.  In particular, after a DELETE FROM table query
+  without a WHERE clause (which deletes all rows from the table), the
+  bats for the table get replaced by new ones, and the old, now unused,
+  bats weren't removed from the database.
+
+* Mon Jan 15 2024 Sjoerd Mullender  - 11.49.3-20240304
+- geom: We switched over to using the reentrant interface of the geos library.
+  This fixed a number of bugs that would occur sporadically.
+
+* Mon Jan 15 2024 Sjoerd Mullender  - 11.49.3-20240304
+- sql: The function json.isvalid(json) incorrectly returned true if the
+  argument was null.  It should return null.
+
+* Thu Jan 11 2024 Sjoerd Mullender  - 11.49.3-20240304
+- MonetDB: The 

MonetDB: literal_features - Add tests

2024-03-05 Thread Yunus Koning via checkin-list
Changeset: 89d7ec68f10a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/89d7ec68f10a
Added Files:
sql/test/2024/Tests/All
sql/test/2024/Tests/groupby_primary_key_project_unique_key.test
Branch: literal_features
Log Message:

Add tests


diffs (74 lines):

diff --git a/sql/test/2024/Tests/All b/sql/test/2024/Tests/All
new file mode 100644
--- /dev/null
+++ b/sql/test/2024/Tests/All
@@ -0,0 +1,1 @@
+groupby_primary_key_project_unique_key
diff --git a/sql/test/2024/Tests/groupby_primary_key_project_unique_key.test 
b/sql/test/2024/Tests/groupby_primary_key_project_unique_key.test
new file mode 100644
--- /dev/null
+++ b/sql/test/2024/Tests/groupby_primary_key_project_unique_key.test
@@ -0,0 +1,63 @@
+statement ok
+CREATE TABLE IF NOT EXISTS product (
+   product_id int PRIMARY KEY,
+   product_name varchar,
+   product_code varchar UNIQUE
+)
+
+
+statement ok
+CREATE TABLE IF NOT EXISTS product_part (
+   product_id int,
+   part_id int,
+   num int,
+   PRIMARY KEY (product_id, part_id)
+)
+
+
+statement ok
+insert into product values
+(1, 'telephone1', 'telepone1'),
+(2, 'telephone2', 'telepone2'),
+(3, 'telephone3', NULL),
+(4, 'telephone4', NULL)
+
+
+statement ok
+insert into product_part values
+(1, 10, 100),
+(1, 20, 200),
+(2, 10, 100),
+(2, 20, 200),
+(2, 30, 300),
+(3, 10, 100),
+(4, 10, 100),
+(4, 20, 200),
+(4, 30, 300)
+
+
+query II nosort
+SELECT product.product_id, sum(product_part.num) as sum_num
+FROM product JOIN product_part ON product.product_id = product_part.product_id
+GROUP BY product.product_id
+ORDER BY product.product_code, product.product_id
+
+3
+100
+4
+600
+1
+300
+2
+600
+
+statement error
+SELECT product.product_id, sum(product_part.num) as sum_num
+FROM
+(SELECT * FROM product UNION ALL VALUES (1, 'telephone5', 
'telephone5')) AS product 
+JOIN
+product_part
+ON product.product_id = product_part.product_id
+GROUP BY product.product_id
+ORDER BY product.product_code, product.product_id
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: ascii-flag - Do some special processing for ASCII prefi...

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

Do some special processing for ASCII prefixes.  Also clear properties.


diffs (truncated from 465 to 300 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2341,8 +2341,8 @@ gdk_export gdk_return BATfirstn(BAT **to
 
 #include "gdk_calc.h"
 
-gdk_export gdk_return GDKtoupper(char **buf, size_t *buflen, const char *s);
-gdk_export gdk_return GDKtolower(char **buf, size_t *buflen, const char *s);
+gdk_export gdk_return GDKtoupper(char **restrict buf, size_t *restrict buflen, 
const char *restrict s);
+gdk_export gdk_return GDKtolower(char **restrict buf, size_t *restrict buflen, 
const char *restrict s);
 gdk_export int GDKstrncasecmp(const char *str1, const char *str2, size_t l1, 
size_t l2);
 gdk_export int GDKstrcasecmp(const char *s1, const char *s2);
 gdk_export char *GDKstrcasestr(const char *haystack, const char *needle);
diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -1460,17 +1460,83 @@ GDKanalytical_str_group_concat(BAT *r, B
  * For the first byte of a UTF-8 encoding, use the value as index into
  * the table.  If the value is zero, there are no conversions for any
  * UTF-8 string starting with this byte (this includes both multi-byte
- * sequences and single-byte sequences).  For a single-byte sequence, if
- * the value is not zero, it is the converted codepoint.  For a
- * multi-byte sequence, if the value is not zero, it is an offset into
- * the same table.  The next byte is added to the offset and again used
- * as index into the table (including the top two bits which are always
- * 1 and 0 respectively).  The process then repeats: if zero, no
- * conversions for any sequence starting with the bytes looked up so
- * far, if non-zero, if this is the last byte of a sequence, it is the
- * converted codepoint, and otherwise a (new) offset into the same
- * table. */
-static int lowercase[4288] = {
+ * sequences and single-byte sequences, though note that for single-byte
+ * sequences (ASCII-compatible) the table is filled in completely at no
+ * extra cost).  For a single-byte sequence, if the value is not zero,
+ * it is the converted codepoint.  For a multi-byte sequence, if the
+ * value is not zero, it is an offset into the same table.  The next
+ * byte is added to the offset and again used as index into the table
+ * (including the top two bits which are always 1 and 0 respectively).
+ * The process then repeats: if zero, no conversions for any sequence
+ * starting with the bytes looked up so far, if non-zero, if this is the
+ * last byte of a sequence, it is the converted codepoint, and otherwise
+ * a (new) offset into the same table. */
+static const int lowercase[4288] = {
+   [0x0] = 0x0,/* U+:  */
+   [0x1] = 0x1,/* U+0001:  */
+   [0x2] = 0x2,/* U+0002:  */
+   [0x3] = 0x3,/* U+0003:  */
+   [0x4] = 0x4,/* U+0004:  */
+   [0x5] = 0x5,/* U+0005:  */
+   [0x6] = 0x6,/* U+0006:  */
+   [0x7] = 0x7,/* U+0007:  */
+   [0x8] = 0x8,/* U+0008:  */
+   [0x9] = 0x9,/* U+0009:  */
+   [0xA] = 0xA,/* U+000A:  */
+   [0xB] = 0xB,/* U+000B:  */
+   [0xC] = 0xC,/* U+000C:  */
+   [0xD] = 0xD,/* U+000D:  */
+   [0xE] = 0xE,/* U+000E:  */
+   [0xF] = 0xF,/* U+000F:  */
+   [0x10] = 0x10,  /* U+0010:  */
+   [0x11] = 0x11,  /* U+0011:  */
+   [0x12] = 0x12,  /* U+0012:  */
+   [0x13] = 0x13,  /* U+0013:  */
+   [0x14] = 0x14,  /* U+0014:  */
+   [0x15] = 0x15,  /* U+0015:  */
+   [0x16] = 0x16,  /* U+0016:  */
+   [0x17] = 0x17,  /* U+0017:  */
+   [0x18] = 0x18,  /* U+0018:  */
+   [0x19] = 0x19,  /* U+0019:  */
+   [0x1A] = 0x1A,  /* U+001A:  */
+   [0x1B] = 0x1B,  /* U+001B:  */
+   [0x1C] = 0x1C,  /* U+001C:  */
+   [0x1D] = 0x1D,  /* U+001D:  */
+   [0x1E] = 0x1E,  /* U+001E:  */
+   [0x1F] = 0x1F,  /* U+001F:  */
+   [0x20] = 0x20,  /* U+0020: SPACE */
+   [0x21] = 0x21,  /* U+0021: EXCLAMATION MARK */
+   [0x22] = 0x22,  /* U+0022: QUOTATION MARK */
+   [0x23] = 0x23,  /* U+0023: NUMBER SIGN */
+   [0x24] = 0x24,  /* U+0024: DOLLAR SIGN */
+   [0x25] = 0x25,  /* U+0025: PERCENT SIGN */
+   [0x26] = 0x26,  /* U+0026: AMPERSAND */
+   [0x27] = 0x27,  /* U+0027: APOSTROPHE */
+   [0x28] = 0x28,  /* U+0028: LEFT PARENTHESIS */
+   [0x29] = 0x29,  /* U+0029: RIGHT PARENTHES

MonetDB: ascii-flag - Make case conversion on a bat more efficient.

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

Make case conversion on a bat more efficient.


diffs (22 lines):

diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c
--- a/gdk/gdk_string.c
+++ b/gdk/gdk_string.c
@@ -4602,15 +4602,16 @@ BATcaseconvert(BAT *b, BAT *s, const int
bi = bat_iterator(b);
char *buf = NULL;
size_t buflen = 0;
-   TIMEOUT_LOOP(ci.ncand, qry_ctx) {
+   TIMEOUT_LOOP_IDX_DECL(i, ci.ncand, qry_ctx) {
BUN x = canditer_next(&ci) - bhseqbase;
if (convertcase(&buf, &buflen, (const uint8_t *) BUNtvar(bi, x),
convtab) != GDK_SUCCEED ||
-   BUNappend(bn, buf, false) != GDK_SUCCEED) {
+   tfastins_nocheckVAR(bn, i, buf) != GDK_SUCCEED) {
goto bailout;
}
}
GDKfree(buf);
+   BATsetcount(bn, ci.ncand);
bat_iterator_end(&bi);
TIMEOUT_CHECK(qry_ctx,
  GOTO_LABEL_TIMEOUT_HANDLER(bailout, qry_ctx));
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org