Changeset: ad3fac958a02 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ad3fac958a02
Modified Files:
        .bumpversion.cfg
        cmake/monetdb-versions.cmake
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql_upgrades.c
        sql/test/SQLancer/Tests/sqlancer01.stable.out
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.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.ppc64.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/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
        testing/Mtest.py.in
Branch: default
Log Message:

merged


diffs (truncated from 10312 to 300 lines):

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -3,7 +3,9 @@ current_version = 11.38.0
 commit = False
 tag = False
 
-[bumpversion:file:configure.ag]
+[bumpversion:file:cmake/monetdb-versions.cmake]
+parse = set(MONETDB_VERSION_MAJOR "(?P<major>\d+)")\nset(MONETDB_VERSION_MINOR 
"(?P<minor>\d+)")\nset(MONETDB_VERSION_PATCH "(?P<patch>\d+)")
+serialize = set(MONETDB_VERSION_MAJOR "{major}")\nset(MONETDB_VERSION_MINOR 
"{minor}")\nset(MONETDB_VERSION_PATCH "{patch}")
 
 [bumpversion:file:MonetDB.spec]
 search = %global version {current_version}
@@ -32,5 +34,3 @@ serialize = {major},{minor},{patch}
 [bumpversion:file:monetdb5/tools/libmonetdb5.rc]
 parse = (?P<major>\d+),(?P<minor>\d+),(?P<patch>\d+)
 serialize = {major},{minor},{patch}
-
-[bumpversion:file:testing/Mtest.py.in]
diff --git a/cmake/monetdb-versions.cmake b/cmake/monetdb-versions.cmake
--- a/cmake/monetdb-versions.cmake
+++ b/cmake/monetdb-versions.cmake
@@ -6,29 +6,29 @@
 # Copyright 1997 - July 2008 CWI, August 2008 - 2020 MonetDB B.V.
 #]]
 
