MonetDB: cmake-monetdblite - Merge with cmake-fun

2019-09-24 Thread Pedro Ferreira
Changeset: 9c1145dcb5f9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9c1145dcb5f9
Added Files:
sql/test/BugTracker-2019/Tests/double-free.Bug-6757.sql
sql/test/BugTracker-2019/Tests/double-free.Bug-6757.stable.err
sql/test/BugTracker-2019/Tests/double-free.Bug-6757.stable.out
sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.py
sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.err
sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.out
sql/test/BugTracker-2019/Tests/select-char.Bug-6761.sql
sql/test/BugTracker-2019/Tests/select-char.Bug-6761.stable.err
sql/test/BugTracker-2019/Tests/select-char.Bug-6761.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test1.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test2.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test3.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test4.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test5.timeout
sql/test/SQLite_regress/sqllogictest/sqllogictest.py
Removed Files:
sql/scripts/11_times.sql

sql/test/BugTracker-2015/Tests/incorrect_result_type.Bug-3687.stable.out.int128

sql/test/BugTracker-2016/Tests/column_alias_in_where_clause.Bug-3947.stable.out.int128

sql/test/BugTracker-2016/Tests/inner_join_cross_join.Bug-6140.stable.out.int128
sql/test/BugTracker-2017/Tests/crash-dce.Bug-6330.stable.out.int128

sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.out.int128

sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-aritmetic-expressions-handling.Bug-6576.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-coalesce-division-by-zero.Bug-6556.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-count-coalesce-nullif.Bug-6586.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-coalesce-error-message.Bug-6608.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-select-nullif-case.Bug-6579.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.out


MonetDB: cmake-fun - Merge with default

2019-09-24 Thread Pedro Ferreira
Changeset: 8dc8abdda576 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8dc8abdda576
Added Files:
sql/test/BugTracker-2019/Tests/double-free.Bug-6757.sql
sql/test/BugTracker-2019/Tests/double-free.Bug-6757.stable.err
sql/test/BugTracker-2019/Tests/double-free.Bug-6757.stable.out
sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.py
sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.err
sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.out
sql/test/BugTracker-2019/Tests/select-char.Bug-6761.sql
sql/test/BugTracker-2019/Tests/select-char.Bug-6761.stable.err
sql/test/BugTracker-2019/Tests/select-char.Bug-6761.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test1.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test1.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test1.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test2.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test2.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test2.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test3.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test3.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test3.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test4.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test4.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test4.timeout
sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.bat
sql/test/SQLite_regress/sqllogictest/Tests/test5.SQL.sh
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.err-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.out
sql/test/SQLite_regress/sqllogictest/Tests/test5.stable.out-noapprove
sql/test/SQLite_regress/sqllogictest/Tests/test5.timeout
sql/test/SQLite_regress/sqllogictest/sqllogictest.py
Removed Files:
sql/scripts/11_times.sql

sql/test/BugTracker-2015/Tests/incorrect_result_type.Bug-3687.stable.out.int128

sql/test/BugTracker-2016/Tests/column_alias_in_where_clause.Bug-3947.stable.out.int128

sql/test/BugTracker-2016/Tests/inner_join_cross_join.Bug-6140.stable.out.int128
sql/test/BugTracker-2017/Tests/crash-dce.Bug-6330.stable.out.int128

sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.out.int128

sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-aritmetic-expressions-handling.Bug-6576.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-coalesce-division-by-zero.Bug-6556.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-count-coalesce-nullif.Bug-6586.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-groupby-coalesce-error-message.Bug-6608.stable.out.int128

sql/test/BugTracker-2018/Tests/sqlitelogictest-select-nullif-case.Bug-6579.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.out

sql/test/SQLite_regress/sqllogictest/Tests/select1.test.stable.out.int128
sql/test/SQLite_regress/sqllogictest/Tests/select1.test.timeout
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.sql
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.err
sql/test/SQLite_regress/sqllogictest/Tests/select2.test.stable.out


MonetDB: Nov2019 - With verbosity level >= 2 (--verbose=2) print...

2019-09-24 Thread Sjoerd Mullender
Changeset: 8ce812361ac6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8ce812361ac6
Modified Files:
sql/backends/monet5/sql_execute.c
sql/server/sql_mvc.c
Branch: Nov2019
Log Message:

With verbosity level >= 2 (--verbose=2) print current query on commit/rollback.


diffs (80 lines):

diff --git a/sql/backends/monet5/sql_execute.c 
b/sql/backends/monet5/sql_execute.c
--- a/sql/backends/monet5/sql_execute.c
+++ b/sql/backends/monet5/sql_execute.c
@@ -712,13 +712,9 @@ SQLengineIntern(Client c, backend *be)
str msg = MAL_SUCCEED;
char oldlang = be->language;
mvc *m = be->mvc;
-   char *q;
 
if (oldlang == 'X') {   /* return directly from X-commands */
sqlcleanup(be->mvc, 0);
-   q = m->query;
-   m->query = NULL;
-   GDKfree(q);
return MAL_SUCCEED;
}
 
@@ -738,9 +734,6 @@ SQLengineIntern(Client c, backend *be)
goto cleanup_engine;
}
sqlcleanup(be->mvc, 0);
-   q = m->query;
-   m->query = NULL;
-   GDKfree(q);
return MAL_SUCCEED;
}
 
@@ -786,9 +779,6 @@ cleanup_engine:
MSresetInstructions(c->curprg->def, 1);
freeVariables(c, c->curprg->def, NULL, be->vtop);
be->language = oldlang;
-   q = m->query;
-   m->query = NULL;
-   GDKfree(q);
/*
 * Any error encountered during execution should block further 
processing
 * unless auto_commit has been set.
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
@@ -474,8 +474,10 @@ build up the hash (not copied in the tra
if (mvc_debug)
fprintf(stderr, "#mvc_commit done\n");
if (GDKverbose >= 1)
-   fprintf(stderr, "#%s: commit done (no changes)\n",
-   MT_thread_getname());
+   fprintf(stderr, "#%s: commit done (no 
changes)%s%.200s\n",
+   MT_thread_getname(),
+   GDKverbose >= 2 && m->query ? ", query: " : "",
+   GDKverbose >= 2 && m->query ? m->query : "");
return msg;
}
 
@@ -534,8 +536,10 @@ build up the hash (not copied in the tra
if (mvc_debug)
fprintf(stderr, "#mvc_commit done\n");
if (GDKverbose >= 1)
-   fprintf(stderr, "#%s: commit done\n",
-   MT_thread_getname());
+   fprintf(stderr, "#%s: commit done%s%.200s\n",
+   MT_thread_getname(),
+   GDKverbose >= 2 && m->query ? ", query: " : "",
+   GDKverbose >= 2 && m->query ? m->query : "");
return msg;
 }
 
@@ -599,9 +603,11 @@ mvc_rollback(mvc *m, int chain, const ch
if (mvc_debug)
fprintf(stderr, "#mvc_rollback %s done\n", (name) ? name : "");
if (GDKverbose >= 1)
-   fprintf(stderr, "#%s: commit%s%s rolled back%s\n",
+   fprintf(stderr, "#%s: commit%s%s rolled back%s%s%.200s\n",
MT_thread_getname(), name ? " " : "", name ? name : "",
-   tr->wtime == 0 ? " (no changes)" : "");
+   tr->wtime == 0 ? " (no changes)" : "",
+   GDKverbose >= 2 && m->query ? ", query: " : "",
+   GDKverbose >= 2 && m->query ? m->query : "");
return msg;
 }
 
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - Move saved query from client context to mvc.

2019-09-24 Thread Sjoerd Mullender
Changeset: ffa5eecd2beb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ffa5eecd2beb
Modified Files:
monetdb5/mal/mal_client.c
monetdb5/mal/mal_client.h
monetdb5/mal/mal_interpreter.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_scenario.c
sql/server/sql_mvc.h
Branch: Nov2019
Log Message:

Move saved query from client context to mvc.


diffs (173 lines):

diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -266,7 +266,7 @@ MCinitClientRecord(Client c, oid user, b
c->protocol = PROTOCOL_9;
 
c->filetrans = false;
-   c->query = NULL;
+   c->getquery = NULL;
 
char name[16];
snprintf(name, sizeof(name), "Client%d->s", (int) (c - mal_clients));
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -181,7 +181,7 @@ typedef struct CLIENT {
size_t blocksize;
protocol_version protocol;
bool filetrans; /* whether the client can read files 
for us */
-   char *query;/* string, identify whatever we're 
working on */
+   const char *(*getquery)(struct CLIENT *);
 } *Client, ClientRec;
 
 mal_export boolMCinit(void);
diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -567,9 +567,11 @@ str runMALsequence(Client cntxt, MalBlkP
/* if still the same, replace lastprint with 
current
 * time and print the query */
if (ATOMIC_CAS(>lastprint, , t)) {
+   const char *q = cntxt->getquery ? 
cntxt->getquery(cntxt) : NULL;
fprintf(stderr, "#%s: query already 
running "LLFMT"s: %.200s\n",
-   cntxt->mythread->name, (lng) 
(time(0) - cntxt->lastcmd),
-   cntxt->query);
+   cntxt->mythread->name,
+   (lng) (time(0) - 
cntxt->lastcmd),
+   q ? q : "");
}
}
}
diff --git a/sql/backends/monet5/sql_execute.c 
b/sql/backends/monet5/sql_execute.c
--- a/sql/backends/monet5/sql_execute.c
+++ b/sql/backends/monet5/sql_execute.c
@@ -296,7 +296,7 @@ SQLrun(Client c, backend *be, mvc *m)
}
if (m->emode == m_execute && be->q->paramlen != m->argc)
throw(SQL, "sql.prepare", SQLSTATE(42000) "EXEC called with 
wrong number of arguments: expected %d, got %d", be->q->paramlen, m->argc);
-   MT_thread_setworking(c->query);
+   MT_thread_setworking(m->query);
// locate and inline the query template instruction
mb = copyMalBlk(c->curprg->def);
if (!mb) {
@@ -716,8 +716,8 @@ SQLengineIntern(Client c, backend *be)
 
if (oldlang == 'X') {   /* return directly from X-commands */
sqlcleanup(be->mvc, 0);
-   q = c->query;
-   c->query = NULL;
+   q = m->query;
+   m->query = NULL;
GDKfree(q);
return MAL_SUCCEED;
}
@@ -738,8 +738,8 @@ SQLengineIntern(Client c, backend *be)
goto cleanup_engine;
}
sqlcleanup(be->mvc, 0);
-   q = c->query;
-   c->query = NULL;
+   q = m->query;
+   m->query = NULL;
GDKfree(q);
return MAL_SUCCEED;
}
@@ -786,8 +786,8 @@ cleanup_engine:
MSresetInstructions(c->curprg->def, 1);
freeVariables(c, c->curprg->def, NULL, be->vtop);
be->language = oldlang;
-   q = c->query;
-   c->query = NULL;
+   q = m->query;
+   m->query = NULL;
GDKfree(q);
/*
 * Any error encountered during execution should block further 
processing
diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -262,6 +262,20 @@ global_variables(mvc *sql, const char *u
return failure;
 }
 
+static const char *
+SQLgetquery(Client c)
+{
+   if (c) {
+   backend *be = c->sqlcontext;
+   if (be) {
+   mvc *m = be->mvc;
+   if (m)
+   return m->query;
+   }
+   }
+   return NULL;
+}
+
 static char*
 SQLprepareClient(Client c, int login)
 {
@@ -269,6 +283,7 @@ SQLprepareClient(Client c, int login)
str schema;
backend *be;
 

MonetDB: default - Merge with Nov2019

2019-09-24 Thread Pedro Ferreira
Changeset: 25c8518bfb10 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=25c8518bfb10
Modified Files:
sql/test/rename/Tests/All
sql/test/subquery/Tests/subquery2.sql
Branch: default
Log Message:

Merge with Nov2019


diffs (72 lines):

diff --git a/sql/test/rename/Tests/All b/sql/test/rename/Tests/All
--- a/sql/test/rename/Tests/All
+++ b/sql/test/rename/Tests/All
@@ -9,4 +9,4 @@ rename07
 rename08
 rename09
 rename10
-rename11
+HAVE_PYMONETDB?rename11
diff --git a/sql/test/subquery/Tests/subquery2.sql 
b/sql/test/subquery/Tests/subquery2.sql
--- a/sql/test/subquery/Tests/subquery2.sql
+++ b/sql/test/subquery/Tests/subquery2.sql
@@ -28,6 +28,7 @@ CREATE TABLE tbl_ProductSales (ColID int
 INSERT INTO tbl_ProductSales VALUES (1,'Game','Mobo Game',200),(2,'Game','PKO 
Game',400),(3,'Fashion','Shirt',500),(4,'Fashion','Shorts',100);
 CREATE TABLE another_T (col1 INT, col2 INT, col3 INT, col4 INT, col5 INT, col6 
INT, col7 INT, col8 INT);
 INSERT INTO another_T VALUES (1,2,3,4,5,6,7,8), (11,22,33,44,55,66,77,88), 
(111,222,333,444,555,666,777,888), (,,,,,,,);
+
 SELECT col1 IN (SELECT ColID + col1 FROM tbl_ProductSales) FROM another_T 
GROUP BY col1; 
-- False
-- False
@@ -132,7 +133,7 @@ GROUP BY col4;
-- False
 
 SELECT
-(SELECT MIN(ColID) FROM tbl_ProductSales INNER JOIN another_T t2 ON 
t1.col5 = t2.col1)
+   (SELECT MIN(ColID) FROM tbl_ProductSales INNER JOIN another_T t2 ON 
t1.col5 = t2.col1)
 FROM another_T t1;
-- NULL
-- NULL
@@ -149,6 +150,18 @@ GROUP BY t1.col1;
-- False
 
 SELECT
+   SUM(t1.col6) NOT IN (SELECT t1.col7),
+   t1.col6 NOT IN (SELECT t1.col7),
+   t1.col6 IN (SELECT SUM(t1.col7)),
+   t1.col6 IN (SELECT SUM(t1.col7) FROM tbl_ProductSales)
+FROM another_T t1
+GROUP BY t1.col6, t1.col7;
+   -- True True False False
+   -- True True False False
+   -- True True False False
+   -- True True False False
+
+SELECT
(SELECT MAX(col6) FROM tbl_ProductSales) IN (SELECT MIN(col3) FROM 
another_T)
 FROM another_T
 GROUP BY col1; --error, subquery returns more than 1 row
@@ -191,12 +204,12 @@ FROM another_T t1;
-- 1
 
 SELECT
-CASE WHEN 1 IN (SELECT (SELECT MAX(col7)) UNION ALL (SELECT MIN(ColID) 
FROM tbl_ProductSales INNER JOIN another_T t2 ON t2.col5 = t2.col1)) THEN 2 
ELSE NULL END
+   CASE WHEN 1 IN (SELECT (SELECT MAX(col7)) UNION ALL (SELECT MIN(ColID) 
FROM tbl_ProductSales INNER JOIN another_T t2 ON t2.col5 = t2.col1)) THEN 2 
ELSE NULL END
 FROM another_T t1; 
-- NULL
 
 SELECT
-CASE WHEN NOT col1 NOT IN (SELECT (SELECT MAX(col7)) UNION (SELECT 
MIN(ColID) FROM tbl_ProductSales LEFT JOIN another_T t2 ON t2.col5 = t1.col1)) 
THEN 1 ELSE 2 END
+   CASE WHEN NOT col1 NOT IN (SELECT (SELECT MAX(col7)) UNION (SELECT 
MIN(ColID) FROM tbl_ProductSales LEFT JOIN another_T t2 ON t2.col5 = t1.col1)) 
THEN 1 ELSE 2 END
 FROM another_T t1
 GROUP BY col1;
-- 1
@@ -205,7 +218,7 @@ GROUP BY col1;
-- 2
 
 SELECT
-t1.col1 IN (SELECT ColID FROM tbl_ProductSales GROUP BY t1.col1, 
tbl_ProductSales.ColID)
+   t1.col1 IN (SELECT ColID FROM tbl_ProductSales GROUP BY t1.col1, 
tbl_ProductSales.ColID)
 FROM another_T t1
 GROUP BY col1;
-- True
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - Merge with Apr2019 branch

2019-09-24 Thread Pedro Ferreira
Changeset: 83ad3c922c85 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=83ad3c922c85
Modified Files:
sql/test/rename/Tests/All
Branch: Nov2019
Log Message:

Merge with Apr2019 branch


diffs (9 lines):

diff --git a/sql/test/rename/Tests/All b/sql/test/rename/Tests/All
--- a/sql/test/rename/Tests/All
+++ b/sql/test/rename/Tests/All
@@ -9,4 +9,4 @@ rename07
 rename08
 rename09
 rename10
-rename11
+HAVE_PYMONETDB?rename11
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: grouping-analytics - Updated failing queries

2019-09-24 Thread Pedro Ferreira
Changeset: 4d05e38dc37d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4d05e38dc37d
Modified Files:
sql/test/analytics/Tests/analytics13.sql
Branch: grouping-analytics
Log Message:

Updated failing queries


diffs (21 lines):

diff --git a/sql/test/analytics/Tests/analytics13.sql 
b/sql/test/analytics/Tests/analytics13.sql
--- a/sql/test/analytics/Tests/analytics13.sql
+++ b/sql/test/analytics/Tests/analytics13.sql
@@ -51,6 +51,8 @@ FROM another_T t1
 GROUP BY CUBE(t1.col1, t1.col2);
 
 SELECT
+NOT GROUPING(t1.col6) IN (SELECT SUM(t1.col6) FROM tbl_ProductSales tp 
HAVING MAX(t1.col1) > MIN(tp.colID)),
+GROUPING(t1.col6) IN (SELECT SUM(t1.col7) HAVING GROUPING(t1.col7) < 
SUM(t1.col4)),
 GROUPING(t1.col6) = ALL (SELECT 1),
 GROUPING(t1.col6) = ALL (SELECT SUM(t1.col7)),
 SUM(t1.col6) = ALL (SELECT GROUPING(t1.col7)),
@@ -61,6 +63,8 @@ GROUP BY CUBE(t1.col6, t1.col7);
 
 SELECT
 DISTINCT
+NOT GROUPING(t1.col6) IN (SELECT SUM(t1.col6) FROM tbl_ProductSales tp 
HAVING MAX(t1.col1) > MIN(tp.colID)),
+GROUPING(t1.col6) IN (SELECT SUM(t1.col7) HAVING GROUPING(t1.col7) < 
SUM(t1.col4)),
 GROUPING(t1.col6) = ALL (SELECT 1),
 GROUPING(t1.col6) = ALL (SELECT SUM(t1.col7)),
 SUM(t1.col6) = ALL (SELECT GROUPING(t1.col7)),
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Apr2019 - Test rename11 requires pymonetdb

2019-09-24 Thread Pedro Ferreira
Changeset: d681a6c6b232 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d681a6c6b232
Modified Files:
sql/test/rename/Tests/All
Branch: Apr2019
Log Message:

Test rename11 requires pymonetdb


diffs (9 lines):

diff --git a/sql/test/rename/Tests/All b/sql/test/rename/Tests/All
--- a/sql/test/rename/Tests/All
+++ b/sql/test/rename/Tests/All
@@ -9,4 +9,4 @@ rename07
 rename08
 rename09
 rename10
-rename11
+HAVE_PYMONETDB?rename11
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Nov2019 - One more correlated subquery crashing :(

2019-09-24 Thread Pedro Ferreira
Changeset: 0a60a665ffbd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0a60a665ffbd
Modified Files:
sql/test/subquery/Tests/subquery2.sql
Branch: Nov2019
Log Message:

One more correlated subquery crashing :(


diffs (63 lines):

diff --git a/sql/test/subquery/Tests/subquery2.sql 
b/sql/test/subquery/Tests/subquery2.sql
--- a/sql/test/subquery/Tests/subquery2.sql
+++ b/sql/test/subquery/Tests/subquery2.sql
@@ -28,6 +28,7 @@ CREATE TABLE tbl_ProductSales (ColID int
 INSERT INTO tbl_ProductSales VALUES (1,'Game','Mobo Game',200),(2,'Game','PKO 
Game',400),(3,'Fashion','Shirt',500),(4,'Fashion','Shorts',100);
 CREATE TABLE another_T (col1 INT, col2 INT, col3 INT, col4 INT, col5 INT, col6 
INT, col7 INT, col8 INT);
 INSERT INTO another_T VALUES (1,2,3,4,5,6,7,8), (11,22,33,44,55,66,77,88), 
(111,222,333,444,555,666,777,888), (,,,,,,,);
+
 SELECT col1 IN (SELECT ColID + col1 FROM tbl_ProductSales) FROM another_T 
GROUP BY col1; 
-- False
-- False
@@ -132,7 +133,7 @@ GROUP BY col4;
-- False
 
 SELECT
-(SELECT MIN(ColID) FROM tbl_ProductSales INNER JOIN another_T t2 ON 
t1.col5 = t2.col1)
+   (SELECT MIN(ColID) FROM tbl_ProductSales INNER JOIN another_T t2 ON 
t1.col5 = t2.col1)
 FROM another_T t1;
-- NULL
-- NULL
@@ -149,6 +150,18 @@ GROUP BY t1.col1;
-- False
 
 SELECT
+   SUM(t1.col6) NOT IN (SELECT t1.col7),
+   t1.col6 NOT IN (SELECT t1.col7),
+   t1.col6 IN (SELECT SUM(t1.col7)),
+   t1.col6 IN (SELECT SUM(t1.col7) FROM tbl_ProductSales)
+FROM another_T t1
+GROUP BY t1.col6, t1.col7;
+   -- True True False False
+   -- True True False False
+   -- True True False False
+   -- True True False False
+
+SELECT
(SELECT MAX(col6) FROM tbl_ProductSales) IN (SELECT MIN(col3) FROM 
another_T)
 FROM another_T
 GROUP BY col1; --error, subquery returns more than 1 row
@@ -191,12 +204,12 @@ FROM another_T t1;
-- 1
 
 SELECT
-CASE WHEN 1 IN (SELECT (SELECT MAX(col7)) UNION ALL (SELECT MIN(ColID) 
FROM tbl_ProductSales INNER JOIN another_T t2 ON t2.col5 = t2.col1)) THEN 2 
ELSE NULL END
+   CASE WHEN 1 IN (SELECT (SELECT MAX(col7)) UNION ALL (SELECT MIN(ColID) 
FROM tbl_ProductSales INNER JOIN another_T t2 ON t2.col5 = t2.col1)) THEN 2 
ELSE NULL END
 FROM another_T t1; 
-- NULL
 
 SELECT
-CASE WHEN NOT col1 NOT IN (SELECT (SELECT MAX(col7)) UNION (SELECT 
MIN(ColID) FROM tbl_ProductSales LEFT JOIN another_T t2 ON t2.col5 = t1.col1)) 
THEN 1 ELSE 2 END
+   CASE WHEN NOT col1 NOT IN (SELECT (SELECT MAX(col7)) UNION (SELECT 
MIN(ColID) FROM tbl_ProductSales LEFT JOIN another_T t2 ON t2.col5 = t1.col1)) 
THEN 1 ELSE 2 END
 FROM another_T t1
 GROUP BY col1;
-- 1
@@ -205,7 +218,7 @@ GROUP BY col1;
-- 2
 
 SELECT
-t1.col1 IN (SELECT ColID FROM tbl_ProductSales GROUP BY t1.col1, 
tbl_ProductSales.ColID)
+   t1.col1 IN (SELECT ColID FROM tbl_ProductSales GROUP BY t1.col1, 
tbl_ProductSales.ColID)
 FROM another_T t1
 GROUP BY col1;
-- True
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: grouping-analytics - Allow grouping aggregate in every ...

2019-09-24 Thread Pedro Ferreira
Changeset: 9edd96f632bb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9edd96f632bb
Added Files:
sql/test/analytics/Tests/analytics13.sql
Modified Files:
sql/server/rel_groupings.c
sql/server/rel_select.c
sql/test/analytics/Tests/All
sql/test/analytics/Tests/analytics11.sql
sql/test/analytics/Tests/analytics11.stable.err
sql/test/analytics/Tests/analytics11.stable.out
Branch: grouping-analytics
Log Message:

Allow grouping aggregate in every group by query and cleaned tests


diffs (truncated from 612 to 300 lines):

diff --git a/sql/server/rel_groupings.c b/sql/server/rel_groupings.c
--- a/sql/server/rel_groupings.c
+++ b/sql/server/rel_groupings.c
@@ -72,10 +72,11 @@ rel_generate_groupings(mvc *sql, sql_rel
 
for (node *m = rel->exps->h ; m ; m = 
m->next) {
sql_exp *e = (sql_exp*) 
m->data, *ne = NULL;
+   sql_subaggr *agr = 
(sql_subaggr*) e->f;
 
-   if (e->type == e_aggr && 
!strcmp(((sql_subaggr*) e->f)->aggr->base.name, "grouping")) {
+   if (e->type == e_aggr && 
!agr->aggr->s && !strcmp(agr->aggr->base.name, "grouping")) {
/* replace grouping 
aggregate calls with constants */
-   sql_subtype tpe = 
((sql_arg*) ((sql_subaggr*) e->f)->aggr->res->h->data)->type;
+   sql_subtype tpe = 
((sql_arg*) agr->aggr->res->h->data)->type;
list *groups = (list*) 
e->l;
atom *a = 
atom_int(sql->sa, , 0);
 #ifdef HAVE_HGE
