Changeset: 839378895295 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=839378895295
Added Files:
        sql/test/subquery/Tests/subquery3.sql
Modified Files:
        sql/server/sql_partition.c
        sql/test/subquery/Tests/All
        tools/merovingian/daemon/handlers.c
        tools/merovingian/daemon/merovingian.c
        tools/merovingian/daemon/merovingian.h
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (116 lines):

diff --git a/sql/server/sql_partition.c b/sql/server/sql_partition.c
--- a/sql/server/sql_partition.c
+++ b/sql/server/sql_partition.c
@@ -316,13 +316,11 @@ bootstrap_partition_expression(mvc* sql,
                if (r)
                        r = rel_optimizer(sql, r, 0);
                if (r) {
-                       int i;
                        node *n, *found = NULL;
                        list *id_l = rel_dependencies(sql, r);
-                       for(i = 0, n = id_l->h ; n ; n = n->next, i++) { 
//remove the table itself from the list of dependencies
-                               if(*(int *) n->data == mt->base.id)
+                       for (n = id_l->h ; n ; n = n->next) //remove the table 
itself from the list of dependencies
+                               if(*(sqlid *) n->data == mt->base.id)
                                        found = n;
-                       }
                        assert(found);
                        list_remove_node(id_l, found);
                        mvc_create_dependencies(sql, id_l, mt->base.id, 
TABLE_DEPENDENCY);
diff --git a/sql/test/subquery/Tests/All b/sql/test/subquery/Tests/All
--- a/sql/test/subquery/Tests/All
+++ b/sql/test/subquery/Tests/All
@@ -2,6 +2,7 @@ subquery
 any
 all
 subquery2
+subquery3
 scalar
 any_all
 correlated
diff --git a/sql/test/subquery/Tests/subquery3.sql 
b/sql/test/subquery/Tests/subquery3.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/subquery/Tests/subquery3.sql
@@ -0,0 +1,37 @@
+CREATE TABLE tbl_ProductSales (ColID int, Product_Category  varchar(64), 
Product_Name  varchar(64), TotalSales 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), (1111,2222,3333,4444,5555,6666,7777,8888);
+
+SELECT
+    NOT MAX(t1.col6) IN (SELECT SUM(t1.col6) FROM tbl_ProductSales tp HAVING 
MAX(t1.col1) > MIN(tp.colID))
+FROM another_T t1
+GROUP BY t1.col6, t1.col7;
+       -- True
+       -- False
+       -- False
+       -- False
+
+SELECT
+    (SELECT MAX(ColID + col2) FROM tbl_ProductSales) * DENSE_RANK() OVER 
(PARTITION BY AVG(DISTINCT col5)),
+    AVG(col1) * MIN(col8) OVER (PARTITION BY col5 ORDER BY col1 ROWS UNBOUNDED 
PRECEDING) evil,
+    MAX(col3) / 10 + SUM(col1) * 10
+FROM another_T
+GROUP BY col1, col2, col5, col8;
+       -- 6    8       10
+       -- 26   968     113
+       -- 226  98568   1143
+       -- 2226 9874568 11443
+
+SELECT
+    CAST (NOT col1 IN (SELECT col2 FROM another_T GROUP BY col2) AS INTEGER) | 
CAST (col2 IN (SELECT col2 FROM another_T GROUP BY col2) AS INTEGER),
+    CAST (EXISTS (SELECT MAX(col5) * MAX(col4) FROM another_T GROUP BY col5, 
col4) AS INTEGER) & CAST (SUM(col4) IN (SELECT DISTINCT col2 FROM another_T 
GROUP BY col2) AS INTEGER)
+FROM another_T
+GROUP BY col1, col2, col5;
+       -- 1    0
+       -- 1    0
+       -- 1    0
+       -- 1    0
+
+DROP TABLE tbl_ProductSales;
+DROP TABLE another_T;
diff --git a/tools/merovingian/daemon/handlers.c 
b/tools/merovingian/daemon/handlers.c
--- a/tools/merovingian/daemon/handlers.c
+++ b/tools/merovingian/daemon/handlers.c
@@ -79,7 +79,7 @@ handler(int sig)
 
 /* we're not using a lock for setting, reading and clearing this flag
  * (deadlock!), but we should use atomic instructions */
-static volatile int hupflag = 0;
+static volatile sig_atomic_t hupflag = 0;
 
 /**
  * Handler for SIGHUP, causes a re-read of the .merovingian_properties
diff --git a/tools/merovingian/daemon/merovingian.c 
b/tools/merovingian/daemon/merovingian.c
--- a/tools/merovingian/daemon/merovingian.c
+++ b/tools/merovingian/daemon/merovingian.c
@@ -106,7 +106,7 @@ pthread_mutex_t _mero_topdp_lock = PTHRE
 /* for the logger, when set to 0, the logger terminates */
 volatile int _mero_keep_logging = 1;
 /* for accepting connections, when set to 0, listening socket terminates */
-volatile char _mero_keep_listening = 1;
+volatile sig_atomic_t _mero_keep_listening = 1;
 /* stream to where to write the log */
 FILE *_mero_logfile = NULL;
 /* stream to the stdout for the neighbour discovery service */
diff --git a/tools/merovingian/daemon/merovingian.h 
b/tools/merovingian/daemon/merovingian.h
--- a/tools/merovingian/daemon/merovingian.h
+++ b/tools/merovingian/daemon/merovingian.h
@@ -11,6 +11,7 @@
 
 #include <netinet/in.h> /* struct sockaddr_in */
 #include <pthread.h> /* pthread_mutex_t */
+#include <signal.h>     /* sig_atomic_t */
 
 #include "utils/utils.h" /* confkeyval */
 
@@ -65,7 +66,7 @@ extern char *_mero_mserver;
 extern dpair _mero_topdp;
 extern pthread_mutex_t _mero_topdp_lock;
 extern volatile int _mero_keep_logging;
-extern volatile char _mero_keep_listening;
+extern volatile sig_atomic_t _mero_keep_listening;
 extern FILE *_mero_logfile;
 extern unsigned short _mero_port;
 extern FILE *_mero_discout;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to