Changeset: 717fba089280 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=717fba089280
Modified Files:
sql/backends/monet5/sql_upgrades.c
Branch: default
Log Message:
Make sure upgrade statements run within the upgrade check, so they won't run
every time when the database starts. Also print every upgrade query
diffs (45 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
@@ -2568,12 +2568,14 @@ sql_update_default(Client c, mvc *sql, c
pos = snprintf(buf, bufsize, "set schema \"sys\";\n");
- /* 51_sys_schema_extensions, remove stream table
entries */
+ /* 51_sys_schema_extensions, remove stream table
entries and update window function description */
pos += snprintf(buf + pos, bufsize - pos,
"ALTER TABLE sys.keywords SET READ
WRITE;\n"
"DELETE FROM sys.keywords where keyword
= 'STREAM';\n"
"ALTER TABLE sys.table_types SET READ
WRITE;\n"
- "DELETE FROM sys.table_types where
table_type_id = 4;\n");
+ "DELETE FROM sys.table_types where
table_type_id = 4;\n"
+ "ALTER TABLE sys.function_types SET
READ WRITE;\n"
+ "UPDATE sys.function_types SET
function_type_keyword = 'WINDOW' WHERE function_type_id = 6;\n");
pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", prev_schema);
@@ -2585,7 +2587,8 @@ sql_update_default(Client c, mvc *sql, c
pos = snprintf(buf, bufsize, "set schema \"sys\";\n"
"ALTER TABLE sys.keywords SET READ
ONLY;\n"
- "ALTER TABLE sys.table_types SET READ
ONLY;\n");
+ "ALTER TABLE sys.table_types SET READ
ONLY;\n"
+ "ALTER TABLE sys.function_types SET
READ ONLY;\n");
pos += snprintf(buf + pos, bufsize - pos, "set schema
\"%s\";\n", prev_schema);
assert(pos < bufsize);
printf("Running database upgrade commands:\n%s\n", buf);
@@ -2593,14 +2596,6 @@ sql_update_default(Client c, mvc *sql, c
}
}
- if (!err)
- err = SQLstatementIntern(
- c,
- "ALTER TABLE sys.function_types SET
READ WRITE;\n"
- "UPDATE sys.function_types SET
function_type_keyword = 'WINDOW' WHERE function_type_id = 6;\n",
- "ALTER TABLE sys.function_types SET
READ ONLY;\n"
- "update", true, false, NULL);
-
bailout:
if (b)
BBPunfix(b->batCacheid);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list