Changeset: 4d635034773d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4d635034773d
Branch: monetdbe-proxy
Log Message:

Merge with default.


diffs (truncated from 1311 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1315,7 +1315,7 @@ describe_table(Mapi mid, const char *sch
                /* the table is a real table */
                mnstr_printf(toConsole, "CREATE %sTABLE ",
                            type == 3 ? "MERGE " :
-                           type == 4 ? "STREAM " :
+                           /*type == 4 ? "STREAM " : */
                            type == 5 ? "REMOTE " :
                            type == 6 ? "REPLICA " :
                            "");
diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -208,11 +208,6 @@ SQLhelp sqlhelp1[] = {
         "[MINVALUE intval | NO MINVALUE] [MAXVALUE intval | NO MAXVALUE] 
[CACHE intval] [[NO] CYCLE]",
         "seq_int_datatype,intval",
         "See also 
https://www.monetdb.org/Documentation/Manuals/SQLreference/SerialTypes"},
-       {"CREATE STREAM TABLE",
-        "Temporary table, locked during updates/ continues query processing",
-        "CREATE STREAM TABLE [ IF NOT EXISTS ] qname table_source\n",
-        "table_source",
-        NULL},
        {"CREATE TABLE",
         "Create a new table",
         "CREATE TABLE [ IF NOT EXISTS ] qname table_source [STORAGE ident 
string]\n"
diff --git a/sql/ChangeLog b/sql/ChangeLog
--- a/sql/ChangeLog
+++ b/sql/ChangeLog
@@ -1,3 +1,7 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
+* Fri Oct 30 2020 Pedro Ferreira <pedro.ferre...@monetdbsolutions.com>
+- Leftover STREAM table definition from Datacell extension was removed
+  from the parser. They had no effect anymore.
+
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
@@ -2178,11 +2178,11 @@ split_join_exps(sql_rel *rel, list *join
                                                        left_reference = 
right_reference = 1;
                                                }
                                        } else {
-                                               if (l->card != CARD_ATOM) {
+                                               if (l->card != CARD_ATOM || 
!exp_is_atom(l)) {
                                                        left_reference += 
rel_find_exp(rel->l, l) != NULL;
                                                        right_reference += 
rel_find_exp(rel->r, l) != NULL;
                                                }
-                                               if (r->card != CARD_ATOM) {
+                                               if (r->card != CARD_ATOM || 
!exp_is_atom(r)) {
                                                        left_reference += 
rel_find_exp(rel->l, r) != NULL;
                                                        right_reference += 
rel_find_exp(rel->r, r) != NULL;
                                                }
@@ -2193,7 +2193,7 @@ split_join_exps(sql_rel *rel, list *join
                                        for (node *n = l->h ; n ; n = n->next) {
                                                sql_exp *ee = n->data;
 
-                                               if (ee->card != CARD_ATOM) {
+                                               if (ee->card != CARD_ATOM || 
!exp_is_atom(ee)) {
                                                        left_reference += 
rel_find_exp(rel->l, ee) != NULL;
                                                        right_reference += 
rel_find_exp(rel->r, ee) != NULL;
                                                }
@@ -2201,7 +2201,7 @@ split_join_exps(sql_rel *rel, list *join
                                        for (node *n = r->h ; n ; n = n->next) {
                                                sql_exp *ee = n->data;
 
-                                               if (ee->card != CARD_ATOM) {
+                                               if (ee->card != CARD_ATOM || 
!exp_is_atom(ee)) {
                                                        left_reference += 
rel_find_exp(rel->l, ee) != NULL;
                                                        right_reference += 
rel_find_exp(rel->r, ee) != NULL;
                                                }
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -1390,16 +1390,8 @@ mvc_delta_values(Client cntxt, MalBlkPtr
        if (tname) {
                if (!(t = mvc_bind_table(m, s, tname)))
                        throw(SQL, "sql.delta", SQLSTATE(3F000) "No such table 
'%s' in schema '%s'", tname, s->base.name);
-               if (isView(t))
-                       throw(SQL, "sql.delta", SQLSTATE(42000) "Views don't 
have delta values");
-               if (isMergeTable(t))
-                       throw(SQL, "sql.delta", SQLSTATE(42000) "Merge tables 
don't have delta values");
-               if (isStream(t))
-                       throw(SQL, "sql.delta", SQLSTATE(42000) "Stream tables 
don't have delta values");
-               if (isRemote(t))
-                       throw(SQL, "sql.delta", SQLSTATE(42000) "Remote tables 
don't have delta values");
-               if (isReplicaTable(t))
-                       throw(SQL, "sql.delta", SQLSTATE(42000) "Replica tables 
don't have delta values");
+               if (!isTable(t))
+                       throw(SQL, "sql.delta", SQLSTATE(42000) "%s don't have 
delta values", TABLE_TYPE_DESCRIPTION(t->type, t->properties));
                if (cname) {
                        if (!(c = mvc_bind_column(m, t, cname)))
                                throw(SQL, "sql.delta", SQLSTATE(3F000) "No 
such column '%s' in table '%s'", cname, t->base.name);
@@ -1410,7 +1402,7 @@ mvc_delta_values(Client cntxt, MalBlkPtr
        } else if (s->tables.set) {
                for (n = s->tables.set->h; n ; n = n->next) {
                        t = (sql_table *) n->data;
-                       if (!(isView(t) || isMergeTable(t) || isStream(t) || 
isRemote(t) || isReplicaTable(t)))
+                       if (isTable(t))
                                nrows += t->columns.set->cnt;
                }
        }
@@ -1461,7 +1453,7 @@ mvc_delta_values(Client cntxt, MalBlkPtr
                } else if (s->tables.set) {
                        for (n = s->tables.set->h; n ; n = n->next) {
                                t = (sql_table *) n->data;
-                               if (!(isView(t) || isMergeTable(t) || 
isStream(t) || isRemote(t) || isReplicaTable(t))) {
+                               if (isTable(t)) {
                                        cleared = (t->cleared != 0);
                                        deletes = (lng) 
store_funcs.count_del(m->session->tr, t);
 
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
@@ -337,6 +337,10 @@ SQLinit(Client c)
        backend *be = NULL;
        mvc *m = NULL;
        sql_allocator *sa = NULL;
+       const char *opt_pipe;
+
+       if ((opt_pipe = GDKgetenv("sql_optimizer")) && 
!isOptimizerPipe(opt_pipe))
+               throw(SQL, "sql.init", SQLSTATE(42000) "invalid sql optimizer 
pipeline %s", opt_pipe);
 
        MT_lock_set(&sql_contextLock);
 
diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -2565,8 +2565,34 @@ sql_update_default(Client c, mvc *sql, c
                        if (!*systabfixed && (err = sql_fix_system_tables(c, 
sql, prev_schema)) != NULL)
                                goto bailout;
                        *systabfixed = true;
+
+                       pos = snprintf(buf, bufsize, "set schema \"sys\";\n");
+
+                       /* 51_sys_schema_extensions, remove stream table 
entries */
+                       pos += snprintf(buf + pos, bufsize - pos,
+                                       "ALTER TABLE sys.keywords SET READ 
WRITE;\n"
+                                       "DELETE FROM sys.keywords where keyword 
= 'STREAM';\n"
+                                       "ALTER TABLE sys.table_types SET READ 
WRITE;\n"
+                                       "DELETE FROM sys.table_types where 
table_type_id = 4;\n");
+
+                       pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
+                       pos += snprintf(buf + pos, bufsize - pos, "set schema 
\"%s\";\n", prev_schema);
+
+                       assert(pos < bufsize);
+                       printf("Running database upgrade commands:\n%s\n", buf);
+                       if ((err = SQLstatementIntern(c, buf, "update", true, 
false, NULL)) != MAL_SUCCEED)
+                               goto bailout;
+               
+                       pos = snprintf(buf, bufsize, "set schema \"sys\";\n"
+                                       "ALTER TABLE sys.keywords SET READ 
ONLY;\n"
+                                       "ALTER TABLE sys.table_types SET READ 
ONLY;\n");
+                       pos += snprintf(buf + pos, bufsize - pos, "set schema 
\"%s\";\n", prev_schema);
+                       assert(pos < bufsize);
+                       printf("Running database upgrade commands:\n%s\n", buf);
+                       err = SQLstatementIntern(c, buf, "update", true, false, 
NULL);
                }
        }
+
 bailout:
        if (b)
                BBPunfix(b->batCacheid);
diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h
--- a/sql/include/sql_catalog.h
+++ b/sql/include/sql_catalog.h
@@ -144,7 +144,7 @@ typedef enum temp_t {
        SQL_GLOBAL_TEMP = 2,
        SQL_DECLARED_TABLE = 3, /* variable inside a stored procedure */
        SQL_MERGE_TABLE = 4,
-       SQL_STREAM = 5,
+       /* SQL_STREAM = 5, stream tables are not used anymore */
        SQL_REMOTE = 6,
        SQL_REPLICA_TABLE = 7
 } temp_t;
@@ -578,14 +578,14 @@ typedef enum table_types {
        tt_table = 0,           /* table */
        tt_view = 1,            /* view */
        tt_merge_table = 3,     /* multiple tables form one table */
-       tt_stream = 4,          /* stream */
+       /* tt_stream = 4, stream tables are not used anymore */
        tt_remote = 5,          /* stored on a remote server */
        tt_replica_table = 6    /* multiple replica of the same table */
 } table_types;
 
 #define TABLE_TYPE_DESCRIPTION(tt,properties)                                  
                                     \
 (tt == tt_table)?"TABLE":(tt == tt_view)?"VIEW":(tt == tt_merge_table && 
!properties)?"MERGE TABLE":                \
-(tt == tt_stream)?"STREAM TABLE":(tt == tt_remote)?"REMOTE TABLE":             
                                     \
+(tt == tt_remote)?"REMOTE TABLE":                                              
    \
 (tt == tt_merge_table && (properties & PARTITION_LIST) == 
PARTITION_LIST)?"LIST PARTITION TABLE":                   \
 (tt == tt_merge_table && (properties & PARTITION_RANGE) == 
PARTITION_RANGE)?"RANGE PARTITION TABLE":"REPLICA TABLE"
 
@@ -597,7 +597,6 @@ typedef enum table_types {
 #define isPartitionedByColumnTable(x)     ((x)->type==tt_merge_table && 
((x)->properties & PARTITION_COLUMN) == PARTITION_COLUMN)
 #define isPartitionedByExpressionTable(x) ((x)->type==tt_merge_table && 
((x)->properties & PARTITION_EXPRESSION) == PARTITION_EXPRESSION)
 #define isMergeTable(x)                   ((x)->type==tt_merge_table)
-#define isStream(x)                       ((x)->type==tt_stream)
 #define isRemote(x)                       ((x)->type==tt_remote)
 #define isReplicaTable(x)                 ((x)->type==tt_replica_table)
 #define isKindOfTable(x)                  (isTable(x) || isMergeTable(x) || 
isRemote(x) || isReplicaTable(x))
diff --git a/sql/jdbc/tests/Tests/All b/sql/jdbc/tests/Tests/All
--- a/sql/jdbc/tests/Tests/All
+++ b/sql/jdbc/tests/Tests/All
@@ -46,3 +46,4 @@ HAVE_JDBCTESTS?Bug_PrepStmtSetString_638
 HAVE_JDBCTESTS?Bug_LargeQueries_6571_6693
 HAVE_JDBCTESTS?Bug_IsValid_Timeout_Bug_6782
 HAVE_JDBCTESTS?Bug_PrepStmt_With_Errors_Jira292
+HAVE_JDBCCLIENT_JAR?ValidateSystemCatalogTables
diff --git 
a/sql/jdbc/tests/Tests/Bug_Connect_as_voc_getMetaData_Failure_Bug_6388.stable.out
 
b/sql/jdbc/tests/Tests/Bug_Connect_as_voc_getMetaData_Failure_Bug_6388.stable.out
--- 
a/sql/jdbc/tests/Tests/Bug_Connect_as_voc_getMetaData_Failure_Bug_6388.stable.out
+++ 
b/sql/jdbc/tests/Tests/Bug_Connect_as_voc_getMetaData_Failure_Bug_6388.stable.out
@@ -102,7 +102,6 @@ LOCAL TEMPORARY TABLE
 MERGE TABLE
 REMOTE TABLE
 REPLICA TABLE
-STREAM TABLE
 SYSTEM TABLE
 SYSTEM VIEW
 TABLE
diff --git a/sql/jdbc/tests/Tests/JdbcClient_create_tables.sql 
b/sql/jdbc/tests/Tests/JdbcClient_create_tables.sql
--- a/sql/jdbc/tests/Tests/JdbcClient_create_tables.sql
+++ b/sql/jdbc/tests/Tests/JdbcClient_create_tables.sql
@@ -52,7 +52,6 @@ CREATE OR REPLACE View object_stats as S
 CREATE   MERGE TABLE mt    (id int primary key, nm varchar(123) NOT NULL);
 CREATE  REMOTE TABLE remt  (id int primary key, nm varchar(123) NOT NULL) ON 
'mapi:monetdb://localhost:42001/mdb3';
 CREATE REPLICA TABLE replt (id int primary key, nm varchar(123) NOT NULL);
-CREATE  STREAM TABLE strt  (id int primary key, nm varchar(123) NOT NULL);
 
 CREATE GLOBAL TEMP TABLE gtmpt (id int primary key, nm varchar(123) NOT NULL) 
ON COMMIT PRESERVE ROWS;
 
diff --git a/sql/jdbc/tests/Tests/JdbcClient_drop_tables.sql 
b/sql/jdbc/tests/Tests/JdbcClient_drop_tables.sql
--- a/sql/jdbc/tests/Tests/JdbcClient_drop_tables.sql
+++ b/sql/jdbc/tests/Tests/JdbcClient_drop_tables.sql
@@ -22,7 +22,6 @@ DROP TABLE "triples" CASCADE;
 DROP TABLE mt;
 DROP TABLE remt;
 DROP TABLE replt;
-DROP TABLE strt;
 
 DROP TABLE gtmpt;
 
diff --git a/sql/jdbc/tests/Tests/Test_JdbcClient.stable.out 
b/sql/jdbc/tests/Tests/Test_JdbcClient.stable.out
--- a/sql/jdbc/tests/Tests/Test_JdbcClient.stable.out
+++ b/sql/jdbc/tests/Tests/Test_JdbcClient.stable.out
@@ -99,7 +99,6 @@ Operation successful
 Operation successful
 Operation successful
 Operation successful
-Operation successful
 
 # 18:15:40 >  
 # 18:15:40 >  java nl.cwi.monetdb.client.JdbcClient -h catskill -p 31817 -d 
mTests_sql_jdbc_tests -f 
/export/scratch1/dinther/dev/sql/jdbc/tests/Tests/JdbcClient_inserts_selects.sql
@@ -206,12 +205,6 @@ CREATE REPLICA TABLE "sys"."replt" (
        CONSTRAINT "replt_id_pkey" PRIMARY KEY ("id")
 );
 
-CREATE STREAM TABLE "sys"."strt" (
-       "id" INTEGER       NOT NULL,
-       "nm" VARCHAR(123)  NOT NULL,
-       CONSTRAINT "strt_id_pkey" PRIMARY KEY ("id")
-);
-
 
 CREATE TABLE "sys"."allnewtriples" (
        "id"        INTEGER       NOT NULL,
@@ -308,7 +301,6 @@ Operation successful
 Operation successful
 Operation successful
 Operation successful
-Operation successful
 
 # 18:15:41 >  
 # 18:15:41 >  "Done."
diff --git a/sql/jdbc/tests/Tests/ValidateSystemCatalogTables.SQL.bat 
b/sql/jdbc/tests/Tests/ValidateSystemCatalogTables.SQL.bat
new file mode 100755
--- /dev/null
+++ b/sql/jdbc/tests/Tests/ValidateSystemCatalogTables.SQL.bat
@@ -0,0 +1,11 @@
+@echo off
+
+echo user=monetdb>     .monetdb
+echo password=monetdb>>        .monetdb
+
+prompt # $t $g  
+echo on
+
+call java nl.cwi.monetdb.client.JdbcClient -h %HOST% -p %MAPIPORT% -d %TSTDB% 
-e -f "%TSTSRCBASE%\%TSTDIR%\Tests\ValidateSystemCatalogTables.sql"
+
+@del .monetdb
diff --git a/sql/jdbc/tests/Tests/ValidateSystemCatalogTables.SQL.sh 
b/sql/jdbc/tests/Tests/ValidateSystemCatalogTables.SQL.sh
new file mode 100755
--- /dev/null
+++ b/sql/jdbc/tests/Tests/ValidateSystemCatalogTables.SQL.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+cat << EOF > .monetdb
+user=monetdb
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to