-set(GDK_VERSION_MAJOR "18")
-set(GDK_VERSION_MINOR "4")
+set(GDK_VERSION_MAJOR "20")
+set(GDK_VERSION_MINOR "3")
 set(GDK_VERSION_PATCH "0")
 set(GDK_VERSION 
"${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
 
 set(MAPI_VERSION_MAJOR "12")
-set(MAPI_VERSION_MINOR "1")
+set(MAPI_VERSION_MINOR "4")
 set(MAPI_VERSION_PATCH "0")
 set(MAPI_VERSION 
"${MAPI_VERSION_MAJOR}.${MAPI_VERSION_MINOR}.${MAPI_VERSION_PATCH}")
 
-set(MONETDB5_VERSION_MAJOR "27")
+set(MONETDB5_VERSION_MAJOR "29")
 set(MONETDB5_VERSION_MINOR "3")
 set(MONETDB5_VERSION_PATCH "0")
 set(MONETDB5_VERSION 
"${MONETDB5_VERSION_MAJOR}.${MONETDB5_VERSION_MINOR}.${MONETDB5_VERSION_PATCH}")
 
 set(STREAM_VERSION_MAJOR "13")
-set(STREAM_VERSION_MINOR "2")
+set(STREAM_VERSION_MINOR "5")
 set(STREAM_VERSION_PATCH "0")
 set(STREAM_VERSION 
"${STREAM_VERSION_MAJOR}.${STREAM_VERSION_MINOR}.${STREAM_VERSION_PATCH}")
 
 set(MONETDB_VERSION_MAJOR "11")
-set(MONETDB_VERSION_MINOR "35")
-set(MONETDB_VERSION_PATCH "18")
+set(MONETDB_VERSION_MINOR "38")
+set(MONETDB_VERSION_PATCH "0")
 
 set(MONETDBE_VERSION_MAJOR "0")
 set(MONETDBE_VERSION_MINOR "1")
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
@@ -4246,7 +4246,7 @@ update_check_ukey(backend *be, stmt **up
                                        upd = stmt_project(be, tids, 
stmt_col(be, c->c, dels, dels->partition));
                                        */
                                } else {
-                                       upd = stmt_project(be, tids, 
stmt_col(be, c->c, dels, dels->partition));
+                                       upd = stmt_col(be, c->c, dels, 
dels->partition);
                                }
 
                                /* apply cand list first */
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
@@ -76,98 +76,66 @@ sql_fix_system_tables(Client c, mvc *sql
                if (func->base.id >= FUNC_OIDS)
                        continue;
 
-               if (func->type == F_AGGR) {
-                       pos += snprintf(buf + pos, bufsize - pos,
-                                       "insert into sys.functions values"
-                                       " (%d, '%s', '%s', '%s', %d, %d, false,"
-                                       " %s, %s, %d, %s, %s);\n",
-                                       func->base.id, func->base.name, 
func->imp,
-                                       func->mod, (int) FUNC_LANG_INT, (int) 
func->type,
-                                       func->varres ? "true" : "false",
-                                       func->vararg ? "true" : "false",
-                                       func->s ? func->s->base.id : s->base.id,
-                                       func->system ? "true" : "false",
-                                       func->semantics ? "true" : "false");
-                       arg = func->res->h->data;
-                       pos += snprintf(buf + pos, bufsize - pos,
-                                       "insert into sys.args values"
-                                       " (%d, %d, 'res', '%s', %u, %u, %d, 
0);\n",
-                                       store_next_oid(), func->base.id,
-                                       arg->type.type->sqlname, 
arg->type.digits,
-                                       arg->type.scale, arg->inout);
-                       if (func->ops->h) {
-                               arg = func->ops->h->data;
+               pos += snprintf(buf + pos, bufsize - pos,
+                               "insert into sys.functions values"
+                               " (%d, '%s', '%s', '%s',"
+                               " %d, %d, %s, %s, %s, %d, %s, %s);\n",
+                               func->base.id, func->base.name,
+                               func->imp, func->mod, (int) FUNC_LANG_INT,
+                               (int) func->type,
+                               func->side_effect ? "true" : "false",
+                               func->varres ? "true" : "false",
+                               func->vararg ? "true" : "false",
+                               func->s ? func->s->base.id : s->base.id,
+                               func->system ? "true" : "false",
+                               func->semantics ? "true" : "false");
+               if (func->res) {
+                       for (m = func->res->h; m; m = m->next, number++) {
+                               arg = m->data;
                                pos += snprintf(buf + pos, bufsize - pos,
-                                               "insert into sys.args values"
-                                               " (%d, %d, 'arg', '%s', %u,"
-                                               " %u, %d, 1);\n",
-                                               store_next_oid(), func->base.id,
+                                               "insert into sys.args"
+                                               " values"
+                                               " (%d, %d, 'res_%d',"
+                                               " '%s', %u, %u, %d,"
+                                               " %d);\n",
+                                               store_next_oid(),
+                                               func->base.id,
+                                               number,
                                                arg->type.type->sqlname,
-                                               arg->type.digits, 
arg->type.scale,
-                                               arg->inout);
+                                               arg->type.digits,
+                                               arg->type.scale,
+                                               arg->inout, number);
                        }
-               } else {
-                       pos += snprintf(buf + pos, bufsize - pos,
-                                       "insert into sys.functions values"
-                                       " (%d, '%s', '%s', '%s',"
-                                       " %d, %d, %s, %s, %s, %d, %s, %s);\n",
-                                       func->base.id, func->base.name,
-                                       func->imp, func->mod, (int) 
FUNC_LANG_INT,
-                                       (int) func->type,
-                                       func->side_effect ? "true" : "false",
-                                       func->varres ? "true" : "false",
-                                       func->vararg ? "true" : "false",
-                                       func->s ? func->s->base.id : s->base.id,
-                                       func->system ? "true" : "false",
-                                       func->semantics ? "true" : "false");
-                       if (func->res) {
-                               for (m = func->res->h; m; m = m->next, 
number++) {
-                                       arg = m->data;
-                                       pos += snprintf(buf + pos, bufsize - 
pos,
-                                                       "insert into sys.args"
-                                                       " values"
-                                                       " (%d, %d, 'res_%d',"
-                                                       " '%s', %u, %u, %d,"
-                                                       " %d);\n",
-                                                       store_next_oid(),
-                                                       func->base.id,
-                                                       number,
-                                                       arg->type.type->sqlname,
-                                                       arg->type.digits,
-                                                       arg->type.scale,
-                                                       arg->inout, number);
-                               }
-                       }
-                       for (m = func->ops->h; m; m = m->next, number++) {
-                               arg = m->data;
-                               if (arg->name)
-                                       pos += snprintf(buf + pos, bufsize - 
pos,
-                                                       "insert into sys.args"
-                                                       " values"
-                                                       " (%d, %d, '%s', '%s',"
-                                                       " %u, %u, %d, %d);\n",
-                                                       store_next_oid(),
-                                                       func->base.id,
-                                                       arg->name,
-                                                       arg->type.type->sqlname,
-                                                       arg->type.digits,
-                                                       arg->type.scale,
-                                                       arg->inout, number);
-                               else
-                                       pos += snprintf(buf + pos, bufsize - 
pos,
-                                                       "insert into sys.args"
-                                                       " values"
-                                                       " (%d, %d, 'arg_%d',"
-                                                       " '%s', %u, %u, %d,"
-                                                       " %d);\n",
-                                                       store_next_oid(),
-                                                       func->base.id,
-                                                       number,
-                                                       arg->type.type->sqlname,
-                                                       arg->type.digits,
-                                                       arg->type.scale,
-                                                       arg->inout, number);
-                       }
+               }
+               for (m = func->ops->h; m; m = m->next, number++) {
+                       arg = m->data;
+                       if (arg->name)
+                               pos += snprintf(buf + pos, bufsize - pos,
+                                               "insert into sys.args"
+                                               " values"
+                                               " (%d, %d, '%s', '%s',"
+                                               " %u, %u, %d, %d);\n",
+                                               store_next_oid(),
+                                               func->base.id,
+                                               arg->name,
+                                               arg->type.type->sqlname,
+                                               arg->type.digits,
+                                               arg->type.scale,
+                                               arg->inout, number);
+                       else
+                               pos += snprintf(buf + pos, bufsize - pos,
+                                               "insert into sys.args"
+                                               " values"
+                                               " (%d, %d, 'arg_%d',"
+                                               " '%s', %u, %u, %d,"
+                                               " %d);\n",
+                                               store_next_oid(),
+                                               func->base.id,
+                                               number,
+                                               arg->type.type->sqlname,
+                                               arg->type.digits,
+                                               arg->type.scale,
+                                               arg->inout, number);
                }
        }
 
@@ -2123,13 +2091,6 @@ sql_update_jun2020(Client c, mvc *sql, c
         * see also function load_func() in store.c */
        pos += snprintf(buf + pos, bufsize - pos,
                        "update sys.functions set language = language - 2 where 
language in (8, 9);\n");
-       sql_subtype tp;
-       sql_find_subtype(&tp, "varchar", 0, 0);
-       sql_subfunc *f = sql_bind_func(sql->sa, sys, "listagg", &tp, &tp, 
F_AGGR);
-       pos += snprintf(buf + pos, bufsize - pos,
-                       "insert into sys.args values"
-                       " (%d, %d, 'arg_2', 'varchar', 0, 0, %d, 2);\n",
-                       store_next_oid(), f->func->base.id, ARG_IN);
 
        pos += snprintf(buf + pos, bufsize - pos,
                        "update sys.args set name = name || '_' || cast(number 
as string) where name in ('arg', 'res') and func_id in (select id from 
sys.functions f where f.system);\n");
@@ -2991,9 +2952,19 @@ sql_update_default(Client c, mvc *sql, c
                                        "external name 
\"sql\".\"sql_variables\";\n"
                                        "grant execute on function 
\"sys\".\"var\" to public;\n");
 
+                       /* update system tables so that the content
+                        * looks more like what it would be if sys.var
+                        * had been defined by the C code in
+                        * sql_create_env() */
                        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 = 'var' and type = %d;\n", 
(int) F_UNION);
+                                       "update sys.functions set system = 
true,"
+                                       //" func = 'CREATE FUNCTION 
\"sys\".\"var\"() RETURNS TABLE(\"schema\" string, \"name\" string, \"type\" 
string, \"value\" string) EXTERNAL NAME \"sql\".\"sql_variables\";',"
+                                       " language = 2, side_effect = false 
where name = 'var' and schema_id = (select id from sys.schemas where name = 
'sys') and type = %d;\n"
+                                       "update sys.args set type = 'char' 
where func_id = (select id from sys.functions where name = 'var' and schema_id 
= (select id from sys.schemas where name = 'sys') and type = %d) and type = 
'clob';\n"
+                                       "update sys.privileges set grantor = 0 
where obj_id = (select id from sys.functions where name = 'var' and schema_id = 
(select id from sys.schemas where name = 'sys') and type = %d);\n",
+                                       (int) F_UNION,
+                                       (int) F_UNION,
+                                       (int) F_UNION);
 
                        pos += snprintf(buf + pos, bufsize - pos, "set schema 
\"%s\";\n", prev_schema);
                        assert(pos < bufsize);
diff --git a/sql/test/SQLancer/Tests/sqlancer01.stable.out 
b/sql/test/SQLancer/Tests/sqlancer01.stable.out
--- a/sql/test/SQLancer/Tests/sqlancer01.stable.out
+++ b/sql/test/SQLancer/Tests/sqlancer01.stable.out
@@ -107,6 +107,11 @@ stdout of test 'sqlancer01` in directory
 % clob # type
 % 28 # length
 [ "}*4nR<!뮯s5j4쫺YMe1pb[੧rc\r 8"        ]
+#INSERT INTO another_t(col4) VALUES(-589206676), (-1557408577);
+[ 2    ]
+#DELETE FROM another_t WHERE ((another_t.col8)<=(+ (another_t.col8)));
+[ 4    ]
+#ALTER TABLE another_t ADD UNIQUE(col8, col1, col6, col3);
 #ROLLBACK;
 #DROP TABLE tbl_ProductSales;
 #DROP TABLE another_T;
diff --git a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -54,7 +54,9 @@ update sys._tables set system = true whe
 drop function "sys"."var"();
 create function "sys"."var"() returns table("schema" string, "name" string, 
"type" string, "value" string) external name "sql"."sql_variables";
 grant execute on function "sys"."var" to public;
-update sys.functions set system = true where schema_id = (select id from 
sys.schemas where name = 'sys') and name = 'var' and type = 5;
+update sys.functions set system = true, language = 2, side_effect = false 
where name = 'var' and schema_id = (select id from sys.schemas where name = 
'sys') and type = 5;
+update sys.args set type = 'char' where func_id = (select id from 
sys.functions where name = 'var' and schema_id = (select id from sys.schemas 
where name = 'sys') and type = 5) and type = 'clob';
+update sys.privileges set grantor = 0 where obj_id = (select id from 
sys.functions where name = 'var' and schema_id = (select id from sys.schemas 
where name = 'sys') and type = 5);
 set schema "sys";
 
 # MonetDB/SQL module loaded
diff --git 
a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 
b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
--- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
+++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
@@ -54,7 +54,9 @@ update sys._tables set system = true whe
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to