MonetDB: default - a little more values flattening, ie with proj...

2022-02-17 Thread Niels Nes
Changeset: b599d28be2f0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b599d28be2f0
Modified Files:
sql/server/rel_unnest.c
Branch: default
Log Message:

a little more values flattening, ie with projections with multiple attributes 
and multiple values (and a sub query) flatten using unions.


diffs (75 lines):

diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -3784,15 +3784,51 @@ rewrite_complex(visitor *v, sql_rel *rel
return e;
 }
 
+static sql_rel *
+flatten_values(mvc *sql, sql_rel *rel)
+{
+   list *exps = sa_list(sql->sa);
+   sql_exp *e = rel->exps->h->data;
+   sql_rel *cur = NULL;
+   list *vals = exp_get_values(e);
+   if (vals) {
+   for(int i = 0; isa, NULL, 
sa_list(sql->sa));
+   set_processed(nrel);
+   for(node *n = rel->exps->h; n; n = n->next) {
+   sql_exp *e = n->data;
+   list *vals = exp_get_values(e);
+
+   if (vals) {
+   if (i == 0)
+   append(exps, exp_ref(sql, e));
+   sql_exp *v = list_fetch(vals, i);
+   append(nrel->exps, v);
+   rel_set_exps(nrel, nrel->exps);
+   }
+   }
+   if (cur) {
+   nrel = rel_setop(sql->sa, cur, nrel, op_union);
+   rel_setop_set_exps(sql, nrel, exps, false);
+   set_processed(nrel);
+   }
+   cur = nrel;
+   }
+   rel_destroy(rel);
+   rel = cur;
+   }
+   return rel;
+}
+
 /* rewrite project [ [multi values], [multi values2] , .. [] ] -> union ) */
 static inline sql_rel *
 rewrite_values(visitor *v, sql_rel *rel)
 {
int single = is_single(rel);
-   if (!is_simple_project(rel->op) || list_empty(rel->exps))
+   if (!is_simple_project(rel->op) || list_empty(rel->exps) || 
is_rewrite_values_used(rel->used))
return rel;
 
-   if (rel_is_ref(rel) && !is_rewrite_values_used(rel->used)) { /* need 
extra project */
+   if (rel_is_ref(rel)) { /* need extra project */
rel->l = rel_project(v->sql->sa, rel->l, rel->exps);
rel->exps = rel_projections(v->sql, rel->l, NULL, 1, 1);
((sql_rel*)rel->l)->r = rel->r; /* propagate order by exps */
@@ -3803,6 +3839,9 @@ rewrite_values(visitor *v, sql_rel *rel)
}
sql_exp *e = rel->exps->h->data;
 
+   if (is_values(e) && list_length(rel->exps) > 1 && 
exps_have_rel_exp(rel->exps))
+   return flatten_values(v->sql, rel);
+
if (!is_values(e) || list_length(exp_get_values(e))<=1 || 
(!exp_has_freevar(v->sql, e) && !exp_has_rel(e)))
return rel;
 
@@ -3834,6 +3873,7 @@ rewrite_values(visitor *v, sql_rel *rel)
}
rel_destroy(rel);
rel = cur;
+   rel->used |= rewrite_values_used;
if (single)
set_single(rel);
}
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merged with Jan2022

2022-02-17 Thread Pedro Ferreira
Changeset: c9cf4d6e3fcb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c9cf4d6e3fcb
Modified Files:
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/UDF/pyapi3/pyapi3.c
sql/backends/monet5/sql_statement.c
sql/test/BugTracker-2022/Tests/All
Branch: default
Log Message:

Merged with Jan2022


diffs (200 lines):

diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -642,13 +642,7 @@ static str RAPIeval(Client cntxt, MalBlk
  "Embedded R initialization has failed");
}
 