@@ -140,6 +141,39 @@ rel_generate_groupings(mvc *sql, sql_rel
return unions;
}
return unions;
+   } else {
+   bool found_grouping = false;
+   for (node *n = rel->exps->h ; n ; n = n->next) {
+   sql_exp *e = (sql_exp*) n->data;
+   sql_subaggr *agr = (sql_subaggr*) e->f;
+
+   if (e->type == e_aggr && !agr->aggr->s 
&& !strcmp(agr->aggr->base.name, "grouping")) {
+   found_grouping = true;
+   break;
+   }
+   }
+   if (found_grouping) {
+   /* replace grouping calls with 
constants of value 0 */
+   sql_rel *nrel = rel_groupby(sql, 
rel->l, rel->r);
+   list *exps = sa_list(sql->sa), *pexps = 
sa_list(sql->sa);
+   sql_subtype *bt = 
sql_bind_localtype("bte");
+
+   for (node *n = rel->exps->h ; n ; n = 
n->next) {
+   sql_exp *e = (sql_exp*) 
n->data, *ne;
+   sql_subaggr *agr = 
(sql_subaggr*) e->f;
+
+   if (e->type == e_aggr && 
!agr->aggr->s && !strcmp(agr->aggr->base.name, "grouping")) {
+   ne = exp_atom(sql->sa, 
atom_int(sql->sa, bt, 0));
+   exp_setname(sql->sa, 
ne, e->alias.rname, e->alias.name);
+   } else {
+   ne = exp_ref(sql->sa, 
e);
+   append(exps, e);
+   }
+   append(pexps, ne);
+   }
+   nrel->exps = exps;
+   return rel_project(sql->sa, nrel, 
pexps);
+   }
}
} break;
}
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
@@ -4016,8 +4016,7 @@ static sql_exp *
if (uaname)
GDKfree(uaname);
return e;
-   } else if (is_grouping && !is_sql_group_totals(f))
-   return sql_error(sql, 02, SQLSTATE(42000) "GROUPING aggregate 
function requires ROLLUP, CUBE or GROUPING SETS clauses in GROUP BY");
+   }
 
