Changeset: c19cc7019235 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c19cc7019235
Added Files:
        sql/benchmarks/tpcds/Tests/load.timeout
        sql/test/BugTracker-2017/Tests/error-clean-cache.Bug-6351.sql
        sql/test/BugTracker-2017/Tests/error-clean-cache.Bug-6351.stable.err
        sql/test/BugTracker-2017/Tests/error-clean-cache.Bug-6351.stable.out
Modified Files:
        NT/rules.msc
        configure.ag
        monetdb5/modules/atoms/uuid.mal
        monetdb5/modules/mal/orderidx.mal
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_subquery.mal
        sql/server/rel_optimizer.c
        sql/server/rel_select.c
        sql/server/sql_mvc.c
        sql/server/sql_mvc.h
        sql/server/sql_qc.c
        sql/server/sql_qc.h
        sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
        sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.err
        sql/test/BugTracker-2017/Tests/All
        sql/test/Tests/session_vars.sql
        sql/test/Tests/session_vars.stable.err
        sql/test/Tests/session_vars.stable.out
        sql/test/Via-m/Tests/event_s03.stable.out
        sql/test/Via-m/Tests/event_s05.stable.out
        sql/test/Via-m/Tests/event_s07.stable.out
        sql/test/Via-m/Tests/event_s09.stable.out
        sql/test/Via-m/Tests/event_s11.stable.err
        sql/test/Via-m/Tests/event_s11.stable.out
        sql/test/Via-m/Tests/file_s04.stable.out
        sql/test/Via-m/Tests/file_s05.stable.out
        sql/test/Via-m/Tests/file_s06.stable.out
        sql/test/Via-m/Tests/file_s08.stable.out
        sql/test/Via-m/Tests/file_s10.stable.out
        sql/test/Via-m/Tests/file_s12.stable.out
        sql/test/Via-m/Tests/file_s15.stable.out
        sql/test/Via-m/Tests/media_s04.stable.out
        sql/test/Via-m/Tests/media_s06.stable.out
        sql/test/Via-m/Tests/media_s08.stable.out
        sql/test/Via-m/Tests/media_s10.stable.out
        sql/test/Via-m/Tests/media_s12.stable.out
        sql/test/Via-m/Tests/media_s14.stable.out
        sql/test/Via-m/Tests/media_s16.stable.out
        sql/test/Via-m/Tests/media_s18.stable.out
        sql/test/Via-m/Tests/media_s19.stable.out
        sql/test/Via-m/insert_event1.sql
        sql/test/Via-m/insert_event2.sql
        sql/test/Via-m/insert_event3.sql
        sql/test/Via-m/insert_event4.sql
        sql/test/Via-m/insert_file2.sql
        sql/test/Via-m/insert_file3.sql
        sql/test/Via-m/insert_file4.sql
        sql/test/Via-m/insert_file5.sql
        sql/test/Via-m/insert_file6.sql
        sql/test/Via-m/insert_file7.sql
        sql/test/Via-m/insert_file8.sql
        sql/test/Via-m/insert_media1.sql
        sql/test/Via-m/insert_media2.sql
        sql/test/Via-m/insert_media3.sql
        sql/test/Via-m/insert_media4.sql
        sql/test/Via-m/insert_media5.sql
        sql/test/Via-m/insert_media6.sql
        sql/test/Via-m/insert_media7.sql
        sql/test/pg_regress/Tests/timestamp.sql
        sql/test/pg_regress/Tests/timestamptz.sql
        sql/test/ssqq/Tests/insert_query.stable.out
        sql/test/ssqq/Tests/insert_queue.stable.out
        sql/test/ssqq/Tests/insert_quser.stable.out
        sql/test/ssqq/insert_query.sql
        sql/test/ssqq/insert_queue.sql
        sql/test/ssqq/insert_quser.sql
Branch: default
Log Message:

Merge with Nov2019


diffs (truncated from 1254 to 300 lines):

diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -75,7 +75,7 @@ PYTHON2LIB=python27.lib
 PYTHON3BASE=C:\Python32
 !ENDIF
 !IFNDEF PYTHON3LIB
-PYTHON3LIB=python32.lib
+PYTHON3LIB=python37.lib
 !ENDIF
 
 PYTHON_LIBDIR=share\MonetDB\python
