Changeset: af3df11d705e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=af3df11d705e Modified Files: sql/backends/monet5/sql_upgrades.c sql/scripts/25_debug.sql sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.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.powerpc64 sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.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/emptydb/Tests/check.stable.out sql/test/emptydb/Tests/check.stable.out.32bit sql/test/emptydb/Tests/check.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 Branch: default Log Message:
Add upgrade code for new debug and debugflag functions + fix some upgrade code. diffs (truncated from 826 to 300 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 @@ -2410,6 +2410,17 @@ 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 ('setoptimizer', 'setquerytimeout', 'setsessiontimeout', 'setworkerlimit', 'setmemorylimit', 'setoptimizer', 'stopsession') and type = %d;\n", (int) F_PROC); + /* 25_debug */ + pos += snprintf(buf + pos, bufsize - pos, + "create function sys.debug(flag string) returns integer\n" + " external name mdb.\"setDebug\";\n" + "create function sys.debugflags()\n" + " returns table(flag string, val bool)\n" + " external name mdb.\"getDebugFlags\";\n"); + 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 in ('debug', 'debugflags');\n"); + /* 26_sysmon */ t = mvc_bind_table(sql, sys, "queue"); t->system = 0; /* make it non-system else the drop view will fail */ @@ -2419,15 +2430,15 @@ sql_update_default(Client c, mvc *sql, c "drop function sys.queue;\n" "create function sys.queue()\n" "returns table(\n" - " \"tag\" bigint,\n" - " \"sessionid\" int,\n" - " \"user\" string,\n" - " \"started\" timestamp,\n" - " \"status\" string,\n" - " \"query\" string,\n" - " \"progress\" int, -- percentage of MAL instructions handled\n" - " \"workers\" int,\n" - " \"memory\" int\n" + " tag bigint,\n" + " sessionid int,\n" + " \"user\" string,\n" + " started timestamp,\n" + " status string,\n" + " query string,\n" + " progress int,\n" + " workers int,\n" + " memory int\n" ")\n" "external name sql.sysmon_queue;\n" "grant execute on function sys.queue to public;\n" diff --git a/sql/scripts/25_debug.sql b/sql/scripts/25_debug.sql --- a/sql/scripts/25_debug.sql +++ b/sql/scripts/25_debug.sql @@ -67,8 +67,8 @@ create function sys.debug(flag string) r external name mdb."setDebug"; create function sys.debugflags() - returns table("flag" string, "val" bool) - external name "mdb"."getDebugFlags"; + returns table(flag string, val bool) + external name mdb."getDebugFlags"; create function sys.deltas ("schema" string) returns table ("id" int, "cleared" boolean, "immutable" bigint, "inserted" bigint, "updates" bigint, "deletes" bigint, "level" int) 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 @@ -6114,19 +6114,25 @@ create procedure sys.stopsession("sessio update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions' and type = 5; update sys._tables set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions'; update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('setoptimizer', 'setquerytimeout', 'setsessiontimeout', 'setworkerlimit', 'setmemorylimit', 'setoptimizer', 'stopsession') and type = 2; +create function sys.debug(flag string) returns integer + external name mdb."setDebug"; +create function sys.debugflags() + returns table(flag string, val bool) + external name mdb."getDebugFlags"; +update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('debug', 'debugflags'); drop view sys.queue; drop function sys.queue; create function sys.queue() returns table( - "tag" bigint, - "sessionid" int, + tag bigint, + sessionid int, "user" string, - "started" timestamp, - "status" string, - "query" string, - "progress" int, -- percentage of MAL instructions handled - "workers" int, - "memory" int + started timestamp, + status string, + query string, + progress int, + workers int, + memory int ) external name sql.sysmon_queue; grant execute on function sys.queue to public; diff --git a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128 b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128 --- a/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128 +++ b/sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64.int128 @@ -6114,19 +6114,25 @@ create procedure sys.stopsession("sessio update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions' and type = 5; update sys._tables set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions'; update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('setoptimizer', 'setquerytimeout', 'setsessiontimeout', 'setworkerlimit', 'setmemorylimit', 'setoptimizer', 'stopsession') and type = 2; +create function sys.debug(flag string) returns integer + external name mdb."setDebug"; +create function sys.debugflags() + returns table(flag string, val bool) + external name mdb."getDebugFlags"; +update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('debug', 'debugflags'); drop view sys.queue; drop function sys.queue; create function sys.queue() returns table( - "tag" bigint, - "sessionid" int, + tag bigint, + sessionid int, "user" string, - "started" timestamp, - "status" string, - "query" string, - "progress" int, -- percentage of MAL instructions handled - "workers" int, - "memory" int + started timestamp, + status string, + query string, + progress int, + workers int, + memory int ) external name sql.sysmon_queue; grant execute on function sys.queue to public; diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out --- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out +++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out @@ -5324,19 +5324,25 @@ create procedure sys.stopsession("sessio update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions' and type = 5; update sys._tables set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions'; update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('setoptimizer', 'setquerytimeout', 'setsessiontimeout', 'setworkerlimit', 'setmemorylimit', 'setoptimizer', 'stopsession') and type = 2; +create function sys.debug(flag string) returns integer + external name mdb."setDebug"; +create function sys.debugflags() + returns table(flag string, val bool) + external name mdb."getDebugFlags"; +update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('debug', 'debugflags'); drop view sys.queue; drop function sys.queue; create function sys.queue() returns table( - "tag" bigint, - "sessionid" int, + tag bigint, + sessionid int, "user" string, - "started" timestamp, - "status" string, - "query" string, - "progress" int, -- percentage of MAL instructions handled - "workers" int, - "memory" int + started timestamp, + status string, + query string, + progress int, + workers int, + memory int ) external name sql.sysmon_queue; grant execute on function sys.queue to public; diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit --- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit +++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit @@ -5324,19 +5324,25 @@ create procedure sys.stopsession("sessio update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions' and type = 5; update sys._tables set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions'; update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('setoptimizer', 'setquerytimeout', 'setsessiontimeout', 'setworkerlimit', 'setmemorylimit', 'setoptimizer', 'stopsession') and type = 2; +create function sys.debug(flag string) returns integer + external name mdb."setDebug"; +create function sys.debugflags() + returns table(flag string, val bool) + external name mdb."getDebugFlags"; +update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('debug', 'debugflags'); drop view sys.queue; drop function sys.queue; create function sys.queue() returns table( - "tag" bigint, - "sessionid" int, + tag bigint, + sessionid int, "user" string, - "started" timestamp, - "status" string, - "query" string, - "progress" int, -- percentage of MAL instructions handled - "workers" int, - "memory" int + started timestamp, + status string, + query string, + progress int, + workers int, + memory int ) external name sql.sysmon_queue; grant execute on function sys.queue to public; 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 @@ -6152,19 +6152,25 @@ create procedure sys.stopsession("sessio update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions' and type = 5; update sys._tables set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions'; update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('setoptimizer', 'setquerytimeout', 'setsessiontimeout', 'setworkerlimit', 'setmemorylimit', 'setoptimizer', 'stopsession') and type = 2; +create function sys.debug(flag string) returns integer + external name mdb."setDebug"; +create function sys.debugflags() + returns table(flag string, val bool) + external name mdb."getDebugFlags"; +update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('debug', 'debugflags'); drop view sys.queue; drop function sys.queue; create function sys.queue() returns table( - "tag" bigint, - "sessionid" int, + tag bigint, + sessionid int, "user" string, - "started" timestamp, - "status" string, - "query" string, - "progress" int, -- percentage of MAL instructions handled - "workers" int, - "memory" int + started timestamp, + status string, + query string, + progress int, + workers int, + memory int ) external name sql.sysmon_queue; grant execute on function sys.queue to public; diff --git a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64 b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64 --- a/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64 +++ b/sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64 @@ -5324,19 +5324,25 @@ create procedure sys.stopsession("sessio update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions' and type = 5; update sys._tables set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions'; update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('setoptimizer', 'setquerytimeout', 'setsessiontimeout', 'setworkerlimit', 'setmemorylimit', 'setoptimizer', 'stopsession') and type = 2; +create function sys.debug(flag string) returns integer + external name mdb."setDebug"; +create function sys.debugflags() + returns table(flag string, val bool) + external name mdb."getDebugFlags"; +update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('debug', 'debugflags'); drop view sys.queue; drop function sys.queue; create function sys.queue() returns table( - "tag" bigint, - "sessionid" int, + tag bigint, + sessionid int, "user" string, - "started" timestamp, - "status" string, - "query" string, - "progress" int, -- percentage of MAL instructions handled - "workers" int, - "memory" int + started timestamp, + status string, + query string, + progress int, + workers int, + memory int ) external name sql.sysmon_queue; grant execute on function sys.queue to public; 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 @@ -6152,19 +6152,25 @@ create procedure sys.stopsession("sessio update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions' and type = 5; update sys._tables set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'sessions'; update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('setoptimizer', 'setquerytimeout', 'setsessiontimeout', 'setworkerlimit', 'setmemorylimit', 'setoptimizer', 'stopsession') and type = 2; +create function sys.debug(flag string) returns integer + external name mdb."setDebug"; +create function sys.debugflags() + returns table(flag string, val bool) + external name mdb."getDebugFlags"; +update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name in ('debug', 'debugflags'); drop view sys.queue; drop function sys.queue; create function sys.queue() returns table( - "tag" bigint, _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list