if (groupby->op != op_groupby) {/* implicit groupby */

MonetDB: mosaic - Update TODO's.

2019-09-24 Thread Aris Koning
Changeset: 6ac5952288da for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6ac5952288da
Modified Files:
monetdb5/modules/mosaic/TODO_MOSAIC.txt
Branch: mosaic
Log Message:

Update TODO's.


diffs (11 lines):

diff --git a/monetdb5/modules/mosaic/TODO_MOSAIC.txt 
b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
--- a/monetdb5/modules/mosaic/TODO_MOSAIC.txt
+++ b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
@@ -16,6 +16,7 @@ Fix/check/test MOSlayout.
 benchmark
 
 code issues
+Update copyright.
 move mask, bits, framebits from  MosaicHdr to MosaicBlkHeader_frame_t.
 mosaic_prefix.c: prefix code does not use macro's
 mosaic_delta.c: improve the macro's: for instance get rid of hardcoded 
expression arguments in DELTAcompress. (2*)
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: mosaic - Compilation and memory leak fixes.

2019-09-24 Thread Aris Koning
Changeset: fd11937d96ba for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fd11937d96ba
Modified Files:
gdk/gdk_mosaic.c
Branch: mosaic
Log Message:

Compilation and memory leak fixes.


diffs (25 lines):

diff --git a/gdk/gdk_mosaic.c b/gdk/gdk_mosaic.c
--- a/gdk/gdk_mosaic.c
+++ b/gdk/gdk_mosaic.c
@@ -81,9 +81,18 @@ BATmosaic(BAT *bn, BUN cap)
GDKfree(fname);
GDKfree(m);
return GDK_FAIL;
-   }
-   strncpy((char*) m->filename, fname, sizeof(m->filename));
-   
+   }
+
+   if (strlen(fname) >= sizeof(m->filename)) {
+   // TODO: check if this can actually happen.
+   GDKfree(fname);
+   GDKfree(m);
+   return GDK_FAIL;
+   }
+
+   strncpy(m->filename, fname, strlen(fname));
+   GDKfree(fname);
+
 if( HEAPalloc(m, cap, Tsize(bn)) != GDK_SUCCEED){
 return GDK_FAIL;
}
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: mosaic - Update TODO's.

2019-09-24 Thread Aris Koning
Changeset: 58a5d3dc8685 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=58a5d3dc8685
Modified Files:
monetdb5/modules/mosaic/TODO_MOSAIC.txt
Branch: mosaic
Log Message:

Update TODO's.


diffs (30 lines):