@@ -176,12 +176,12 @@ R.lib: "$(libr_DLL)"
 !ENDIF
 
 !IFDEF HAVE_LIBPY2
-libpy2_LIBS = "$(PYTHON2DIR)\libs\python27.lib"
+libpy2_LIBS = "$(PYTHON2DIR)\libs\$(PYTHON2LIB)"
 libpy2_CFLAGS = -DHAVE_LIBPY2 "-I$(PYTHON2DIR)\include" 
"-I$(PYTHON2DIR)\Lib\site-packages\numpy\core\include"
 !ENDIF
 
 !IFDEF HAVE_LIBPY3
-libpy3_LIBS = "$(PYTHON3DIR)\libs\python37.lib"
+libpy3_LIBS = "$(PYTHON3DIR)\libs\$(PYTHON3LIB)"
 libpy3_CFLAGS = -DHAVE_LIBPY3 "-I$(PYTHON3DIR)\include" 
"-I$(PYTHON3DIR)\Lib\site-packages\numpy\core\include"
 !ENDIF
 
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1785,7 +1785,7 @@ AS_VAR_IF([enable_py3integration], [no],
                                 enable_py3integration=no
                                 why_not_py3integration="(numpy/arrayobject.h 
not found)"])],
                        [libpy3_CFLAGS=`$PYTHON3 -c "from distutils.sysconfig 
import get_python_inc; import numpy; print(' -I' + get_python_inc() + ' -I' + 
numpy.get_include());" 2> /dev/null`
-                        libpy3_LIBS=`$PY3CONFIG --ldflags`
+                        libpy3_LIBS=`$PY3CONFIG --embed --ldflags` || 
libpy3_LIBS=`$PY3CONFIG --ldflags`
                         HAVEPYTHONHEADER=`$PYTHON3 -c "import 
distutils.sysconfig, os; 
print(os.path.isfile(os.path.join(distutils.sysconfig.get_python_inc(), 
'Python.h')))" 2> /dev/null`
                         AS_VAR_IF([HAVEPYTHONHEADER], [True],
                                [have_libpy3=yes
diff --git a/monetdb5/modules/atoms/uuid.mal b/monetdb5/modules/atoms/uuid.mal
--- a/monetdb5/modules/atoms/uuid.mal
+++ b/monetdb5/modules/atoms/uuid.mal
@@ -1,3 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
+
 atom uuid;
 
 # the atom functions
diff --git a/monetdb5/modules/mal/orderidx.mal 
b/monetdb5/modules/mal/orderidx.mal
--- a/monetdb5/modules/mal/orderidx.mal
+++ b/monetdb5/modules/mal/orderidx.mal
@@ -1,3 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
+
 pattern bat.orderidx(bv:bat[:any_1]):void
 address OIDXcreate
 comment "Introduces the OID index arrangement of ordered values";
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
@@ -796,8 +796,10 @@ cleanup_engine:
        return msg;
 }
 
-void SQLdestroyResult(res_table *destroy) {
-   res_table_destroy(destroy);
+void
+SQLdestroyResult(res_table *destroy)
+{
+       res_table_destroy(destroy);
 }
 
 /* a hook is provided to execute relational algebra expressions */
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
@@ -216,49 +216,42 @@ SQLepilogue(void *ret)
        return MAL_SUCCEED;
 }
 
-#define SQLglobal(name, val, failure)                                          
                                   \
+#define SQLglobal(name, val) \
        if (!stack_push_var(sql, name, &ctype) || !stack_set_var(sql, name, 
VALset(&src, ctype.type->localtype, (char*)(val)))) \
                failure--;
 
-#define NR_GLOBAL_VARS 9
-/* NR_GLOBAL_VAR should match exactly the number of variables created
-   in global_variables */
+/* NR_GLOBAL_VAR should match exactly the number of variables created in 
global_variables */
 /* initialize the global variable, ie make mvc point to these */
 static int
 global_variables(mvc *sql, const char *user, const char *schema)
 {
        sql_subtype ctype;
-       const char *typename;
        lng sec = 0;
        ValRecord src;
        const char *opt;
        int failure = 0;
 
-       typename = "int";
-       sql_find_subtype(&ctype, typename, 0, 0);
-       SQLglobal("debug", &sql->debug, failure);
-       SQLglobal("cache", &sql->cache, failure);
+       sql_find_subtype(&ctype, "int", 0, 0);
+       SQLglobal("debug", &sql->debug);
+       SQLglobal("cache", &sql->cache);
 
-       typename = "varchar";
-       sql_find_subtype(&ctype, typename, 1024, 0);
-       SQLglobal("current_schema", schema, failure);
-       SQLglobal("current_user", user, failure);
-       SQLglobal("current_role", user, failure);
+       sql_find_subtype(&ctype,  "varchar", 1024, 0);
+       SQLglobal("current_schema", schema);
+       SQLglobal("current_user", user);
+       SQLglobal("current_role", user);
 
        /* inherit the optimizer from the server */
        opt = GDKgetenv("sql_optimizer");
        if (!opt)
                opt = "default_pipe";
-       SQLglobal("optimizer", opt, failure);
+       SQLglobal("optimizer", opt);
 
-       typename = "sec_interval";
-       sql_find_subtype(&ctype, typename, inttype2digits(ihour, isec), 0);
-       SQLglobal("current_timezone", &sec, failure);
+       sql_find_subtype(&ctype, "sec_interval", inttype2digits(ihour, isec), 
0);
+       SQLglobal("current_timezone", &sec);
 
-       typename = "bigint";
-       sql_find_subtype(&ctype, typename, 0, 0);
-       SQLglobal("last_id", &sql->last_id, failure);
-       SQLglobal("rowcnt", &sql->rowcnt, failure);
+       sql_find_subtype(&ctype, "bigint", 0, 0);
+       SQLglobal("last_id", &sql->last_id);
+       SQLglobal("rowcnt", &sql->rowcnt);
        return failure;
 }
 
@@ -307,7 +300,7 @@ SQLprepareClient(Client c, int login)
                */
                if (m->session->tr->active)
                        return NULL;
-               if (mvc_reset(m, c->fdin, c->fdout, SQLdebug, NR_GLOBAL_VARS) < 
0)
+               if (mvc_reset(m, c->fdin, c->fdout, SQLdebug) < 0)
                        throw(SQL,"sql.initClient", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
                backend_reset(be);
        }
diff --git a/sql/backends/monet5/sql_subquery.mal 
b/sql/backends/monet5/sql_subquery.mal
--- a/sql/backends/monet5/sql_subquery.mal
+++ b/sql/backends/monet5/sql_subquery.mal
@@ -1,3 +1,8 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 
 module sql;
 
diff --git a/sql/benchmarks/tpcds/Tests/load.timeout 
b/sql/benchmarks/tpcds/Tests/load.timeout
new file mode 100644
--- /dev/null
+++ b/sql/benchmarks/tpcds/Tests/load.timeout
@@ -0,0 +1,1 @@
+2
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -5271,7 +5271,7 @@ typedef struct {
 static void
 rel_find_joins(mvc *sql, sql_rel *parent, sql_rel *rel, list *l, int depth)
 {
-       if (!rel || depth == 5) /* limit to 5 relations bellow in the tree */
+       if (!rel || depth == 5) /* limit to 5 relations below in the tree */
                return;
 
        switch (rel->op) {
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
@@ -1259,7 +1259,7 @@ rel_set_type_param(mvc *sql, sql_subtype
                type = sql_bind_localtype("dbl");
 
        if ((rel_exp->type == e_atom || rel_exp->type == e_column) && 
(rel_exp->l || rel_exp->r || rel_exp->f)) {
-               /* it's not a parameter set possible parameters bellow */
+               /* it's not a parameter set possible parameters below */
                const char *relname = exp_relname(rel_exp), *expname = 
exp_name(rel_exp);
                return rel_set_type_recurse(sql, type, rel, &relname, &expname);
        } else if (set_type_param(sql, type, rel_exp->flag) == 0) {
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
@@ -366,6 +366,7 @@ mvc_trans(mvc *m)
                        }
                } else { /* clean all but the prepared statements */
                        qc_clean(m->qc, false);
+                       stack_pop_until(m, NR_GLOBAL_VARS);
                }
        }
        store_unlock();
@@ -492,6 +493,7 @@ mvc_commit(mvc *m, int chain, const char
                if (m->qc) /* clean query cache, protect against concurrent 
access on the hash tables (when functions already exists, concurrent mal will
 build up the hash (not copied in the trans dup)) */
                        qc_clean(m->qc, false);
+               stack_pop_until(m, NR_GLOBAL_VARS);
                m->session->schema = find_sql_schema(m->session->tr, 
m->session->schema_name);
                if (mvc_debug)
                        fprintf(stderr, "#mvc_commit %s done\n", name);
@@ -620,6 +622,7 @@ mvc_rollback(mvc *m, int chain, const ch
        store_lock();
        if (m->qc) 
                qc_clean(m->qc, false);
+       stack_pop_until(m, NR_GLOBAL_VARS);
        if (name && name[0] != '\0') {
                while (tr && (!tr->name || strcmp(tr->name, name) != 0))
                        tr = tr->parent;
@@ -800,7 +803,7 @@ mvc_create(int clientid, backend_stack s
 }
 
 int
-mvc_reset(mvc *m, bstream *rs, stream *ws, int debug, int globalvars)
+mvc_reset(mvc *m, bstream *rs, stream *ws, int debug)
 {
        int i, res = 1;
        sql_trans *tr;
@@ -829,7 +832,7 @@ mvc_reset(mvc *m, bstream *rs, stream *w
 
        m->params = NULL;
        /* reset topvars to the set of global variables */
-       stack_pop_until(m, globalvars);
+       stack_pop_until(m, NR_GLOBAL_VARS);
        m->frame = 1;
        m->argc = 0;
        m->sym = NULL;
diff --git a/sql/server/sql_mvc.h b/sql/server/sql_mvc.h
--- a/sql/server/sql_mvc.h
+++ b/sql/server/sql_mvc.h
@@ -142,6 +142,9 @@ typedef struct mvc {
        char *query;            /* string, identify whatever we're working on */
 } mvc;
 
+/* NR_GLOBAL_VAR should match exactly the number of variables created in 
global_variables */
+#define NR_GLOBAL_VARS 9
+
 extern sql_table *mvc_init_create_view(mvc *sql, sql_schema *s, const char 
*name, const char *query);
 extern int mvc_init(int debug, store_type store, int ro, int su, backend_stack 
stk);
 extern void mvc_exit(void);
@@ -149,7 +152,7 @@ extern void mvc_logmanager(void);
 extern void mvc_idlemanager(void);
 
 extern mvc *mvc_create(int clientid, backend_stack stk, int debug, bstream 
*rs, stream *ws);
-extern int mvc_reset(mvc *m, bstream *rs, stream *ws, int debug, int 
globalvars);
+extern int mvc_reset(mvc *m, bstream *rs, stream *ws, int debug);
 extern void mvc_destroy(mvc *c);
 
 extern int mvc_status(mvc *c);
diff --git a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql 
b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
--- a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
+++ b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
@@ -36,9 +36,9 @@ set t = now();
 set t = current_timestamp;
 set t = current_time;
 rollback;
-set tt = now();
-set tt = current_time;
-set tt = current_timestamp;
+set tt = now(); --error, tt is no longer in the scope
+set tt = current_time; --error, tt is no longer in the scope
+set tt = current_timestamp; --error, tt is no longer in the scope
 
 create table d(t timestamp default current_time, i integer);
 create table d(t time default current_timestamp, i integer);
diff --git 
a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.err 
b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.err
--- a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.err
+++ b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.err
@@ -32,7 +32,19 @@ MAPI  = (monetdb) /var/tmp/mtest-27483/.
 QUERY = set t = current_time;
 ERROR = !types timetz(7,0) and timestamp(7,0) are not equal
 CODE  = 42000
-MAPI  = (monetdb) /var/tmp/mtest-30274/.s.monetdb.37685
+MAPI  = (monetdb) /var/tmp/mtest-219658/.s.monetdb.32926
+QUERY = set tt = now(); --error, tt is no longer in the scope
+ERROR = !Variable tt unknown
+CODE  = 42000
+MAPI  = (monetdb) /var/tmp/mtest-219658/.s.monetdb.32926
+QUERY = set tt = current_time; --error, tt is no longer in the scope
+ERROR = !Variable tt unknown
+CODE  = 42000
+MAPI  = (monetdb) /var/tmp/mtest-219658/.s.monetdb.32926
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to