Changeset: c077a55444a6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c077a55444a6
Modified Files:
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_upgrades.c
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: default
Log Message:
Merge with Apr2019 branch.
diffs (231 lines):
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
@@ -21,6 +21,10 @@
#include "rel_remote.h"
#include "mal_authorize.h"
+#ifdef HAVE_EMBEDDED
+#define printf(fmt,...) ((void) 0)
+#endif
+
/* this function can be used to recreate the system tables (types,
* functions, args) when internal types and/or functions have changed
* (i.e. the ones in sql_types.c) */
@@ -248,6 +252,7 @@ sql_update_hugeint(Client c, mvc *sql)
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -299,6 +304,7 @@ sql_update_geom(Client c, mvc *sql, int
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -414,6 +420,7 @@ sql_update_jul2017(Client c, mvc *sql)
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -458,6 +465,7 @@ sql_update_jul2017_sp2(Client c)
"GRANT EXECUTE ON FUNCTION sys.environment() TO
PUBLIC;\n"
"GRANT SELECT ON sys.environment TO PUBLIC;\n"
);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
err = SQLstatementIntern(c, &buf, "update", 1, 0, NULL);
@@ -510,6 +518,7 @@ sql_update_jul2017_sp3(Client c, mvc *sq
"create trigger system_update_tables after update on
sys._tables for each statement call sys_update_tables();\n");
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
err = SQLstatementIntern(c, &buf, "update", 1, 0, NULL);
@@ -548,6 +557,7 @@ sql_update_mar2018_geom(Client c, mvc *s
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1018,6 +1028,7 @@ sql_update_mar2018(Client c, mvc *sql)
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1030,7 +1041,7 @@ sql_update_mar2018(Client c, mvc *sql)
"ALTER TABLE sys.function_languages SET READ
ONLY;\n");
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
- assert(pos < bufsize);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
printf("Running database upgrade commands:\n%s\n", buf);
err = SQLstatementIntern(c, &buf, "update", 1, 0, NULL);
}
@@ -1065,6 +1076,7 @@ sql_update_mar2018_netcdf(Client c, mvc
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1143,6 +1155,7 @@ sql_update_mar2018_samtools(Client c, mv
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1170,6 +1183,7 @@ sql_update_mar2018_sp1(Client c, mvc *sq
"update sys.functions set system = true where name in
('dependencies_functions_on_triggers') and schema_id = (select id from
sys.schemas where name = 'sys');\n");
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1203,6 +1217,7 @@ sql_update_remote_tables(Client c, mvc *
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1330,6 +1345,7 @@ sql_replace_Mar2018_ids_view(Client c, m
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1352,6 +1368,7 @@ sql_update_gsl(Client c, mvc *sql)
"drop function sys.chi2prob(double, double);\n");
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1381,6 +1398,7 @@ sql_update_aug2018(Client c, mvc *sql)
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1425,6 +1443,7 @@ sql_update_aug2018_sp2(Client c, mvc *sq
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set
schema \"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1469,6 +1488,7 @@ sql_drop_functions_dependencies_Xs_on_Ys
"DROP FUNCTION dependencies_keys_on_foreignKeys();\n");
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1559,6 +1579,7 @@ sql_update_apr2019(Client c, mvc *sql)
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -1569,7 +1590,7 @@ sql_update_apr2019(Client c, mvc *sql)
"ALTER TABLE sys.keywords SET READ ONLY;\n");
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
- assert(pos < bufsize);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
printf("Running database upgrade commands:\n%s\n", buf);
err = SQLstatementIntern(c, &buf, "update", 1, 0, NULL);
}
@@ -1890,6 +1911,7 @@ sql_update_storagemodel(Client c, mvc *s
if (schema)
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", schema);
+ pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
@@ -5935,6 +5935,7 @@ GRANT EXECUTE ON FUNCTION json.filter(js
update sys.functions set system = true where name in ('fuse',
'generate_series', 'stddev_samp', 'stddev_pop', 'var_samp', 'var_pop',
'median', 'quantile', 'corr') and schema_id = (select id from sys.schemas where
name = 'sys');
update sys.functions set system = true where name = 'filter' and schema_id =
(select id from sys.schemas where name = 'json');
set schema "sys";
+commit;
Running database upgrade commands:
set schema "sys";
diff --git
a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
--- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
+++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
@@ -5935,6 +5935,7 @@ GRANT EXECUTE ON FUNCTION json.filter(js
update sys.functions set system = true where name in ('fuse',
'generate_series', 'stddev_samp', 'stddev_pop', 'var_samp', 'var_pop',
'median', 'quantile', 'corr') and schema_id = (select id from sys.schemas where
name = 'sys');
update sys.functions set system = true where name = 'filter' and schema_id =
(select id from sys.schemas where name = 'json');
set schema "sys";
+commit;
Running database upgrade commands:
set schema "sys";
diff --git a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
@@ -5935,6 +5935,7 @@ GRANT EXECUTE ON FUNCTION json.filter(js
update sys.functions set system = true where name in ('fuse',
'generate_series', 'stddev_samp', 'stddev_pop', 'var_samp', 'var_pop',
'median', 'quantile', 'corr') and schema_id = (select id from sys.schemas where
name = 'sys');
update sys.functions set system = true where name = 'filter' and schema_id =
(select id from sys.schemas where name = 'json');
set schema "sys";
+commit;
Running database upgrade commands:
set schema "sys";
diff --git a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
@@ -5934,6 +5934,7 @@ GRANT EXECUTE ON FUNCTION json.filter(js
update sys.functions set system = true where name in ('fuse',
'generate_series', 'stddev_samp', 'stddev_pop', 'var_samp', 'var_pop',
'median', 'quantile', 'corr') and schema_id = (select id from sys.schemas where
name = 'sys');
update sys.functions set system = true where name = 'filter' and schema_id =
(select id from sys.schemas where name = 'json');
set schema "sys";
+commit;
Running database upgrade commands:
set schema "sys";
diff --git a/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
b/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
--- a/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
+++ b/sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
@@ -5935,6 +5935,7 @@ GRANT EXECUTE ON FUNCTION json.filter(js
update sys.functions set system = true where name in ('fuse',
'generate_series', 'stddev_samp', 'stddev_pop', 'var_samp', 'var_pop',
'median', 'quantile', 'corr') and schema_id = (select id from sys.schemas where
name = 'sys');
update sys.functions set system = true where name = 'filter' and schema_id =
(select id from sys.schemas where name = 'json');
set schema "sys";
+commit;
Running database upgrade commands:
set schema "sys";
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list