Changeset: b8fb0f242164 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b8fb0f242164
Modified Files:
        NT/rules.msc
        configure.ag
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_cat.c
        sql/backends/monet5/sql_upgrades.c
        sql/common/sql_types.c
        sql/common/sql_types.h
        sql/include/sql_catalog.h
        sql/server/rel_psm.c
        sql/server/rel_psm.h
        sql/server/rel_schema.c
        sql/server/rel_select.c
        sql/server/rel_unnest.c
        sql/server/rel_unnest.h
        sql/server/sql_mvc.c
        sql/server/sql_mvc.h
        sql/server/sql_tokens.h
        sql/storage/sql_catalog.c
        sql/storage/sql_storage.h
        sql/storage/store.c
        sql/test/BugTracker-2009/Tests/All
        sql/test/BugTracker-2018/Tests/All
        sql/test/BugTracker/Tests/All
        sql/test/SQLite_regress/sqllogictest/sqllogictest.py
        testing/Mtest.py.in
        tools/merovingian/daemon/controlrunner.c
Branch: default
Log Message:

Merge with Nov2019 branch.


diffs (truncated from 1410 to 300 lines):

diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -42,6 +42,7 @@ BITSMCHN=X64
 # force W_CFLAGS off in debug builds: using icc, you get way more
 # warnings about casts which results in the code being uncompilable
 W_CFLAGS =
+HAVE_MAL_DEBUGGER = 1
 !ENDIF
 !IFDEF ENABLE_STRICT
 # strict mode: treat warnings as errors
@@ -386,6 +387,11 @@ create_winconfig_conds_new_py:
 !ELSE
        $(ECHO) HAVE_SHP_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
 !ENDIF
+!IFDEF HAVE_MAL_DEBUGGER
+       $(ECHO) HAVE_MAL_DEBUGGER_FALSE='#' >> 
"$(TOPDIR)\winconfig_conds_new.py"
+!ELSE
+       $(ECHO) HAVE_MAL_DEBUGGER_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
+!ENDIF
 !IFDEF HAVE_SQL
        $(ECHO) HAVE_SQL_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
 !ELSE
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -838,6 +838,7 @@ AS_VAR_IF([enable_assert], [no], [
        AC_MSG_RESULT([no])],
        [AC_MSG_RESULT([yes])])
 
