Changeset: 1d7984dd7b81 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1d7984dd7b81
Modified Files:
        sql/backends/monet5/sql_upgrades.c
Branch: default
Log Message:

Fixed upgrade code


diffs (36 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
@@ -2239,6 +2239,7 @@ sql_update_nov2019(Client c, mvc *sql, c
 static str
 sql_update_default(Client c, mvc *sql, const char *prev_schema)
 {
+       sql_table *t;
        size_t bufsize = 1024, pos = 0;
        char *err = NULL, *buf = GDKmalloc(bufsize);
 
@@ -2256,17 +2257,19 @@ sql_update_default(Client c, mvc *sql, c
                        "update sys.functions set system = true where schema_id 
= (select id from sys.schemas where name = 'sys')"
                        " and name in ('suspend_log_flushing', 
'resume_log_flushing') and type = %d;\n", (int) F_PROC);
 
-       
        /* 16_tracelog */
+       t = mvc_bind_table(sql, mvc_bind_schema(sql, "sys"), "tracelog");
+       t->system = 0; /* make it non-system else the drop view will fail */
        pos += snprintf(buf + pos, bufsize - pos,
+                       "drop view sys.tracelog;\n"
                        "drop function sys.tracelog();\n"
                        "create function sys.tracelog()\n"
                        "       returns table (\n"
-                       "               ticks bigint,       -- time in 
microseconds\n"
-                       "               stmt string     -- actual statement 
executed\n"
+                       "               ticks bigint, -- time in microseconds\n"
+                       "               stmt string  -- actual statement 
executed\n"
                        "       )\n"
-                       "       external name sql.dump_trace;\n");
-
+                       "       external name sql.dump_trace;\n"
+                       "create view sys.tracelog as select * from 
sys.tracelog();\n");
 
        pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", 
prev_schema);
        pos += snprintf(buf + pos, bufsize - pos, "commit;\n");
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to