diff --git a/monetdb5/modules/mosaic/TODO_MOSAIC.txt 
b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
--- a/monetdb5/modules/mosaic/TODO_MOSAIC.txt
+++ b/monetdb5/modules/mosaic/TODO_MOSAIC.txt
@@ -1,20 +1,22 @@
 technical depth
-Make dictionary variable-sized so it can always compress.
-Add asserts for unknown compression strategies. (1)
+Make dictionary variable-sized so it can always compress. We are going to use 
vheap for this.
+dictionary encoding should use the ordered property of its dictionary in the 
algebraic operators
+decouple estimation completely from compression: there should be two runs: one 
for estimating the blocks and one to actual compress according to the 
estimations.
 Test null semantics
 mosaic.select (c,nil:any_1, nil:any_1,true,true,(true|false)) is not working 
correctly: should result in c == nil or c!=nil(anti).
-dictionary encoding should use the ordered property of its dictionary in the 
algebraic operators
 Use bit vectors more aggressively in mosaic_delta --- then resolve test 
mosaic_delta_timestamp --- and possibly other compression techniques as well.
 Somehow force mosaic to only use specified compressions even if inefficient. 
This poses a design problem for dictionary compression though.
+fix layout call.
 Add test for float/double
 delta compression: check if the hardcoded compression expression are correct. 
See also (2)
 Add asserts on type degeneration for bit => bte daytime => lng timestmap => 
lng date => int.
-Remove task-factor and range->factor or refactor them.
+Fix the task-factor array.
 See if we can re-introduce landmark stuff somehow.
 Fix/check/test MOSlayout.
 benchmark
 
 code issues
+move mask, bits, framebits from  MosaicHdr to MosaicBlkHeader_frame_t.
 mosaic_prefix.c: prefix code does not use macro's
 mosaic_delta.c: improve the macro's: for instance get rid of hardcoded 
expression arguments in DELTAcompress. (2*)
 mosaic_.c: for type macro's use macro-wised inline functions.
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: batcalc-updated - Typo.

2019-09-24 Thread Sjoerd Mullender
Changeset: c441e1b7d880 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c441e1b7d880
Modified Files:
gdk/gdk_calc_compare.h
Branch: batcalc-updated
Log Message:

Typo.


diffs (12 lines):

