Changeset: 083ca4020782 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/083ca4020782
Modified Files:
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out
Branch: sqlfuncfix
Log Message:
Approve upgrade.
diffs (truncated from 1208 to 300 lines):
diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
--- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
@@ -4540,8 +4540,13 @@ external name mtime.epoch;
grant execute on function sys.epoch (DECIMAL(18,3)) to public;
update sys.functions set system = true where system <> true and name in
('epoch') and schema_id = 2000 and type = 1;
set schema "sys";
+drop function sys.malfunctions();
+create function sys.malfunctions()
+ returns table("module" string, "function" string, "signature" string,
"address" string, "comment" string)
+ external name "manual"."functions";
create view sys.malfunctions as select * from sys.malfunctions();
update sys._tables set system = true where system <> true and schema_id = 2000
and name = 'malfunctions';
+update sys.functions set system = true where system <> true and schema_id =
2000 and name = 'malfunctions';
drop view sys.dependencies_vw;
drop view sys.ids;
CREATE VIEW sys.ids (id, name, schema_id, table_id, table_name, obj_type,
sys_table, system) AS
@@ -5185,4 +5190,284 @@ JOIN sys.fkey_actions upd ON fks.update_
JOIN sys.fkey_actions del ON fks.delete_action_id = del.action_id;
GRANT SELECT ON sys.fkeys TO PUBLIC;
update sys._tables set system = true where name in ('fkey_actions', 'fkeys')
AND schema_id = 2000;
+drop view logging.compinfo;
+drop function logging.compinfo;
+drop procedure sys.storagemodelinit();
+drop view sys.schemastorage;
+drop view sys.tablestorage;
+drop view sys.storage;
+drop function sys.storage();
+drop function wlr.tick;
+drop function wlr.clock;
+drop function wlc.tick;
+drop function wlc.clock;
+drop function profiler.getlimit;
+drop view sys.rejects;
+drop function sys.rejects;
+drop function sys.user_statistics;
+drop view sys.queue;
+drop function sys.queue;
+drop function sys.debugflags;
+drop function sys.bbp;
+drop view sys.optimizers;
+drop function sys.optimizers;
+drop function sys.querycache;
+drop function sys.optimizer_stats;
+drop function sys.current_sessionid;
+drop view sys.prepared_statements_args;
+drop function sys.prepared_statements_args;
+drop view sys.prepared_statements;
+drop function sys.prepared_statements;
+drop view sys.sessions;
+drop function sys.sessions;
+drop view sys.querylog_history;
+drop view sys.querylog_calls;
+drop function sys.querylog_calls;
+drop view sys.querylog_catalog;
+drop function sys.querylog_catalog;
+create function sys.querylog_catalog()
+returns table(
+ id oid,
+ owner string,
+ defined timestamp,
+ query string,
+ pipe string,
+ "plan" string,
+ mal int,
+ optimize bigint
+)
+external name sql.querylog_catalog;
+create view sys.querylog_catalog as select * from sys.querylog_catalog();
+create function sys.querylog_calls()
+returns table(
+ id oid,
+ "start" timestamp,
+ "stop" timestamp,
+ arguments string,
+ tuples bigint,
+ run bigint,
+ ship bigint,
+ cpu int,
+ io int
+)
+external name sql.querylog_calls;
+create view sys.querylog_calls as select * from sys.querylog_calls();
+create view sys.querylog_history as
+select qd.*, ql."start",ql."stop", ql.arguments, ql.tuples, ql.run, ql.ship,
ql.cpu, ql.io
+from sys.querylog_catalog() qd, sys.querylog_calls() ql
+where qd.id = ql.id and qd.owner = user;
+create function sys.sessions()
+returns table(
+ "sessionid" int,
+ "username" string,
+ "login" timestamp,
+ "idle" timestamp,
+ "optimizer" string,
+ "sessiontimeout" int,
+ "querytimeout" int,
+ "workerlimit" int,
+ "memorylimit" int
+)
+external name sql.sessions;
+create view sys.sessions as select * from sys.sessions();
+create function sys.prepared_statements()
+returns table(
+ "sessionid" int,
+ "username" string,
+ "statementid" int,
+ "statement" string,
+ "created" timestamp
+)
+external name sql.prepared_statements;
+grant execute on function sys.prepared_statements to public;
+create view sys.prepared_statements as select * from sys.prepared_statements();
+grant select on sys.prepared_statements to public;
+create function sys.prepared_statements_args()
+returns table(
+ "statementid" int,
+ "type" string,
+ "type_digits" int,
+ "type_scale" int,
+ "inout" tinyint,
+ "number" int,
+ "schema" string,
+ "table" string,
+ "column" string
+)
+external name sql.prepared_statements_args;
+grant execute on function sys.prepared_statements_args to public;
+create view sys.prepared_statements_args as select * from
sys.prepared_statements_args();
+grant select on sys.prepared_statements_args to public;
+create function sys.current_sessionid() returns int
+external name clients.current_sessionid;
+grant execute on function sys.current_sessionid to public;
+create function sys.optimizer_stats()
+ returns table (optname string, count int, timing bigint)
+ external name inspect.optimizer_stats;
+create function sys.querycache()
+ returns table (query string, count int)
+ external name sql.dump_cache;
+create function sys.optimizers ()
+ returns table (name string, def string, status string)
+ external name sql.optimizers;
+create view sys.optimizers as select * from sys.optimizers();
+create function sys.bbp ()
+ returns table (id int, name string,
+ ttype string, count bigint, refcnt int, lrefcnt int,
+ location string, heat int, dirty string,
+ status string, kind string)
+ external name bbp.get;
+create function sys.debugflags()
+ returns table(flag string, val bool)
+ external name mdb."getDebugFlags";
+create function sys.queue()
+returns table(
+ "tag" bigint,
+ "sessionid" int,
+ "username" string,
+ "started" timestamp,
+ "status" string,
+ "query" string,
+ "finished" timestamp,
+ "maxworkers" int,
+ "footprint" int
+)
+external name sysmon.queue;
+grant execute on function sys.queue to public;
+create view sys.queue as select * from sys.queue();
+grant select on sys.queue to public;
+create function sys.user_statistics()
+returns table(
+ username string,
+ querycount bigint,
+ totalticks bigint,
+ started timestamp,
+ finished timestamp,
+ maxticks bigint,
+ maxquery string
+)
+external name sysmon.user_statistics;
+create function sys.rejects()
+returns table(
+ rowid bigint,
+ fldid int,
+ "message" string,
+ "input" string
+)
+external name sql.copy_rejects;
+grant execute on function rejects to public;
+create view sys.rejects as select * from sys.rejects();
+create function profiler.getlimit() returns integer external name
profiler.getlimit;
+create function wlc.clock() returns string
+external name wlc."getclock";
+create function wlc.tick() returns bigint
+external name wlc."gettick";
+create function wlr.clock() returns string
+external name wlr."getclock";
+create function wlr.tick() returns bigint
+external name wlr."gettick";
+create function sys."storage"()
+returns table (
+ "schema" varchar(1024),
+ "table" varchar(1024),
+ "column" varchar(1024),
+ "type" varchar(1024),
+ "mode" varchar(15),
+ location varchar(1024),
+ "count" bigint,
+ typewidth int,
+ columnsize bigint,
+ heapsize bigint,
+ hashes bigint,
+ phash boolean,
+ "imprints" bigint,
+ sorted boolean,
+ revsorted boolean,
+ "unique" boolean,
+ orderidx bigint
+)
+external name sql."storage";
+create view sys."storage" as
+select * from sys."storage"()
+ where ("schema", "table") in (
+ select sch."name", tbl."name"
+ from sys."tables" as tbl join sys."schemas" as sch on tbl.schema_id = sch.id
+ where tbl."system" = false)
+order by "schema", "table", "column";
+create view sys."tablestorage" as
+select "schema", "table",
+ max("count") as "rowcount",
+ count(*) as "storages",
+ sum(columnsize) as columnsize,
+ sum(heapsize) as heapsize,
+ sum(hashes) as hashsize,
+ sum("imprints") as imprintsize,
+ sum(orderidx) as orderidxsize
+ from sys."storage"
+group by "schema", "table"
+order by "schema", "table";
+create view sys."schemastorage" as
+select "schema",
+ count(*) as "storages",
+ sum(columnsize) as columnsize,
+ sum(heapsize) as heapsize,
+ sum(hashes) as hashsize,
+ sum("imprints") as imprintsize,
+ sum(orderidx) as orderidxsize
+ from sys."storage"
+group by "schema"
+order by "schema";
+create procedure sys.storagemodelinit()
+begin
+ delete from sys.storagemodelinput;
+ insert into sys.storagemodelinput
+ select "schema", "table", "column", "type", typewidth, "count",
+ case when ("unique" or "type" in ('varchar', 'char', 'clob', 'json', 'url',
'blob', 'geometry', 'geometrya'))
+ then "count" else 0 end,
+ case when "count" > 0 and heapsize >= 8192 and "type" in ('varchar', 'char',
'clob', 'json', 'url')
+ then cast((heapsize - 8192) / "count" as bigint)
+ when "count" > 0 and heapsize >= 32 and "type" in ('blob', 'geometry',
'geometrya')
+ then cast((heapsize - 32) / "count" as bigint)
+ else typewidth end,
+ false, case sorted when true then true else false end, "unique", true
+ from sys."storage";
+ update sys.storagemodelinput
+ set reference = true
+ where ("schema", "table", "column") in (
+ select fkschema."name", fktable."name", fkkeycol."name"
+ from sys."keys" as fkkey,
+ sys."objects" as fkkeycol,
+ sys."tables" as fktable,
+ sys."schemas" as fkschema
+ where fktable."id" = fkkey."table_id"
+ and fkkey."id" = fkkeycol."id"
+ and fkschema."id" = fktable."schema_id"
+ and fkkey."rkey" > -1 );
+ update sys.storagemodelinput
+ set isacolumn = false
+ where ("schema", "table", "column") not in (
+ select sch."name", tbl."name", col."name"
+ from sys."schemas" as sch,
+ sys."tables" as tbl,
+ sys."columns" as col
+ where sch."id" = tbl."schema_id"
+ and tbl."id" = col."table_id");
+end;
+create function logging.compinfo()
+returns table(
+ "id" int,
+ "component" string,
+ "log_level" string
+)
+external name logging.compinfo;
+grant execute on function logging.compinfo to public;
+create view logging.compinfo as select * from logging.compinfo();
+grant select on logging.compinfo to public;
+update sys._tables set system = true where system <> true and schema_id = 2000
and name in ('schemastorage', 'tablestorage', 'storage', 'rejects', 'queue',
'optimizers', 'prepared_statements_args', 'prepared_statements', 'sessions',
'querylog_history', 'querylog_calls', 'querylog_catalog');
+update sys._tables set system = true where system <> true and schema_id =
(select id from sys.schemas where name = 'logging') and name = 'compinfo';
+update sys.functions set system = true where system <> true and schema_id =
2000 and name in ('storagemodelinit', 'storage', 'rejects', 'user_statistics',
'queue', 'debugflags', 'bbp', 'optimizers', 'querycache', 'optimizer_stats',
'current_sessionid', 'prepared_statements_args', 'prepared_statements',
'sessions', 'querylog_calls', 'querylog_catalog');
+update sys.functions set system = true where system <> true and schema_id =
(select id from sys.schemas where name = 'logging') and name = 'compinfo';
+update sys.functions set system = true where system <> true and schema_id =
(select id from sys.schemas where name = 'profiler') and name = 'getlimit';
+update sys.functions set system = true where system <> true and schema_id =
(select id from sys.schemas where name = 'wlc') and name in ('clock', 'tick');
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list