-   if (!grouped) {
-   sql_subfunc *sqlmorefun = (*(sql_subfunc**) 
getArgReference(stk, pci, pci->retc+has_card_arg));
-   if (sqlmorefun) sqlfun = sqlmorefun->func;
-   } else {
-   sqlfun = *(sql_func**) getArgReference(stk, pci, 
pci->retc+has_card_arg);
-   }
-
+   sqlfun = *(sql_func**) getArgReference(stk, pci, 
pci->retc+has_card_arg);
args = (str*) GDKzalloc(sizeof(str) * pci->argc);
if (args == NULL) {
throw(MAL, "rapi.eval", SQLSTATE(HY013) MAL_MALLOC_FAIL);
diff --git a/sql/backends/monet5/UDF/capi/capi.c 
b/sql/backends/monet5/UDF/capi/capi.c
--- a/sql/backends/monet5/UDF/capi/capi.c
+++ b/sql/backends/monet5/UDF/capi/capi.c
@@ -528,16 +528,7 @@ static str CUDFeval(Client cntxt, MalBlk
sa = (struct sigaction) {.sa_flags = 0,};
}
 
-   if (!grouped) {
-   sql_subfunc *sqlmorefun =
-   (*(sql_subfunc **)getArgReference_ptr(stk, pci, 
pci->retc));
-   if (sqlmorefun)
-   sqlfun =
-   (*(sql_subfunc **)getArgReference_ptr(stk, pci, 
pci->retc))->func;
-   } else {
-   sqlfun = *(sql_func **)getArgReference_ptr(stk, pci, pci->retc);
-   }
-
+   sqlfun = *(sql_func **)getArgReference_ptr(stk, pci, pci->retc);
funcname = sqlfun ? sqlfun->base.name : "yet_another_c_function";
 
args = (str *)GDKzalloc(sizeof(str) * pci->argc);
diff --git a/sql/backends/monet5/UDF/pyapi3/pyapi3.c 
b/sql/backends/monet5/UDF/pyapi3/pyapi3.c
--- a/sql/backends/monet5/UDF/pyapi3/pyapi3.c
+++ b/sql/backends/monet5/UDF/pyapi3/pyapi3.c
@@ -213,15 +213,7 @@ static str PyAPIeval(Client cntxt, MalBl
card = 1;
}
 
-   if (!grouped) {
-   sql_subfunc *sqlmorefun =
-   (*(sql_subfunc **)getArgReference(stk, pci, pci->retc + 
has_card_arg));
-   if (sqlmorefun) {
-   sqlfun = sqlmorefun->func;
-   }
-   } else {
-   sqlfun = *(sql_func **)getArgReference(stk, pci, pci->retc + 
has_card_arg);
-   }
+   sqlfun = *(sql_func **)getArgReference(stk, pci, pci->retc + 
has_card_arg);
exprStr = *getArgReference_str(stk, pci, pci->retc + 1 + has_card_arg);
varres = sqlfun ? sqlfun->varres : 0;
retcols = !varres ? pci->retc : -1;
diff --git a/sql/backends/monet5/UDF/pyapi3/pyloader3.c 
b/sql/backends/monet5/UDF/pyapi3/pyloader3.c
--- a/sql/backends/monet5/UDF/pyapi3/pyloader3.c
+++ b/sql/backends/monet5/UDF/pyapi3/pyloader3.c
@@ -68,13 +68,13 @@ PYAPI3PyAPIevalLoader(Client cntxt, MalB
 
char *loader_additional_args[] = {"_emit", "_conn"};
 
-if (!PYAPI3PyAPIInitialized()) {
-throw(MAL, "pyapi3.eval",
-  SQLSTATE(PY000) "Embedded Python is enabled but an error was 
thrown during initialization.");
-}
-sqlmorefun = *(sql_subfunc**) getArgReference(stk, pci, pci->retc);
-sqlfun = sqlmorefun->func;
-exprStr = *getArgReference_str(stk, pci, pci->retc + 1);
+   if (!PYAPI3PyAPIInitialized()) {
+   throw(MAL, "pyapi3.eval",
+   SQLSTATE(PY000) "Embedded Python is enabled but 
an error was thrown during initialization.");
+   }
+   sqlmorefun = *(sql_subfunc**) getArgReference(stk, pci, pci->retc);
+   sqlfun = sqlmorefun->func;
+   exprStr = *getArgReference_str(stk, pci, pci->retc + 1);
 
args = (str *)GDKzalloc(pci->argc * sizeof(str));
if (!args) {
diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -1381,7 +1381,7 @@ stmt_genselect(backend *be, stmt *lops, 
// push pointer to the SQL structure into the MAL call
// allows getting argument names for example
if (LANG_EXT(f->func->lang))
-   q = pushPtr(mb, q, f); // nothing to see here, please 
move along
+   q = pushPtr(mb, q, f->func); // nothing to see here, 
please move along
// f->query contains the R code to be run
if (f->func->lang == FUNC_LANG_R || f->func->lang >= 
FUNC_LANG_PY)
q = pushS

MonetDB: Jan2022 - Use right query parameters for test

2022-02-17 Thread Pedro Ferreira
Changeset: 5fa38340e7bc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5fa38340e7bc
Modified Files:
sql/test/BugTracker-2022/Tests/insert-not-null.Bug-7232.test
Branch: Jan2022
Log Message:

Use right query parameters for test


diffs (20 lines):

diff --git a/sql/test/BugTracker-2022/Tests/insert-not-null.Bug-7232.test 
b/sql/test/BugTracker-2022/Tests/insert-not-null.Bug-7232.test
--- a/sql/test/BugTracker-2022/Tests/insert-not-null.Bug-7232.test
+++ b/sql/test/BugTracker-2022/Tests/insert-not-null.Bug-7232.test
@@ -27,14 +27,14 @@ statement ok
 COMMIT
 
 @connection(id=1)
-query T
+query I rowsort
 SELECT k FROM test
 
 1
 2
 
 @connection(id=2)
-query T
+query I rowsort
 SELECT k FROM test
 
 1
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Small improvement for query queue. After resu...

2022-02-17 Thread Pedro Ferreira
Changeset: 2da125e65cb1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2da125e65cb1
Modified Files:
monetdb5/modules/mal/sysmon.c
Branch: default
Log Message:

Small improvement for query queue. After resume/stop/pause a query, leave loop 
immediately. Cleanup


diffs (129 lines):

diff --git a/monetdb5/modules/mal/sysmon.c b/monetdb5/modules/mal/sysmon.c
--- a/monetdb5/modules/mal/sysmon.c
+++ b/monetdb5/modules/mal/sysmon.c
@@ -190,12 +190,8 @@ SYSMONqueue(Client cntxt, MalBlkPtr mb, 
}
 
MT_lock_set(&mal_delayLock);
-   for (size_t i = qtail; i != qhead; i++){
-   if ( i == qsize){
-   i = 0;
-   if( i == qhead)
-   break;
-   }
+   size_t i = qtail;
+   while (i != qhead){
if( QRYqueue[i].query && (cntxt->user == MAL_ADMIN ||
strcmp(cntxt->username, 
QRYqueue[i].username) == 0) ){
qtag = (lng) QRYqueue[i].tag;
@@ -247,6 +243,8 @@ SYSMONqueue(Client cntxt, MalBlkPtr mb, 
 BUNappend(memory, &mem, false) != GDK_SUCCEED)
goto bailout;
}
+   if (++i >= qsize)
+   i = 0;
}
MT_lock_unset(&mal_delayLock);
BBPkeepref( *t =tag->batCacheid);
@@ -290,18 +288,23 @@ SYSMONpause(Client cntxt, MalBlkPtr mb, 
}
if (tag < 1)
throw(MAL, "SYSMONpause", SQLSTATE(42000) "Tag must be 
positive");
+   if (cntxt->user != MAL_ADMIN)
+   throw(MAL, "SYSMONpause", SQLSTATE(42000) "Administrator rights 
required");
+
+   oid ctag = (oid) tag;
MT_lock_set(&mal_delayLock);
-   for (size_t i = qtail; i != qhead; i++){
-   if( i == qsize){
+   size_t i = qtail;
+   while (i != qhead) {
+   if (QRYqueue[i].tag == ctag) {
+   if (QRYqueue[i].stk) {
+   QRYqueue[i].stk->status = 'p';
+   QRYqueue[i].status = "paused";
+   set = true;
+   }
+   break; /* the tag was found, but the query could have 
already finished */
+   }
+   if (++i >= qsize)
i = 0;
-   if( i == qhead)
-   break;
-   }
-   if( (lng) QRYqueue[i].tag == tag && cntxt->user == MAL_ADMIN && 
QRYqueue[i].stk){
-   QRYqueue[i].stk->status = 'p';
-   QRYqueue[i].status = "paused";
-   set = true;
-   }
}
MT_lock_unset(&mal_delayLock);
return set ? MAL_SUCCEED : createException(MAL, "SYSMONpause", 
SQLSTATE(42000) "Tag " LLFMT " unknown", tag);
@@ -323,18 +326,23 @@ SYSMONresume(Client cntxt, MalBlkPtr mb,
}
if (tag < 1)
throw(MAL, "SYSMONresume", SQLSTATE(42000) "Tag must be 
positive");
+   if (cntxt->user != MAL_ADMIN)
+   throw(MAL, "SYSMONresume", SQLSTATE(42000) "Administrator 
rights required");
+
+   oid ctag = (oid) tag;
MT_lock_set(&mal_delayLock);
-   for (size_t i = qtail; i == qhead; i++){
-   if( i == qsize){
+   size_t i = qtail;
+   while (i != qhead) {
+   if (QRYqueue[i].tag == ctag) {
+   if (QRYqueue[i].stk) {
+   QRYqueue[i].stk->status = 0;
+   QRYqueue[i].status = "running";
+   set = true;
+   }
+   break; /* the tag was found, but the query could have 
already finished */
+   }
+   if (++i >= qsize)
i = 0;
-   if ( i== qhead)
-   break;
-   }
-   if( (lng)QRYqueue[i].tag == tag && cntxt->user == MAL_ADMIN && 
QRYqueue[i].stk){
-   QRYqueue[i].stk->status = 0;
-   QRYqueue[i].status = "running";
-   set = true;
-   }
}
MT_lock_unset(&mal_delayLock);
return set ? MAL_SUCCEED : createException(MAL, "SYSMONresume", 
SQLSTATE(42000) "Tag " LLFMT " unknown", tag);
@@ -356,18 +364,23 @@ SYSMONstop(Client cntxt, MalBlkPtr mb, M
}
if (tag < 1)
throw(MAL, "SYSMONstop", SQLSTATE(42000) "Tag must be 
positive");
+   if (cntxt->user != MAL_ADMIN)
+   throw(MAL, "SYSMONstop", SQLSTATE(42000) "Administrator rights 
required");
+
+   oid ctag = (oid) tag;
MT_lock_set(&mal_delayLock);
-   for (size_t i = qtail; i != qhead; i++){
-   if( i == qsize){
+   size_t i = qtail;
+   while (i != qhead) {
+   if (QRYqueue[i].tag == ctag) {
+

MonetDB: Jan2022 - Fix for bug #7252 Don't use resolved function...

2022-02-17 Thread Pedro Ferreira
Changeset: 2d76ae286a7c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2d76ae286a7c
Added Files:
sql/test/BugTracker-2022/Tests/python-udf-inside-udf.Bug-7252.test
Modified Files:
monetdb5/extras/rapi/rapi.c
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/UDF/pyapi3/pyapi3.c
sql/backends/monet5/UDF/pyapi3/pyloader3.c
sql/backends/monet5/sql_statement.c
sql/test/BugTracker-2022/Tests/All
sql/test/BugTracker-2022/Tests/SingleServer
Branch: Jan2022
Log Message:

Fix for bug #7252 Don't use resolved function parameter in the backend, because 
it is scoped to the current session only.
Use the function itself instead.
However improvement has to be done for loader functions, because they use 
information from the resolved function. It should be done differently


diffs (180 lines):

diff --git a/monetdb5/extras/rapi/rapi.c b/monetdb5/extras/rapi/rapi.c
--- a/monetdb5/extras/rapi/rapi.c
+++ b/monetdb5/extras/rapi/rapi.c
@@ -642,13 +642,7 @@ static str RAPIeval(Client cntxt, MalBlk
  "Embedded R initialization has failed");
}
 
-   if (!grouped) {
-   sql_subfunc *sqlmorefun = (*(sql_subfunc**) 
getArgReference(stk, pci, pci->retc+has_card_arg));
-   if (sqlmorefun) sqlfun = sqlmorefun->func;
-   } else {
-   sqlfun = *(sql_func**) getArgReference(stk, pci, 
pci->retc+has_card_arg);
-   }
-
+   sqlfun = *(sql_func**) getArgReference(stk, pci, 
pci->retc+has_card_arg);
args = (str*) GDKzalloc(sizeof(str) * pci->argc);
if (args == NULL) {
throw(MAL, "rapi.eval", SQLSTATE(HY013) MAL_MALLOC_FAIL);
diff --git a/sql/backends/monet5/UDF/capi/capi.c 
b/sql/backends/monet5/UDF/capi/capi.c
--- a/sql/backends/monet5/UDF/capi/capi.c
+++ b/sql/backends/monet5/UDF/capi/capi.c
@@ -529,16 +529,7 @@ static str CUDFeval(Client cntxt, MalBlk
sa = (struct sigaction) {.sa_flags = 0,};
}
 
-   if (!grouped) {
-   sql_subfunc *sqlmorefun =
-   (*(sql_subfunc **)getArgReference_ptr(stk, pci, 
pci->retc));
-   if (sqlmorefun)
-   sqlfun =
-   (*(sql_subfunc **)getArgReference_ptr(stk, pci, 
pci->retc))->func;
-   } else {
-   sqlfun = *(sql_func **)getArgReference_ptr(stk, pci, pci->retc);
-   }
-
+   sqlfun = *(sql_func **)getArgReference_ptr(stk, pci, pci->retc);
funcname = sqlfun ? sqlfun->base.name : "yet_another_c_function";
 
args = (str *)GDKzalloc(sizeof(str) * pci->argc);
diff --git a/sql/backends/monet5/UDF/pyapi3/pyapi3.c 
b/sql/backends/monet5/UDF/pyapi3/pyapi3.c
--- a/sql/backends/monet5/UDF/pyapi3/pyapi3.c
+++ b/sql/backends/monet5/UDF/pyapi3/pyapi3.c
@@ -213,15 +213,7 @@ static str PyAPIeval(Client cntxt, MalBl
card = 1;
}
 
-   if (!grouped) {
-   sql_subfunc *sqlmorefun =
-   (*(sql_subfunc **)getArgReference(stk, pci, pci->retc + 
has_card_arg));
-   if (sqlmorefun) {
-   sqlfun = sqlmorefun->func;
-   }
-   } else {
-   sqlfun = *(sql_func **)getArgReference(stk, pci, pci->retc + 
has_card_arg);
-   }
+   sqlfun = *(sql_func **)getArgReference(stk, pci, pci->retc + 
has_card_arg);
exprStr = *getArgReference_str(stk, pci, pci->retc + 1 + has_card_arg);
varres = sqlfun ? sqlfun->varres : 0;
retcols = !varres ? pci->retc : -1;
diff --git a/sql/backends/monet5/UDF/pyapi3/pyloader3.c 
b/sql/backends/monet5/UDF/pyapi3/pyloader3.c
--- a/sql/backends/monet5/UDF/pyapi3/pyloader3.c
+++ b/sql/backends/monet5/UDF/pyapi3/pyloader3.c
@@ -68,13 +68,13 @@ PYAPI3PyAPIevalLoader(Client cntxt, MalB
 
char *loader_additional_args[] = {"_emit", "_conn"};
 
-if (!PYAPI3PyAPIInitialized()) {
-throw(MAL, "pyapi3.eval",
-  SQLSTATE(PY000) "Embedded Python is enabled but an error was 
thrown during initialization.");
-}
-sqlmorefun = *(sql_subfunc**) getArgReference(stk, pci, pci->retc);
-sqlfun = sqlmorefun->func;
-exprStr = *getArgReference_str(stk, pci, pci->retc + 1);
+   if (!PYAPI3PyAPIInitialized()) {
+   throw(MAL, "pyapi3.eval",
+   SQLSTATE(PY000) "Embedded Python is enabled but 
an error was thrown during initialization.");
+   }
+   sqlmorefun = *(sql_subfunc**) getArgReference(stk, pci, pci->retc);
+   sqlfun = sqlmorefun->func;
+   exprStr = *getArgReference_str(stk, pci, pci->retc + 1);
 
args = (str *)GDKzalloc(pci->argc * sizeof(str));
if (!args) {
diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -1381,7 +1381,7 @@ stmt_genselect(backend *be, stmt *lops, 
// push pointe

MonetDB: default - Merge with Jan2022 branch.

2022-02-17 Thread Sjoerd Mullender
Changeset: d4d124f10c3a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d4d124f10c3a
Branch: default
Log Message:

Merge with Jan2022 branch.


diffs (37 lines):

diff --git a/README.rst b/README.rst
--- a/README.rst
+++ b/README.rst
@@ -109,8 +109,7 @@ The following packages are optional:
 ``unixODBC-devel``, ``valgrind-devel``.
 
 On Ubuntu and Debian the following packages are required:
-``bison``, ``cmake``, ``gcc``, ``libssl-dev``, ``pkg-config``,
-``python3``.
+``bison``, ``cmake``, ``gcc``, ``pkg-config``, ``python3``.
 
 The following packages are optional but recommended:
 ``libbz2-dev``, ``uuid-dev``, ``libpcre3-dev``, ``libreadline-dev``,
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Vcs-Hg: https://dev.monetdb.org/hg/Monet
 Build-Depends: debhelper (>= 9), cmake (>= 3.12), bison,
  libbz2-dev, libcurl4-gnutls-dev, libgeos-dev (>= 3.4.0),
  libpcre3-dev, libreadline-dev, liblzma-dev, liblz4-dev (>= 1.8.0),
- libssl-dev, libxml2-dev, pkg-config,
+ libxml2-dev, pkg-config,
  python3, python3-dev, python3-numpy,
  unixodbc-dev, uuid-dev, zlib1g-dev, r-base-dev,
  libcfitsio-dev
diff --git a/geom/sql/conformance/Tests/All b/geom/sql/conformance/Tests/All
--- a/geom/sql/conformance/Tests/All
+++ b/geom/sql/conformance/Tests/All
@@ -46,7 +46,7 @@ HAVE_GEOM?T44
 HAVE_GEOM?T45
 HAVE_GEOM?T46
 HAVE_GEOM?T47
-HAVE_GEOM&GEOS_VERSION>=3.9?T48
+HAVE_GEOM&GEOS_VERSION>=3.9.1?T48
 HAVE_GEOM&GEOS_VERSION>=3.9?T49
 HAVE_GEOM?T50
 HAVE_GEOM?T51
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Nov2019 - Fixes so that we can compile on newer systems.

2022-02-17 Thread Sjoerd Mullender
Changeset: 5616bf0302f2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5616bf0302f2
Modified Files:
buildtools/conf/rules.mk
configure.ag
Branch: Nov2019
Log Message:

Fixes so that we can compile on newer systems.


diffs (23 lines):

diff --git a/buildtools/conf/rules.mk b/buildtools/conf/rules.mk
--- a/buildtools/conf/rules.mk
+++ b/buildtools/conf/rules.mk
@@ -11,6 +11,7 @@ MV=mv
 
 %.tab.c: %.y
$(BISON) -o $*.tab.c --defines=$*.tmph.h $(YFLAGS) $(AM_YFLAGS) $<
+   $(SED) -i~ 's/$*\.tmph\.h/$*.tab.h/' $*.tab.c
rm -f $*.tmph.h
 
 %.tab.h: %.y
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1885,7 +1885,7 @@ AC_ARG_WITH([proj],
[include proj support (default=auto)])],
[have_proj="$withval"])
 AS_VAR_IF([have_proj], [no], [], [
-   PKG_CHECK_MODULES([proj], [proj],
+   PKG_CHECK_MODULES([proj], [proj < 8.0.0],
[AC_DEFINE([HAVE_PROJ], 1, [Define if the proj library exists])
 have_proj=yes],
[AS_VAR_IF([have_proj], [auto], [],
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Jan2022 - Merge with Jul2021 branch.

2022-02-17 Thread Sjoerd Mullender
Changeset: e01b95ad745a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e01b95ad745a
Branch: Jan2022
Log Message:

Merge with Jul2021 branch.


diffs (12 lines):

diff --git a/geom/sql/conformance/Tests/All b/geom/sql/conformance/Tests/All
--- a/geom/sql/conformance/Tests/All
+++ b/geom/sql/conformance/Tests/All
@@ -46,7 +46,7 @@ HAVE_GEOM?T44
 HAVE_GEOM?T45
 HAVE_GEOM?T46
 HAVE_GEOM?T47
-HAVE_GEOM&GEOS_VERSION>=3.9?T48
+HAVE_GEOM&GEOS_VERSION>=3.9.1?T48
 HAVE_GEOM&GEOS_VERSION>=3.9?T49
 HAVE_GEOM?T50
 HAVE_GEOM?T51
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Jan2022 - No need for libssl anymore.

2022-02-17 Thread Sjoerd Mullender
Changeset: c90ef72adcf9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c90ef72adcf9
Modified Files:
README.rst
debian/control
Branch: Jan2022
Log Message:

No need for libssl anymore.


diffs (25 lines):

diff --git a/README.rst b/README.rst
--- a/README.rst
+++ b/README.rst
@@ -109,8 +109,7 @@ The following packages are optional:
 ``unixODBC-devel``, ``valgrind-devel``.
 
 On Ubuntu and Debian the following packages are required:
-``bison``, ``cmake``, ``gcc``, ``libssl-dev``, ``pkg-config``,
-``python3``.
+``bison``, ``cmake``, ``gcc``, ``pkg-config``, ``python3``.
 
 The following packages are optional but recommended:
 ``libbz2-dev``, ``uuid-dev``, ``libpcre3-dev``, ``libreadline-dev``,
diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Vcs-Hg: https://dev.monetdb.org/hg/Monet
 Build-Depends: debhelper (>= 9), cmake (>= 3.12), bison,
  libbz2-dev, libcurl4-gnutls-dev, libgeos-dev (>= 3.4.0),
  libpcre3-dev, libreadline-dev, liblzma-dev, liblz4-dev (>= 1.8.0),
- libssl-dev, libxml2-dev, pkg-config,
+ libxml2-dev, pkg-config,
  python3, python3-dev, python3-numpy,
  unixodbc-dev, uuid-dev, zlib1g-dev, r-base-dev,
  libcfitsio-dev
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Jul2021 - We need a higher geos version for T48.

2022-02-17 Thread Sjoerd Mullender
Changeset: 72d3f00f5ca5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/72d3f00f5ca5
Modified Files:
geom/sql/conformance/Tests/All
Branch: Jul2021
Log Message:

We need a higher geos version for T48.


diffs (12 lines):

diff --git a/geom/sql/conformance/Tests/All b/geom/sql/conformance/Tests/All
--- a/geom/sql/conformance/Tests/All
+++ b/geom/sql/conformance/Tests/All
@@ -46,7 +46,7 @@ HAVE_GEOM?T44
 HAVE_GEOM?T45
 HAVE_GEOM?T46
 HAVE_GEOM?T47
-HAVE_GEOM&GEOS_VERSION>=3.9?T48
+HAVE_GEOM&GEOS_VERSION>=3.9.1?T48
 HAVE_GEOM&GEOS_VERSION>=3.9?T49
 HAVE_GEOM?T50
 HAVE_GEOM?T51
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Make the urlstream.py test write more informa...

2022-02-17 Thread Joeri van Ruth
Changeset: 8f1be1e2aa0b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8f1be1e2aa0b
Modified Files:
common/stream/Tests/urlstream.py
Branch: default
Log Message:

Make the urlstream.py test write more information to stderr


diffs (25 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
@@ -72,10 +72,13 @@ url = f'http://localhost:{port}'
 def streamcat(suffix):
 u = url + suffix
 cmd = ['streamcat', 'read', u, 'urlstream']
-print(f'FETCHING {suffix}', end="", file=OUTPUT)
+print(f'FETCHING {suffix}', file=OUTPUT)
 PIPE = subprocess.PIPE
 p = subprocess.run(cmd, check=False, stdout=PIPE, stderr=PIPE, timeout=10)
 print(f' yielded return code {p.returncode}', file=OUTPUT)
+print(f' wrote {len(p.stdout)} bytes to stdout', file=OUTPUT)
+if p.stderr:
+print(f' stderr={p.stderr!r}', file=OUTPUT)
 return (p.returncode, p.stdout, p.stderr)
 
 def run_tests():
@@ -101,5 +104,5 @@ try:
 except Exception as e:
 output = OUTPUT.getvalue()
 if output:
-print(output)
+print(output, file=sys.stderr)
 raise e
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Approve upgrades.

2022-02-17 Thread Sjoerd Mullender
Changeset: a9e684a02df1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a9e684a02df1
Modified Files:

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

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

sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64.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.32bit
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-hge/Tests/upgrade.stable.out.ppc64.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64
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.32bit
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.32bit
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.32bit
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.32bit
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.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:

Approve upgrades.


diffs (truncated from 153903 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
@@ -1811,2289 +1811,2174 @@ insert into sys.functions values (482, '
 insert into sys.args values (46130, 482, 'res_0', 'decimal', 2, 0, 0, 0);
 insert into sys.args values (46131, 482, 'arg_1', 'decimal', 2, 0, 1, 1);
 insert into sys.args values (46132, 482, 'arg_2', 'decimal', 2, 0, 1, 2);
-insert into sys.functions values (483, 'bit_and', 'and', 'calc', 0, 1, false, 
false, false, 2000, true, false);
+insert into sys.functions values (483, 'sql_neg', '-', 'calc', 0, 1, false, 
false, false, 2000, true, false);
 insert into sys.args values (46133, 483, 'res_0', 'decimal', 2, 0, 0, 0);
 insert into sys.args values (46134, 483, 'arg_1', 'decimal', 2, 0, 1, 1);
-insert into sys.args values (46135, 483, 'arg_2', 'decimal', 2, 0, 1, 2);
-insert into sys.functions values (484, 'bit_or', 'or', 'calc', 0, 1, false, 
false, false, 2000, true, false);
-insert into sys.args values (46136, 484, 'res_0', 'decimal', 2, 0, 0, 0);
-insert into sys.args values (46137, 484, 'arg_1', 'decimal', 2, 0, 1, 1);
-insert into sys.args values (46138, 484, 'arg_2', 'decimal', 2, 0, 1, 2);
-insert into sys.functions values (485, 'bit_xor', 'xor', 'calc', 0, 1, false, 
false, false, 2000, true, false);
-insert into sys.args values (46139, 485, 'res_0', 'decimal', 2, 0, 0, 0);
-insert into sys.args values (46140, 485, 'arg_1', 'decimal', 2, 0, 1, 1);
-insert into sys.args values (46141, 485, 'arg_2', 'decimal', 2, 0, 1, 2);
-insert into sys.functions values (486, 'bit_not', 'not', 'calc', 0, 1, false, 
false, false, 2000, true, false);
-insert i

MonetDB: default - Expect simple projections only here

2022-02-17 Thread Pedro Ferreira
Changeset: 1dcefc8d2fb4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1dcefc8d2fb4
Modified Files:
sql/server/rel_rel.c
Branch: default
Log Message:

Expect simple projections only here


diffs (21 lines):

diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c
--- a/sql/server/rel_rel.c
+++ b/sql/server/rel_rel.c
@@ -1564,7 +1564,7 @@ static sql_rel *
 sql_rel *
 rel_add_identity(mvc *sql, sql_rel *rel, sql_exp **exp)
 {
-   if (rel && is_project(rel->op) && !need_distinct(rel) && (*exp = 
exps_find_identity(rel->exps, rel->l)) != NULL)
+   if (rel && is_simple_project(rel->op) && !need_distinct(rel) && (*exp = 
exps_find_identity(rel->exps, rel->l)) != NULL)
return rel;
return _rel_add_identity(sql, rel, exp);
 }
@@ -1574,7 +1574,7 @@ rel_add_identity2(mvc *sql, sql_rel *rel
 {
sql_rel *l = rel, *p = rel;
 
-   if (rel && is_project(rel->op) && (*exp = exps_find_identity(rel->exps, 
rel->l)) != NULL)
+   if (rel && is_simple_project(rel->op) && !need_distinct(rel) && (*exp = 
exps_find_identity(rel->exps, rel->l)) != NULL)
return rel;
while(l && !is_set(l->op) && rel_has_freevar(sql, l) && l->l) {
p = l;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - When re-labeling a relation, make sure a proj...

2022-02-17 Thread Pedro Ferreira
Changeset: b2ad2a121da5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b2ad2a121da5
Modified Files:
sql/server/rel_exp.c
sql/server/rel_rel.c
sql/server/rel_select.c
sql/test/SQLancer/Tests/sqlancer22.test
Branch: default
Log Message:

When re-labeling a relation, make sure a projection is generated


diffs (122 lines):

diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -2316,11 +2316,8 @@ exp_rel_update_exp(mvc *sql, sql_exp *e)
 sql_exp *
 exp_rel_label(mvc *sql, sql_exp *e)
 {
-   if (exp_is_rel(e)) {
-   sql_rel *r = e->l;
-
-   e->l = r = rel_label(sql, r, 1);
-   }
+   if (exp_is_rel(e))
+   e->l = rel_label(sql, e->l, 1);
return e;
 }
 
diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c
--- a/sql/server/rel_rel.c
+++ b/sql/server/rel_rel.c
@@ -635,7 +635,7 @@ rel_setop_check_types(mvc *sql, sql_rel 
sql_exp *le = n->data;
sql_exp *re = m->data;
 
-   if ((rel_convert_types(sql, l, r, &le, &re, 1, type_set) < 0))
+   if (rel_convert_types(sql, l, r, &le, &re, 1, type_set) < 0)
return NULL;
append(nls, le);
append(nrs, re);
@@ -755,15 +755,11 @@ rel_label( mvc *sql, sql_rel *r, int all
char cname[16], *cnme = NULL;
 
tnme = number2name(tname, sizeof(tname), nr);
-   if (!is_project(r->op)) {
+   if (!is_simple_project(r->op))
r = rel_project(sql->sa, r, rel_projections(sql, r, NULL, 1, 
1));
-   set_processed(r);
-   }
-   if (is_project(r->op) && r->exps) {
-   node *ne = r->exps->h;
-
+   if (!list_empty(r->exps)) {
list_hash_clear(r->exps);
-   for (; ne; ne = ne->next) {
+   for (node *ne = r->exps->h; ne; ne = ne->next) {
sql_exp *e = ne->data;
 
if (!is_freevar(e)) {
@@ -776,12 +772,8 @@ rel_label( mvc *sql, sql_rel *r, int all
}
}
/* op_projects can have a order by list */
-   if (r->op == op_project && r->r) {
-   list *exps = r->r;
-   node *ne = exps->h;
-
-   list_hash_clear(exps);
-   for (; ne; ne = ne->next) {
+   if (!list_empty(r->r)) {
+   for (node *ne = ((list*)r->r)->h; ne; ne = ne->next) {
if (all) {
nr = ++sql->label;
cnme = number2name(cname, sizeof(cname), nr);
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -1966,7 +1966,7 @@ rel_in_value_exp(sql_query *query, sql_r
/* list of values or subqueries */
if (n->type == type_list) {
sql_exp *values;
-   list *vals = sa_list(sql->sa), *nvalues;
+   list *vals = sa_list(sql->sa);
 
n = dl->h->next;
n = n->data.lval->h;
@@ -2004,9 +2004,8 @@ rel_in_value_exp(sql_query *query, sql_r
if (is_tuple) {
if (!(values = exp_tuples_set_supertype(sql, 
exp_get_values(le), values)))
return NULL;
-   if (!(nvalues = tuples_check_types(sql, 
exp_get_values(le), values)))
+   if (!(le->f = tuples_check_types(sql, 
exp_get_values(le), values)))
return NULL;
-   le->f = nvalues;
} else { /* if it's not a tuple, enforce coersion on the type 
for every element on the list */
sql_subtype super, *le_tpe = exp_subtype(le), 
*values_tpe = NULL;
 
diff --git a/sql/test/SQLancer/Tests/sqlancer22.test 
b/sql/test/SQLancer/Tests/sqlancer22.test
--- a/sql/test/SQLancer/Tests/sqlancer22.test
+++ b/sql/test/SQLancer/Tests/sqlancer22.test
@@ -623,6 +623,32 @@ select 1 where (2,3) in ((values (2, 3),
 
 1
 
+statement ok
+create table t4 (c0 int, c1 int)
+
+statement ok rowcount 3
+insert into t4 values (1,1),(2,2),(3,3)
+
+query I nosort
+select c1 from t4 where (c0,3) in (select 2,3 union all select 3,4)
+
+2
+
+query I nosort
+select c1 from t4 where (c0,3) in ((select 2,3 union all select 3,4),(select 
2,3 union all select 6,7))
+
+2
+
+query I rowsort
+select c1 from t4 where (c0,3) in ((select 2,3 union all select 3,4),(select 
3,3 union all select 5,4))
+
+2
+3
+
+query I nosort
+select c1 from t4 where (c0,3) in (select 2,3 where false)
+
+
 query I nosort
 SELECT 1 FROM (values (1, 4), (3, (select 2))) x(x,y) WHERE greatest(FALSE, 
FALSE)
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org