Changeset: 50aabc525376 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/50aabc525376
Modified Files:
sql/backends/monet5/sql_upgrades.c
Branch: Jan2022
Log Message:
Fix upgrade from older databases.
diffs (37 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
@@ -1950,6 +1950,12 @@ sql_update_oscar(Client c, mvc *sql, con
"grant execute on function
\"sys\".\"var\" to public;\n");
pos += snprintf(buf + pos, bufsize - pos,
+ "update sys.functions set system = true"
+ " where name = 'var' and schema_id =
(select id from sys.schemas where name = 'sys');\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);
+
+ pos += snprintf(buf + pos, bufsize - pos,
"create procedure
sys.hot_snapshot(tarfile string, onserver bool)\n"
"external name sql.hot_snapshot;\n"
"update sys.functions set system = true
where system <> true and schema_id = (select id from sys.schemas where name =
'sys')"
@@ -1965,20 +1971,6 @@ sql_update_oscar(Client c, mvc *sql, con
"grant execute on procedure
sys.hot_snapshot(string, bool) to \".snapshot\";\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,"
- //" 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);
-
/* SQL functions without backend implementations */
pos += snprintf(buf + pos, bufsize - pos,
"DROP FUNCTION
\"sys\".\"getcontent\"(url);\n"
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list