+AM_CONDITIONAL([HAVE_MAL_DEBUGGER], [test "x$enable_assert" != xno])
 
 AC_MSG_CHECKING([for --enable-optimize])
 AS_CASE([$enable_optimize], [yes], [
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
@@ -283,7 +283,7 @@ create_table_or_view(mvc *sql, char* sna
        int check = 0;
 
        if (STORE_READONLY)
-               return sql_error(sql, 06, "25006!schema statements cannot be 
executed on a readonly database.");
+               return sql_error(sql, 06, SQLSTATE(25006) "schema statements 
cannot be executed on a readonly database.");
 
        if (!s)
                return sql_message(SQLSTATE(3F000) "CREATE %s: schema '%s' 
doesn't exist", (t->query) ? "TABLE" : "VIEW", sname);
@@ -473,11 +473,11 @@ create_table_from_emit(Client cntxt, cha
        if (!sname)
                sname = "sys";
        if (!(s = mvc_bind_schema(sql, sname))) {
-               msg = sql_error(sql, 02, "3F000!CREATE TABLE: no such schema 
'%s'", sname);
+               msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: no such 
schema '%s'", sname);
                goto cleanup;
        }
        if (!(t = mvc_create_table(sql, s, tname, tt_table, 0, 
SQL_DECLARED_TABLE, CA_COMMIT, -1, 0))) {
-               msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not create 
table '%s'", tname);
+               msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could 
not create table '%s'", tname);
                goto cleanup;
        }
 
@@ -487,13 +487,13 @@ create_table_from_emit(Client cntxt, cha
                sql_column *col = NULL;
 
                if (!tpe) {
-                       msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not 
find type for column");
+                       msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: 
could not find type for column");
                        goto cleanup;
                }
 
                col = mvc_create_column(sql, t, columns[i].name, tpe);
                if (!col) {
-                       msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not 
create column %s", columns[i].name);
+                       msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: 
could not create column %s", columns[i].name);
                        goto cleanup;
                }
        }
@@ -503,7 +503,7 @@ create_table_from_emit(Client cntxt, cha
        }
        t = mvc_bind_table(sql, s, tname);
        if (!t) {
-               msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not bind 
table %s", tname);
+               msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could 
not bind table %s", tname);
                goto cleanup;
        }
        for(i = 0; i < ncols; i++) {
@@ -512,7 +512,7 @@ create_table_from_emit(Client cntxt, cha
 
                col = mvc_bind_column(sql,t, columns[i].name);
                if (!col) {
-                       msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not 
bind column %s", columns[i].name);
+                       msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: 
could not bind column %s", columns[i].name);
                        goto cleanup;
                }
                msg = mvc_append_column(sql->session->tr, col, b);
@@ -553,12 +553,12 @@ append_to_table_from_emit(Client cntxt, 
        if (!sname)
                sname = "sys";
        if (!(s = mvc_bind_schema(sql, sname))) {
-               msg = sql_error(sql, 02, "3F000!CREATE TABLE: no such schema 
'%s'", sname);
+               msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: no such 
schema '%s'", sname);
                goto cleanup;
        }
        t = mvc_bind_table(sql, s, tname);
        if (!t) {
-               msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not bind 
table %s", tname);
+               msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could 
not bind table %s", tname);
                goto cleanup;
        }
        for(i = 0; i < ncols; i++) {
@@ -567,7 +567,7 @@ append_to_table_from_emit(Client cntxt, 
 
                col = mvc_bind_column(sql,t, columns[i].name);
                if (!col) {
-                       msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not 
bind column %s", columns[i].name);
+                       msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: 
could not bind column %s", columns[i].name);
                        goto cleanup;
                }
                msg = mvc_append_column(sql->session->tr, col, b);
diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -697,7 +697,7 @@ drop_seq(mvc *sql, char *sname, char *na
 }
 
 static str
-drop_func(mvc *sql, char *sname, char *name, sqlid fid, int type, int action)
+drop_func(mvc *sql, char *sname, char *name, sqlid fid, sql_ftype type, int 
action)
 {
        sql_schema *s = NULL;
        char is_aggr = (type == F_AGGR);
@@ -1396,7 +1396,7 @@ SQLdrop_function(Client cntxt, MalBlkPtr
        str sname = *getArgReference_str(stk, pci, 1); 
        char *fname = *getArgReference_str(stk, pci, 2);
        sqlid fid = (sqlid)*getArgReference_int(stk, pci, 3);
-       int type = *getArgReference_int(stk, pci, 4);
+       sql_ftype type = (sql_ftype) *getArgReference_int(stk, pci, 4);
        int action = *getArgReference_int(stk, pci, 5);
 
        initcontext();
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
@@ -1527,13 +1527,13 @@ sql_update_apr2019(Client c, mvc *sql)
                        "returns timestamp\n"
                        "external name sql.date_trunc;\n"
                        "grant execute on function sys.date_trunc(string, 
timestamp) to public;\n"
-                       "update sys.functions set system = true where schema_id 
= (select id from sys.schemas where name = 'sys') and name = 'date_trunc' and 
type = %d;\n", F_FUNC);
+                       "update sys.functions set system = true where schema_id 
= (select id from sys.schemas where name = 'sys') and name = 'date_trunc' and 
type = %d;\n", (int) F_FUNC);
 
        /* 22_clients.sql */
        pos += snprintf(buf + pos, bufsize - pos,
                        "create procedure sys.setprinttimeout(\"timeout\" 
integer)\n"
                        "external name clients.setprinttimeout;\n"
-                       "update sys.functions set system = true where schema_id 
= (select id from sys.schemas where name = 'sys') and name = 'setprinttimeout' 
and type = %d;\n", F_PROC);
+                       "update sys.functions set system = true where schema_id 
= (select id from sys.schemas where name = 'sys') and name = 'setprinttimeout' 
and type = %d;\n", (int) F_PROC);
 
        /* 26_sysmon.sql */
        pos += snprintf(buf + pos, bufsize - pos,
@@ -1903,13 +1903,13 @@ sql_update_storagemodel(Client c, mvc *s
                " and name in ('storage', 'tablestorage', 'schemastorage', 
'storagemodelinput', 'storagemodel', 'tablestoragemodel');\n");
        pos += snprintf(buf + pos, bufsize - pos,
                "update sys.functions set system = true where schema_id = 
(select id from sys.schemas where name = 'sys')"
-               " and name in ('storage') and type = %d;\n", F_UNION);
+               " and name in ('storage') and type = %d;\n", (int) F_UNION);
        pos += snprintf(buf + pos, bufsize - pos,
                "update sys.functions set system = true where schema_id = 
(select id from sys.schemas where name = 'sys')"
-               " and name in ('storagemodelinit') and type = %d;\n", F_PROC);
+               " and name in ('storagemodelinit') and type = %d;\n", (int) 
F_PROC);
        pos += snprintf(buf + pos, bufsize - pos,
                "update sys.functions set system = true where schema_id = 
(select id from sys.schemas where name = 'sys')"
-               " and name in ('columnsize', 'heapsize', 'hashsize', 
'imprintsize') and type = %d;\n", F_FUNC);
+               " and name in ('columnsize', 'heapsize', 'hashsize', 
'imprintsize') and type = %d;\n", (int) F_FUNC);
 
        if (schema)
                pos += snprintf(buf + pos, bufsize - pos, "set schema 
\"%s\";\n", schema);
@@ -2005,7 +2005,7 @@ sql_update_deltas(Client c, mvc *sql)
                        " returns table (\"id\" int, \"cleared\" boolean, 
\"immutable\" bigint, \"inserted\" bigint, \"updates\" bigint, \"deletes\" 
bigint, \"level\" int)"
                        " external name \"sql\".\"deltas\";\n"
                        "update sys.functions set system = true where schema_id 
= (select id from sys.schemas where name = 'sys')"
-                       " and name in ('deltas') and type = %d;\n", F_UNION);
+                       " and name in ('deltas') and type = %d;\n", (int) 
F_UNION);
        if (schema)
                pos += snprintf(buf + pos, bufsize - pos, "set schema 
\"%s\";\n", schema);
        pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c
--- a/sql/common/sql_types.c
+++ b/sql/common/sql_types.c
@@ -762,7 +762,7 @@ func_cmp(sql_allocator *sa, sql_func *f,
 }
 
 sql_subfunc *
-sql_find_func_by_name(sql_allocator *sa, sql_schema *s, const char *name, int 
nrargs, int type)
+sql_find_func_by_name(sql_allocator *sa, sql_schema *s, const char *name, int 
nrargs, sql_ftype type)
 {
        if (s && s->funcs.set)
                for (node *n=s->funcs.set->h; n; n = n->next) {
@@ -785,13 +785,13 @@ sql_find_func_by_name(sql_allocator *sa,
 }
 
 sql_subfunc *
-sql_find_func(sql_allocator *sa, sql_schema *s, const char *sqlfname, int 
nrargs, int type, sql_subfunc *prev)
+sql_find_func(sql_allocator *sa, sql_schema *s, const char *sqlfname, int 
nrargs, sql_ftype type, sql_subfunc *prev)
 {
        sql_subfunc *fres;
        int key = hash_key(sqlfname);
        sql_hash_e *he;
        int found = 0;
-       int filt = (type == F_FUNC)?F_FILT:type;
+       sql_ftype filt = (type == F_FUNC)?F_FILT:type;
 
        assert(nrargs);
        MT_lock_set(&funcs->ht_lock);
@@ -863,12 +863,12 @@ sql_find_func(sql_allocator *sa, sql_sch
 }
 
 list *
-sql_find_funcs(sql_allocator *sa, sql_schema *s, const char *sqlfname, int 
nrargs, int type)
+sql_find_funcs(sql_allocator *sa, sql_schema *s, const char *sqlfname, int 
nrargs, sql_ftype type)
 {
        sql_subfunc *fres;
        int key = hash_key(sqlfname);
        sql_hash_e *he;
-       int filt = (type == F_FUNC)?F_FILT:type;
+       sql_ftype filt = (type == F_FUNC)?F_FILT:type;
        list *res = sa_list(sa);
 
        assert(nrargs);
@@ -966,7 +966,7 @@ sql_bind_member(sql_allocator *sa, sql_s
 }
 
 sql_subfunc *
-sql_bind_func(sql_allocator *sa, sql_schema *s, const char *sqlfname, 
sql_subtype *tp1, sql_subtype *tp2, int type)
+sql_bind_func(sql_allocator *sa, sql_schema *s, const char *sqlfname, 
sql_subtype *tp1, sql_subtype *tp2, sql_ftype type)
 {
        list *l = sa_list(sa);
        sql_subfunc *fres;
@@ -981,7 +981,7 @@ sql_bind_func(sql_allocator *sa, sql_sch
 }
 
 sql_subfunc *
-sql_bind_func3(sql_allocator *sa, sql_schema *s, const char *sqlfname, 
sql_subtype *tp1, sql_subtype *tp2, sql_subtype *tp3, int type)
+sql_bind_func3(sql_allocator *sa, sql_schema *s, const char *sqlfname, 
sql_subtype *tp1, sql_subtype *tp2, sql_subtype *tp3, sql_ftype type)
 {
        list *l = sa_list(sa);
        sql_subfunc *fres;
@@ -998,10 +998,10 @@ sql_bind_func3(sql_allocator *sa, sql_sc
 }
 
 sql_subfunc *
-sql_bind_func_(sql_allocator *sa, sql_schema *s, const char *sqlfname, list 
*ops, int type)
+sql_bind_func_(sql_allocator *sa, sql_schema *s, const char *sqlfname, list 
*ops, sql_ftype type)
 {
        node *n = funcs->h;
-       int filt = (type == F_FUNC)?F_FILT:type;
+       sql_ftype filt = (type == F_FUNC)?F_FILT:type;
 
        (void)s;
        for (; n; n = n->next) {
@@ -1178,7 +1178,7 @@ arg_dup(sql_allocator *sa, sql_arg *oa)
 }
 
 static sql_func *
-sql_create_func_(sql_allocator *sa, const char *name, const char *mod, const 
char *imp, list *ops, sql_arg *res, bit side_effect, int type, int fix_scale)
+sql_create_func_(sql_allocator *sa, const char *name, const char *mod, const 
char *imp, list *ops, sql_arg *res, bit side_effect, sql_ftype type, int 
fix_scale)
 {
        sql_func *t = SA_ZNEW(sa, sql_func);
 
diff --git a/sql/common/sql_types.h b/sql/common/sql_types.h
--- a/sql/common/sql_types.h
+++ b/sql/common/sql_types.h
@@ -55,16 +55,16 @@ extern sql_subaggr *sql_find_aggr(sql_al
 extern int subaggr_cmp( sql_subaggr *a1, sql_subaggr *a2);
 
 extern int subfunc_cmp( sql_subfunc *f1, sql_subfunc *f2);
-extern sql_subfunc *sql_find_func_by_name(sql_allocator *sa, sql_schema *s, 
const char *name, int nrargs, int type);
-extern sql_subfunc *sql_find_func(sql_allocator *sa, sql_schema *s, const char 
*name, int nrargs, int type, sql_subfunc *prev);
-extern list *sql_find_funcs(sql_allocator *sa, sql_schema *s, const char 
*name, int nrargs, int type);
+extern sql_subfunc *sql_find_func_by_name(sql_allocator *sa, sql_schema *s, 
const char *name, int nrargs, sql_ftype type);
+extern sql_subfunc *sql_find_func(sql_allocator *sa, sql_schema *s, const char 
*name, int nrargs, sql_ftype type, sql_subfunc *prev);
+extern list *sql_find_funcs(sql_allocator *sa, sql_schema *s, const char 
*name, int nrargs, sql_ftype type);
 extern sql_subfunc *sql_bind_member(sql_allocator *sa, sql_schema *s, const 
char *name, sql_subtype *tp, int nrargs, sql_subfunc *prev);
-extern sql_subfunc *sql_bind_func(sql_allocator *sa, sql_schema *s, const char 
*name, sql_subtype *tp1, sql_subtype *tp2, int type);
-extern sql_subfunc *sql_bind_func3(sql_allocator *sa, sql_schema *s, const 
char *name, sql_subtype *tp1, sql_subtype *tp2, sql_subtype *tp3, int type);
+extern sql_subfunc *sql_bind_func(sql_allocator *sa, sql_schema *s, const char 
*name, sql_subtype *tp1, sql_subtype *tp2, sql_ftype type);
+extern sql_subfunc *sql_bind_func3(sql_allocator *sa, sql_schema *s, const 
char *name, sql_subtype *tp1, sql_subtype *tp2, sql_subtype *tp3, sql_ftype 
type);
 extern sql_subfunc *sql_bind_func_result(sql_allocator *sa, sql_schema *s, 
const char *name, sql_subtype *tp1, sql_subtype *tp2, sql_subtype *res);
 extern sql_subfunc *sql_bind_func_result3(sql_allocator *sa, sql_schema *s, 
const char *name, sql_subtype *tp1, sql_subtype *tp2, sql_subtype *tp3, 
sql_subtype *res);
 
-extern sql_subfunc *sql_bind_func_(sql_allocator *sa, sql_schema *s, const 
char *name, list *ops, int type);
+extern sql_subfunc *sql_bind_func_(sql_allocator *sa, sql_schema *s, const 
char *name, list *ops, sql_ftype type);
 
 extern sql_subfunc* sql_dup_subfunc(sql_allocator *sa, sql_func *f, list *ops, 
sql_subtype *member);
 
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
@@ -351,13 +351,15 @@ typedef struct sql_arg {
        sql_subtype type;
 } sql_arg;
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to