diff --git a/gdk/gdk_calc_compare.h b/gdk/gdk_calc_compare.h
--- a/gdk/gdk_calc_compare.h
+++ b/gdk/gdk_calc_compare.h
@@ -31,7 +31,7 @@ op_typeswitchloop(const void *lft, int t
assert(incr1 == 1);
assert(tp2 == TYPE_oid || incr2 == 1); /* if void, incr2==1 */
oid v = lft ? * (const oid *) lft : oid_nil;
-   for (k = 0; j < ci1->ncand; k++) {
+   for (k = 0; k < ci1->ncand; k++) {
TPE res;
x1 = canditer_next(ci1) - candoff1;
x2 = canditer_next(ci2) - candoff2;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: grouping-analytics - Merge with default

2019-09-24 Thread Pedro Ferreira
Changeset: 419492f872a8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=419492f872a8
Added Files:
sql/test/BugTracker-2019/Tests/select-char.Bug-6761.sql
sql/test/BugTracker-2019/Tests/select-char.Bug-6761.stable.err
sql/test/BugTracker-2019/Tests/select-char.Bug-6761.stable.out
Removed Files:
sql/scripts/11_times.sql
Modified Files:
MonetDB.spec
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
clients/mapiclient/stethoscope.c
common/stream/stream.c
common/utils/matomic.h
configure.ag
debian/control
debian/fix-deb.sh
debian/monetdb-testing-python.install
gdk/gdk.h
gdk/gdk_aggr.c
gdk/gdk_align.c
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_calc.h
gdk/gdk_group.c
gdk/gdk_hash.c
gdk/gdk_hash.h
gdk/gdk_imprints.c
gdk/gdk_orderidx.c
gdk/gdk_private.h
gdk/gdk_system.h
gdk/gdk_utils.c
monetdb5/mal/mal_dataflow.c
monetdb5/modules/kernel/aggr.c
monetdb5/modules/kernel/aggr.mal
monetdb5/modules/kernel/aggr.mal.sh
monetdb5/modules/mal/mal_mapi.c
sql/ChangeLog.Nov2019
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_result.h
sql/backends/monet5/sql_upgrades.c
sql/common/sql_list.c
sql/include/sql_catalog.h
sql/include/sql_relation.h
sql/rel.txt
sql/scripts/39_analytics.sql
sql/scripts/39_analytics_hge.sql
sql/scripts/Makefile.ag
sql/server/rel_dump.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimizer.c
sql/server/rel_psm.c
sql/server/rel_rel.c
sql/server/rel_select.c
sql/server/rel_unnest.c
sql/server/rel_updates.c
sql/server/sql_env.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
sql/server/sql_parser.y
sql/server/sql_qc.c
sql/server/sql_qc.h
sql/storage/bat/res_table.c
sql/storage/sql_storage.h
sql/storage/store.c
sql/storage/store_dependency.c

sql/test/BugDay_2005-10-06_2.9.3/Tests/union_limitation.SF-921992.stable.out

sql/test/BugTracker-2009/Tests/insert_into_done_by_procedure.SF-2607293.sql
sql/test/BugTracker-2016/Tests/leftjoin.Bug-3981.stable.out

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
sql/test/BugTracker-2019/Tests/All
sql/test/BugTracker-2019/Tests/double-free.Bug-6757.sql
sql/test/Tests/window_functions.stable.out
sql/test/analytics/Tests/analytics09.stable.err
sql/test/analytics/Tests/analytics09.stable.out
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128

sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.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.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.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/mergetables/Tests/sqlsmith.Bug-6455.stable.out
sql/test/subquery/Tests/any.sql
sql/test/subquery/Tests/any.stable.err
sql/test/subquery/Tests/any.stable.out
sql/test/subquery/Tests/correlated.stable.err
sql/test/subquery/Tests/correlated.stable.out
sql/test/subquery/Tests/subquery.sql
sql/test/subquery/Tests/subquery.stable.err
sql/test/subquery/Tests/subquery2.sql

sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.stable.out
sql/test/sys-schema/Tests/check_MaxStrLength_violations.stable.out
sql/test/sys-schema/Tests/systemfunctions.stable.out
sql/test/sys-schema/Tests/systemfunctions.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
 

MonetDB: grouping-analytics - When generating CUBE's power sets,...

2019-09-24 Thread Pedro Ferreira
Changeset: f2f19490d278 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f2f19490d278
Modified Files:
sql/server/rel_select.c
sql/test/analytics/Tests/analytics10.stable.out
sql/test/analytics/Tests/analytics11.sql
sql/test/analytics/Tests/analytics11.stable.err
sql/test/analytics/Tests/analytics11.stable.out
sql/test/analytics/Tests/analytics12.stable.out
Branch: grouping-analytics
Log Message:

When generating CUBE's power sets, prepend to the generated list, so the global 
aggregate case will be always last.


diffs (truncated from 458 to 300 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -4529,10 +4529,10 @@ list_power_set(sql_allocator *sa, list* 
for (node *n = input->h ; n ; n = n->next) {
/* if j'th bit of i is set, then append */
if (i & (1 << j))
-   list_append(ll, n->data);
+   list_prepend(ll, n->data);
j++;
}
-   list_append(res, ll);
+   list_prepend(res, ll);
}
return res;
 }
diff --git a/sql/test/analytics/Tests/analytics10.stable.out 
b/sql/test/analytics/Tests/analytics10.stable.out
--- a/sql/test/analytics/Tests/analytics10.stable.out
+++ b/sql/test/analytics/Tests/analytics10.stable.out
@@ -152,9 +152,9 @@ stdout of test 'analytics10` in director
 % product_category,totalsales # name
 % varchar, bigint # type
 % 7,   4 # length
-[ NULL,1200]
 [ "Game",  600 ]
 [ "Fashion",   600 ]
+[ NULL,1200]
 #SELECT
 #Product_Name, CAST(SUM(TotalSales) as BIGINT) AS TotalSales
 #FROM tbl_ProductSales
@@ -163,11 +163,11 @@ stdout of test 'analytics10` in director
 % product_name,totalsales # name
 % varchar, bigint # type
 % 9,   4 # length
-[ NULL,1200]
 [ "Mobo Game", 200 ]
 [ "PKO Game",  400 ]
 [ "Shirt", 500 ]
 [ "Shorts",100 ]
+[ NULL,1200]
 #SELECT
 #Product_Category, Product_Name, CAST(SUM(TotalSales) as BIGINT) AS 
TotalSales
 #FROM tbl_ProductSales
@@ -176,17 +176,17 @@ stdout of test 'analytics10` in director
 % product_category,product_name,   totalsales # name
 % varchar, varchar,bigint # type
 % 7,   9,  4 # length
-[ NULL,NULL,   1200]
-[ "Game",  NULL,   600 ]
-[ "Fashion",   NULL,   600 ]
+[ "Game",  "Mobo Game",200 ]
+[ "Game",  "PKO Game", 400 ]
+[ "Fashion",   "Shirt",500 ]
+[ "Fashion",   "Shorts",   100 ]
 [ NULL,"Mobo Game",200 ]
 [ NULL,"PKO Game", 400 ]
 [ NULL,"Shirt",500 ]
 [ NULL,"Shorts",   100 ]
-[ "Game",  "Mobo Game",200 ]
-[ "Game",  "PKO Game", 400 ]
-[ "Fashion",   "Shirt",500 ]
-[ "Fashion",   "Shorts",   100 ]
+[ "Game",  NULL,   600 ]
+[ "Fashion",   NULL,   600 ]
+[ NULL,NULL,   1200]
 #SELECT
 #Product_Category, Product_Name, CAST(SUM(TotalSales) as BIGINT) AS 
TotalSales
 #FROM tbl_ProductSales
@@ -254,23 +254,26 @@ stdout of test 'analytics10` in director
 % product_category,product_name,   totalsales # name
 % varchar, varchar,bigint # type
 % 7,   9,  3 # length
-[ NULL,NULL,   200 ]
-[ NULL,NULL,   400 ]
-[ NULL,NULL,   500 ]
-[ NULL,NULL,   100 ]
+[ "Game",  "Mobo Game",200 ]
+[ "Game",  "PKO Game", 400 ]
+[ "Fashion",   "Shirt",500 ]
+[ "Fashion",   "Shorts",   100 ]
+[ NULL,"Mobo Game",200 ]
+[ NULL,"PKO Game", 400 ]
+[ NULL,"Shirt",500 ]
+[ NULL,"Shorts",   100 ]
 [ "Game",  NULL,   200 ]
 [ "Game",  NULL,   400 ]
 [ "Fashion",   NULL,   500 ]
 [ "Fashion",   NULL,   100 ]
-[ NULL,"Mobo Game",200 ]
-[ NULL,"PKO Game", 400 ]
-[ NULL,"Shirt",500 ]
-[ NULL,"Shorts",   100 ]
-[ "Game",  "Mobo Game",200 ]
-[ "Game",  "PKO Game", 400 ]
-[ "Fashion",   "Shirt",500 ]
-[ "Fashion",   "Shorts",   100 ]
-#SELECT Product_Category, CAST(SUM(TotalSales) as BIGINT) AS TotalSales FROM 
tbl_ProductSales GROUP BY ROLLUP(Product_Category), ROLLUP(Product_Category);
+[ NULL,NULL,   200 ]
+[ NULL,NULL,   400 ]
+[ NULL,NULL,   500 ]
+[ NULL,NULL,   100 ]
+#SELECT 
+#Product_Category, CAST(SUM(TotalSales) as BIGINT) AS TotalSales
+#FROM tbl_ProductSales
+#GROUP BY ROLLUP(Product_Category), ROLLUP(Product_Category);
 % .tbl_productsales,   .L3 # table_name
 % product_category,totalsales # name
 % varchar, bigint # type

MonetDB: batcalc-updated - Merge with default branch.

2019-09-24 Thread Sjoerd Mullender
Changeset: 8280c7909cbb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8280c7909cbb
Removed Files:
sql/scripts/11_times.sql
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
gdk/gdk_aggr.c
gdk/gdk_calc.h
gdk/gdk_group.c
monetdb5/modules/kernel/aggr.c
monetdb5/modules/kernel/aggr.mal
monetdb5/modules/kernel/aggr.mal.sh
sql/ChangeLog.Nov2019
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/backends/monet5/sql_upgrades.c
sql/common/sql_list.c
sql/include/sql_relation.h
sql/scripts/39_analytics.sql
sql/scripts/39_analytics_hge.sql
sql/scripts/Makefile.ag
sql/server/rel_dump.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/rel_optimizer.c
sql/server/rel_rel.c
sql/server/rel_select.c
sql/server/rel_unnest.c
sql/server/rel_updates.c

sql/test/BugDay_2005-10-06_2.9.3/Tests/union_limitation.SF-921992.stable.out
sql/test/BugTracker-2016/Tests/leftjoin.Bug-3981.stable.out

sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.stable.out
sql/test/Tests/window_functions.stable.out
sql/test/analytics/Tests/analytics09.stable.err
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128

sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.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.powerpc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.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/mergetables/Tests/sqlsmith.Bug-6455.stable.out
sql/test/subquery/Tests/subquery2.sql

sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.stable.out
sql/test/sys-schema/Tests/check_MaxStrLength_violations.stable.out
sql/test/sys-schema/Tests/systemfunctions.stable.out
sql/test/sys-schema/Tests/systemfunctions.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: batcalc-updated
Log Message:

Merge with default branch.


diffs (truncated from 4129 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -124,6 +124,7 @@ stdout of test 'MAL-signatures` in direc
 [ "aggr",  "max",  "command aggr.max(b:bat[:any_2]):any_2 ",   
"ALGmaxany;",   "Return the highest tail value or nil." ]
 [ "aggr",  "max",  "command aggr.max(b:bat[:any_2], skipnil:bit):any_2 ",  
"ALGmaxany_skipnil;",   "Return the highest tail value or nil." ]
 [ "aggr",  "median",   "command aggr.median(b:bat[:any_1]):any_1 ",
"AGGRmedian;",  "Median aggregate"  ]
+[ "aggr",  "median_avg",   "command aggr.median_avg(b:bat[:any_1]):dbl ",  
"AGGRmedian_avg;",  "Median aggregate"  ]
 [ "aggr",  "min",  "command aggr.min(b:bat[:any_1], g:bat[:oid], 
e:bat[:any_2]):bat[:any_1] ", "AGGRmin3;",""  ]
 [ "aggr",  "min",  "command aggr.min(b:bat[:any_2]):any_2 ",   
"ALGminany;",   "Return the lowest tail value or nil."  ]
 [ "aggr",  "min",  "command aggr.min(b:bat[:any_2], skipnil:bit):any_2 ",  
"ALGminany_skipnil;",   "Return the lowest tail value or nil."  ]
@@ -209,6 +210,7 @@ stdout of test 'MAL-signatures` in direc
 [ "aggr",  "prod", "pattern aggr.prod(b:bat[:sht], s:bat[:oid], 
nil_if_empty:bit):lng ",   "CMDBATprod;",  "Calculate aggregate product of B 
with candidate list." ]
 [ "aggr",  "prod", "pattern 

MonetDB: batcalc-updated - Use bool.

2019-09-24 Thread Sjoerd Mullender
Changeset: 3a061c6e553c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3a061c6e553c
Modified Files:
gdk/gdk_calc.c
Branch: batcalc-updated
Log Message:

Use bool.


diffs (67 lines):

diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -819,7 +819,7 @@ VARcalcsign(ValPtr ret, const ValRecord 
} while (0)
 
 static BAT *
-BATcalcisnil_implementation(BAT *b, BAT *s, int notnil)
+BATcalcisnil_implementation(BAT *b, BAT *s, bool notnil)
 {
BAT *bn;
BUN i, ncand;
@@ -903,13 +903,13 @@ BATcalcisnil_implementation(BAT *b, BAT 
 BAT *
 BATcalcisnil(BAT *b, BAT *s)
 {
-   return BATcalcisnil_implementation(b, s, 0);
+   return BATcalcisnil_implementation(b, s, false);
 }
 
 BAT *
 BATcalcisnotnil(BAT *b, BAT *s)
 {
-   return BATcalcisnil_implementation(b, s, 1);
+   return BATcalcisnil_implementation(b, s, true);
 }
 
 gdk_return
@@ -10433,7 +10433,7 @@ xor_typeswitchloop(const void *lft, int 
   struct canditer *restrict ci1,
   struct canditer *restrict ci2,
   oid candoff1, oid candoff2,
-  int nonil, const char *func)
+  bool nonil, const char *func)
 {
oid x1, x2;
BUN i, j, k;
@@ -10627,7 +10627,7 @@ or_typeswitchloop(const void *lft, int i
  struct canditer *restrict ci1,
  struct canditer *restrict ci2,
  oid candoff1, oid candoff2,
- int nonil, const char *func)
+ bool nonil, const char *func)
 {
oid x1, x2;
BUN i, j, k;
@@ -10827,7 +10827,7 @@ and_typeswitchloop(const void *lft, int 
   struct canditer *restrict ci1,
   struct canditer *restrict ci2,
   oid candoff1, oid candoff2,
-  int nonil, const char *func)
+  bool nonil, const char *func)
 {
oid x1, x2;
BUN i, j, k;
@@ -12270,9 +12270,9 @@ VARcalcbetween(ValPtr ret, const ValReco
 static BAT *
 BATcalcifthenelse_intern(BAT *b,
 const void *col1, int incr1, const char *heap1,
-int width1, int nonil1, oid seq1,
+int width1, bool nonil1, oid seq1,
 const void *col2, int incr2, const char *heap2,
-int width2, int nonil2, oid seq2,
+int width2, bool nonil2, oid seq2,
 int tpe)
 {
BAT *bn;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: batcalc-updated - The gdk_calc operations on more than ...

2019-09-24 Thread Sjoerd Mullender
Changeset: e2de1b3fa5e0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e2de1b3fa5e0
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/exports.stable.out
gdk/gdk_calc.c
gdk/gdk_calc.h
gdk/gdk_calc_compare.h
monetdb5/modules/mal/00_batcalc_hge.mal
monetdb5/modules/mal/00_batcalc_hge.mal.sh
monetdb5/modules/mal/01_batcalc.mal
monetdb5/modules/mal/01_batcalc.mal.sh
monetdb5/modules/mal/batcalc.c
Branch: batcalc-updated
Log Message:

The gdk_calc operations on more than one BAT now have a candidate list per 
argument BAT.


diffs (truncated from 29537 to 300 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -2170,7 +2170,7 @@ stdout of test 'MAL-signatures` in direc
 [ "batcalc",   "*","pattern batcalc.*(v:sht, b:bat[:sht]):bat[:sht] ", 
"CMDbatMULsignal;", "Return V * B, signal error on overflow"]
 [ "batcalc",   "*","pattern batcalc.*(v:sht, b:bat[:sht], 
s:bat[:oid]):bat[:sht] ","CMDbatMULsignal;", "Return V * B with 
candidates list, signal error on overflow"   ]
 [ "batcalc",   "+","pattern batcalc.+(b1:bat[:str], 
b2:bat[:str]):bat[:str] ", "CMDbatADD;",   "Return concatenation of B1 and 
B2" ]
-[ "batcalc",   "+","pattern batcalc.+(b1:bat[:str], b2:bat[:str], 
s:bat[:oid]):bat[:str] ","CMDbatADD;",   "Return concatenation of B1 
and B2 with candidates list"]
+[ "batcalc",   "+","pattern batcalc.+(b1:bat[:str], b2:bat[:str], 
s1:bat[:oid], s2:bat[:oid]):bat[:str] ", "CMDbatADD;",   "Return concatenation 
of B1 and B2 with candidates list"]
 [ "batcalc",   "+","pattern batcalc.+(b:bat[:str], v:str):bat[:str] ", 
"CMDbatADD;",   "Return concatenation of B and V"   ]
 [ "batcalc",   "+","pattern batcalc.+(b:bat[:str], v:str, 
s:bat[:oid]):bat[:str] ","CMDbatADD;",   "Return concatenation of B and 
V with candidates list"  ]
 [ "batcalc",   "+","pattern batcalc.+(v:str, b:bat[:str]):bat[:str] ", 
"CMDbatADD;",   "Return concatenation of V and B"   ]
@@ -6119,11 +6119,11 @@ stdout of test 'MAL-signatures` in direc
 [ "batcalc",   "avg",  "pattern batcalc.avg(b:bat[:sht], scale:int):dbl ", 
"CMDcalcavg;",  "average of non-nil values of B with candidates list"   ]
 [ "batcalc",   "between",  "pattern batcalc.between(b:bat[:any_1], 
v1:any_1, v2:any_1, s:bat[:oid], sym:bit, linc:bit, hinc:bit, nils_false:bit, 
anti:bit):bat[:bit] ","CMDbatBETWEEN;",   "B between V1 and V2 (or vice 
versa) with candidate list"   ]
 [ "batcalc",   "between",  "pattern batcalc.between(b:bat[:any_1], 
v1:any_1, v2:any_1, sym:bit, linc:bit, hinc:bit, nils_false:bit, 
anti:bit):bat[:bit] ", "CMDbatBETWEEN;",   "B between V1 and V2 (or vice 
versa)"   ]
-[ "batcalc",   "between",  "pattern batcalc.between(b:bat[:any_1], 
v1:any_1, v2:bat[:any_1], s:bat[:oid], sym:bit, linc:bit, hinc:bit, 
nils_false:bit, anti:bit):bat[:bit] ",  "CMDbatBETWEEN;",   "B between 
V1 and V2 (or vice versa) with candidate list"   ]
+[ "batcalc",   "between",  "pattern batcalc.between(b:bat[:any_1], 
v1:any_1, v2:bat[:any_1], s:bat[:oid], s2:bat[:oid], sym:bit, linc:bit, 
hinc:bit, nils_false:bit, anti:bit):bat[:bit] ","CMDbatBETWEEN;",   
"B between V1 and V2 (or vice versa) with candidate list"   ]
 [ "batcalc",   "between",  "pattern batcalc.between(b:bat[:any_1], 
v1:any_1, v2:bat[:any_1], sym:bit, linc:bit, hinc:bit, nils_false:bit, 
anti:bit):bat[:bit] ",   "CMDbatBETWEEN;",   "B between V1 and V2 (or vice 
versa)"   ]
-[ "batcalc",   "between",  "pattern batcalc.between(b:bat[:any_1], 
v1:bat[:any_1], v2:any_1, s:bat[:oid], sym:bit, linc:bit, hinc:bit, 
nils_false:bit, anti:bit):bat[:bit] ",  "CMDbatBETWEEN;",   "B between 
V1 and V2 (or vice versa) with candidate list"   ]
+[ "batcalc",   "between",  "pattern batcalc.between(b:bat[:any_1], 
v1:bat[:any_1], v2:any_1, s:bat[:oid], s1:bat[:oid], sym:bit, linc:bit, 
hinc:bit, nils_false:bit, anti:bit):bat[:bit] ","CMDbatBETWEEN;",   
"B between V1 and V2 (or vice versa) with candidate list"   ]
 [ "batcalc",   "between",  "pattern batcalc.between(b:bat[:any_1], 
v1:bat[:any_1], v2:any_1, sym:bit, linc:bit, hinc:bit, nils_false:bit, 
anti:bit):bat[:bit] ",   "CMDbatBETWEEN;",   "B between V1 and V2 (or vice 
versa)"   ]
-[ "batcalc",   "between",  "pattern batcalc.between(b:bat[:any_1], 
v1:bat[:any_1], v2:bat[:any_1], s:bat[:oid], sym:bit, linc:bit, hinc:bit, 
nils_false:bit, anti:bit):bat[:bit] ","CMDbatBETWEEN;",   "B 
between V1 and V2 (or vice versa) with candidate list"   ]
+[ "batcalc",   "between",  "pattern 

MonetDB: batcalc-updated - Updated batcalc API so that the resul...

2019-09-24 Thread Sjoerd Mullender
Changeset: e7b279070b7d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e7b279070b7d
Modified Files:
gdk/gdk_calc.c
gdk/gdk_calc_compare.h
gdk/gdk_cand.c
gdk/gdk_cand.h
Branch: batcalc-updated
Log Message:

Updated batcalc API so that the result is aligned with the candidate list.


diffs (truncated from 11318 to 300 lines):

diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -80,38 +80,21 @@ checkbats(BAT *b1, BAT *b2, const char *
do {\
const TYPE1 *restrict src = (const TYPE1 *) Tloc(b, 0); \
TYPE2 *restrict dst = (TYPE2 *) Tloc(bn, 0);\
-   x = canditer_next() - b->hseqbase;   \
-   i = 0;  \
-   do {\
-   while (i < x) { \
-   dst[i++] = TYPE2##_nil; \
-   nils++; \
-   }   \
-   if (is_##TYPE1##_nil(src[i])) { \
+   for (i = 0; i < ci.ncand; i++) {\
+   x = canditer_next() - b->hseqbase;   \
+   if (is_##TYPE1##_nil(src[x])) { \
nils++; \
dst[i] = TYPE2##_nil;   \
} else {\
-   dst[i] = FUNC(src[i]);  \
+   dst[i] = FUNC(src[x]);  \
}   \
-   i++;\
-   x = canditer_next(); \
-   if (is_oid_nil(x))  \
-   break;  \
-   x -= b->hseqbase;   \
-   } while (i < cnt);  \
-   while (i < cnt) {   \
-   dst[i++] = TYPE2##_nil; \
-   nils++; \
}   \
} while (0)
 
 #define BINARY_3TYPE_FUNC(TYPE1, TYPE2, TYPE3, FUNC)   \
do {\
-   do {\
-   while (k < x) { \
-   ((TYPE3 *) dst)[k++] = TYPE3##_nil; \
-   nils++; \
-   }   \
+   for (k = 0; k < ci->ncand; k++) {   \
+   x = canditer_next(ci) - candoff;\
i = x * incr1;  \
j = x * incr2;  \
TYPE1 v1 = ((const TYPE1 *) lft)[i];\
@@ -122,15 +105,6 @@ checkbats(BAT *b1, BAT *b2, const char *
} else {\
((TYPE3 *) dst)[k] = FUNC(v1, v2);  \
}   \
-   k++;\
-   x = canditer_next(ci);  \
-   if (is_oid_nil(x))  \
-   break;  \
-   x -= candoff;   \
-   } while (k < cnt);  \
-   while (k < cnt) {   \
-   ((TYPE3 *) dst)[k++] = TYPE3##_nil; \
-   nils++; \
}   \
} while (0)
 
@@ -138,11 +112,8 @@ checkbats(BAT *b1, BAT *b2, const char *
  * when it is set */
 #define BINARY_3TYPE_FUNC_nilmatch(TYPE1, TYPE2, TYPE3, FUNC)  \
do {\
-   do { 

MonetDB: default - Merge with Nov2019 branch.

2019-09-24 Thread Sjoerd Mullender
Changeset: cdb37660b2e1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cdb37660b2e1
Modified Files:
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/rel_bin.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (42 lines):

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
@@ -659,7 +659,7 @@ static str CUDFeval(Client cntxt, MalBlk
i + 1 - prefix_size);
memcpy(buf + prefix_size, SO_PREFIX, sizeof(char) * 
strlen(SO_PREFIX));
path =
-   GDKfilepath(0, BATDIR, buf, SO_EXT[0] == '.' ? SO_EXT + 
1 : SO_EXT);
+   GDKfilepath(0, BATDIR, buf, SO_EXT[0] == '.' ? 
_EXT[1] : SO_EXT);
if (!path) {
msg = createException(MAL, "cudf.eval", 
MAL_MALLOC_FAIL);
goto wrapup;
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
@@ -565,7 +565,6 @@ exp_bin(backend *be, sql_exp *e, stmt *l
}   break;
case e_convert: {
/* if input is type any NULL or column of nulls, change type */
-   sql_exp *ll = (sql_exp *) e->l;
list *tps = e->r;
sql_subtype *from = tps->h->data;
sql_subtype *to = tps->h->next->data;
@@ -574,16 +573,11 @@ exp_bin(backend *be, sql_exp *e, stmt *l
if (from->type->localtype == 0) {
l = stmt_atom(be, atom_general(sql->sa, to, NULL));
} else {
-   l = exp_bin(be, ll, left, right, grp, ext, cnt, sel);
+   l = exp_bin(be, e->l, left, right, grp, ext, cnt, sel);
}
if (!l)
return NULL;
-   /* if attempting to convert between strings, no conversion is 
needed */
-   if (ll->type == e_column && EC_VARCHAR(from->type->eclass) && 
EC_VARCHAR(to->type->eclass)) {
-   s = l;
-   } else {
-   s = stmt_convert(be, l, from, to, sel);
-   }
+   s = stmt_convert(be, l, from, to, sel);
}   break;
case e_func: {
node *en;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Apr2019 - Work around stupid compiler warning.

2019-09-24 Thread Sjoerd Mullender
Changeset: d0c16d825f5e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d0c16d825f5e
Modified Files:
sql/backends/monet5/UDF/capi/capi.c
Branch: Apr2019
Log Message:

Work around stupid compiler warning.


diffs (12 lines):

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
@@ -659,7 +659,7 @@ static str CUDFeval(Client cntxt, MalBlk
i + 1 - prefix_size);
memcpy(buf + prefix_size, SO_PREFIX, sizeof(char) * 
strlen(SO_PREFIX));
path =
-   GDKfilepath(0, BATDIR, buf, SO_EXT[0] == '.' ? SO_EXT + 
1 : SO_EXT);
+   GDKfilepath(0, BATDIR, buf, SO_EXT[0] == '.' ? 
_EXT[1] : SO_EXT);
if (!path) {
msg = createException(MAL, "cudf.eval", 
MAL_MALLOC_FAIL);
goto wrapup;
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list