Changeset: 6115a28c2161 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6115a28c2161 Modified Files: sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.32bit sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.32bit Branch: Jan2022 Log Message:
Approve upgrade. diffs (truncated from 638 to 300 lines): diff --git a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 --- a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 +++ b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 @@ -5200,6 +5200,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; drop view sys.describe_sequences; @@ -5280,6 +5281,28 @@ CREATE VIEW sys.describe_tables AS AND s.id = t.schema_id AND ts.table_type_id = t.type AND s.name <> 'tmp'; +CREATE VIEW sys.fully_qualified_functions AS + WITH fqn(id, tpe, sig, num) AS + ( + SELECT + f.id, + ft.function_type_keyword, + CASE WHEN a.type IS NULL THEN + sys.fqn(s.name, f.name) || '()' + ELSE + sys.fqn(s.name, f.name) || '(' || group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ',') OVER (PARTITION BY f.id ORDER BY a.number) || ')' + END, + a.number + FROM sys.schemas s, sys.function_types ft, sys.functions f LEFT JOIN sys.args a ON f.id = a.func_id + WHERE s.id= f.schema_id AND f.type = ft.function_type_id + ) + SELECT + fqn1.id id, + fqn1.tpe tpe, + fqn1.sig nme + FROM + fqn fqn1 JOIN (SELECT id, max(num) FROM fqn GROUP BY id) fqn2(id, num) + ON fqn1.id = fqn2.id AND (fqn1.num = fqn2.num OR fqn1.num IS NULL AND fqn2.num is NULL); CREATE VIEW sys.describe_comments AS SELECT o.id id, @@ -5299,7 +5322,7 @@ CREATE VIEW sys.describe_comments AS UNION ALL SELECT seq.id, 'SEQUENCE', sys.FQN(s.name, seq.name) FROM sys.sequences seq, sys.schemas s WHERE seq.schema_id = s.id UNION ALL - SELECT f.id, ft.function_type_keyword, sys.FQN(s.name, f.name) FROM sys.functions f, sys.function_types ft, sys.schemas s WHERE f.type = ft.function_type_id AND f.schema_id = s.id + SELECT f.id, ft.function_type_keyword, qf.nme FROM sys.functions f, sys.function_types ft, sys.schemas s, sys.fully_qualified_functions qf WHERE f.type = ft.function_type_id AND f.schema_id = s.id AND qf.id = f.id ) AS o(id, tpe, nme) JOIN sys.comments c ON c.id = o.id; CREATE VIEW sys.describe_privileges AS @@ -5488,7 +5511,7 @@ GRANT SELECT ON sys.describe_partition_t GRANT SELECT ON sys.describe_sequences TO PUBLIC; GRANT SELECT ON sys.describe_functions TO PUBLIC; update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1; -update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; +update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'fully_qualified_functions', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; CREATE VIEW sys.dump_create_roles AS SELECT 'CREATE ROLE ' || sys.dq(name) || ';' stmt, 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 @@ -4605,6 +4605,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; drop view sys.describe_sequences; @@ -4685,6 +4686,28 @@ CREATE VIEW sys.describe_tables AS AND s.id = t.schema_id AND ts.table_type_id = t.type AND s.name <> 'tmp'; +CREATE VIEW sys.fully_qualified_functions AS + WITH fqn(id, tpe, sig, num) AS + ( + SELECT + f.id, + ft.function_type_keyword, + CASE WHEN a.type IS NULL THEN + sys.fqn(s.name, f.name) || '()' + ELSE + sys.fqn(s.name, f.name) || '(' || group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ',') OVER (PARTITION BY f.id ORDER BY a.number) || ')' + END, + a.number + FROM sys.schemas s, sys.function_types ft, sys.functions f LEFT JOIN sys.args a ON f.id = a.func_id + WHERE s.id= f.schema_id AND f.type = ft.function_type_id + ) + SELECT + fqn1.id id, + fqn1.tpe tpe, + fqn1.sig nme + FROM + fqn fqn1 JOIN (SELECT id, max(num) FROM fqn GROUP BY id) fqn2(id, num) + ON fqn1.id = fqn2.id AND (fqn1.num = fqn2.num OR fqn1.num IS NULL AND fqn2.num is NULL); CREATE VIEW sys.describe_comments AS SELECT o.id id, @@ -4704,7 +4727,7 @@ CREATE VIEW sys.describe_comments AS UNION ALL SELECT seq.id, 'SEQUENCE', sys.FQN(s.name, seq.name) FROM sys.sequences seq, sys.schemas s WHERE seq.schema_id = s.id UNION ALL - SELECT f.id, ft.function_type_keyword, sys.FQN(s.name, f.name) FROM sys.functions f, sys.function_types ft, sys.schemas s WHERE f.type = ft.function_type_id AND f.schema_id = s.id + SELECT f.id, ft.function_type_keyword, qf.nme FROM sys.functions f, sys.function_types ft, sys.schemas s, sys.fully_qualified_functions qf WHERE f.type = ft.function_type_id AND f.schema_id = s.id AND qf.id = f.id ) AS o(id, tpe, nme) JOIN sys.comments c ON c.id = o.id; CREATE VIEW sys.describe_privileges AS @@ -4893,7 +4916,7 @@ GRANT SELECT ON sys.describe_partition_t GRANT SELECT ON sys.describe_sequences TO PUBLIC; GRANT SELECT ON sys.describe_functions TO PUBLIC; update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1; -update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; +update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'fully_qualified_functions', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; CREATE VIEW sys.dump_create_roles AS SELECT 'CREATE ROLE ' || sys.dq(name) || ';' stmt, diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit --- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit +++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit @@ -4605,6 +4605,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; drop view sys.describe_sequences; @@ -4685,6 +4686,28 @@ CREATE VIEW sys.describe_tables AS AND s.id = t.schema_id AND ts.table_type_id = t.type AND s.name <> 'tmp'; +CREATE VIEW sys.fully_qualified_functions AS + WITH fqn(id, tpe, sig, num) AS + ( + SELECT + f.id, + ft.function_type_keyword, + CASE WHEN a.type IS NULL THEN + sys.fqn(s.name, f.name) || '()' + ELSE + sys.fqn(s.name, f.name) || '(' || group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ',') OVER (PARTITION BY f.id ORDER BY a.number) || ')' + END, + a.number + FROM sys.schemas s, sys.function_types ft, sys.functions f LEFT JOIN sys.args a ON f.id = a.func_id + WHERE s.id= f.schema_id AND f.type = ft.function_type_id + ) + SELECT + fqn1.id id, + fqn1.tpe tpe, + fqn1.sig nme + FROM + fqn fqn1 JOIN (SELECT id, max(num) FROM fqn GROUP BY id) fqn2(id, num) + ON fqn1.id = fqn2.id AND (fqn1.num = fqn2.num OR fqn1.num IS NULL AND fqn2.num is NULL); CREATE VIEW sys.describe_comments AS SELECT o.id id, @@ -4704,7 +4727,7 @@ CREATE VIEW sys.describe_comments AS UNION ALL SELECT seq.id, 'SEQUENCE', sys.FQN(s.name, seq.name) FROM sys.sequences seq, sys.schemas s WHERE seq.schema_id = s.id UNION ALL - SELECT f.id, ft.function_type_keyword, sys.FQN(s.name, f.name) FROM sys.functions f, sys.function_types ft, sys.schemas s WHERE f.type = ft.function_type_id AND f.schema_id = s.id + SELECT f.id, ft.function_type_keyword, qf.nme FROM sys.functions f, sys.function_types ft, sys.schemas s, sys.fully_qualified_functions qf WHERE f.type = ft.function_type_id AND f.schema_id = s.id AND qf.id = f.id ) AS o(id, tpe, nme) JOIN sys.comments c ON c.id = o.id; CREATE VIEW sys.describe_privileges AS @@ -4893,7 +4916,7 @@ GRANT SELECT ON sys.describe_partition_t GRANT SELECT ON sys.describe_sequences TO PUBLIC; GRANT SELECT ON sys.describe_functions TO PUBLIC; update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1; -update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; +update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'fully_qualified_functions', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; CREATE VIEW sys.dump_create_roles AS SELECT 'CREATE ROLE ' || sys.dq(name) || ';' stmt, diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 --- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 +++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 @@ -4605,6 +4605,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; drop view sys.describe_sequences; @@ -4685,6 +4686,28 @@ CREATE VIEW sys.describe_tables AS AND s.id = t.schema_id AND ts.table_type_id = t.type AND s.name <> 'tmp'; +CREATE VIEW sys.fully_qualified_functions AS + WITH fqn(id, tpe, sig, num) AS + ( + SELECT + f.id, + ft.function_type_keyword, + CASE WHEN a.type IS NULL THEN + sys.fqn(s.name, f.name) || '()' + ELSE + sys.fqn(s.name, f.name) || '(' || group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ',') OVER (PARTITION BY f.id ORDER BY a.number) || ')' + END, + a.number + FROM sys.schemas s, sys.function_types ft, sys.functions f LEFT JOIN sys.args a ON f.id = a.func_id + WHERE s.id= f.schema_id AND f.type = ft.function_type_id + ) + SELECT + fqn1.id id, + fqn1.tpe tpe, + fqn1.sig nme + FROM + fqn fqn1 JOIN (SELECT id, max(num) FROM fqn GROUP BY id) fqn2(id, num) + ON fqn1.id = fqn2.id AND (fqn1.num = fqn2.num OR fqn1.num IS NULL AND fqn2.num is NULL); CREATE VIEW sys.describe_comments AS SELECT o.id id, @@ -4704,7 +4727,7 @@ CREATE VIEW sys.describe_comments AS UNION ALL SELECT seq.id, 'SEQUENCE', sys.FQN(s.name, seq.name) FROM sys.sequences seq, sys.schemas s WHERE seq.schema_id = s.id UNION ALL - SELECT f.id, ft.function_type_keyword, sys.FQN(s.name, f.name) FROM sys.functions f, sys.function_types ft, sys.schemas s WHERE f.type = ft.function_type_id AND f.schema_id = s.id + SELECT f.id, ft.function_type_keyword, qf.nme FROM sys.functions f, sys.function_types ft, sys.schemas s, sys.fully_qualified_functions qf WHERE f.type = ft.function_type_id AND f.schema_id = s.id AND qf.id = f.id ) AS o(id, tpe, nme) JOIN sys.comments c ON c.id = o.id; CREATE VIEW sys.describe_privileges AS @@ -4893,7 +4916,7 @@ GRANT SELECT ON sys.describe_partition_t GRANT SELECT ON sys.describe_sequences TO PUBLIC; GRANT SELECT ON sys.describe_functions TO PUBLIC; update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1; -update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; +update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'fully_qualified_functions', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; CREATE VIEW sys.dump_create_roles AS SELECT 'CREATE ROLE ' || sys.dq(name) || ';' stmt, diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 --- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 +++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 @@ -5271,6 +5271,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; drop view sys.describe_sequences; @@ -5351,6 +5352,28 @@ CREATE VIEW sys.describe_tables AS AND s.id = t.schema_id AND ts.table_type_id = t.type AND s.name <> 'tmp'; +CREATE VIEW sys.fully_qualified_functions AS + WITH fqn(id, tpe, sig, num) AS + ( + SELECT + f.id, + ft.function_type_keyword, + CASE WHEN a.type IS NULL THEN + sys.fqn(s.name, f.name) || '()' + ELSE + sys.fqn(s.name, f.name) || '(' || group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ',') OVER (PARTITION BY f.id ORDER BY a.number) || ')' + END, + a.number + FROM sys.schemas s, sys.function_types ft, sys.functions f LEFT JOIN sys.args a ON f.id = a.func_id + WHERE s.id= f.schema_id AND f.type = ft.function_type_id + ) + SELECT + fqn1.id id, + fqn1.tpe tpe, + fqn1.sig nme + FROM + fqn fqn1 JOIN (SELECT id, max(num) FROM fqn GROUP BY id) fqn2(id, num) + ON fqn1.id = fqn2.id AND (fqn1.num = fqn2.num OR fqn1.num IS NULL AND fqn2.num is NULL); CREATE VIEW sys.describe_comments AS SELECT o.id id, @@ -5370,7 +5393,7 @@ CREATE VIEW sys.describe_comments AS UNION ALL SELECT seq.id, 'SEQUENCE', sys.FQN(s.name, seq.name) FROM sys.sequences seq, sys.schemas s WHERE seq.schema_id = s.id UNION ALL - SELECT f.id, ft.function_type_keyword, sys.FQN(s.name, f.name) FROM sys.functions f, sys.function_types ft, sys.schemas s WHERE f.type = ft.function_type_id AND f.schema_id = s.id + SELECT f.id, ft.function_type_keyword, qf.nme FROM sys.functions f, sys.function_types ft, sys.schemas s, sys.fully_qualified_functions qf WHERE f.type = ft.function_type_id AND f.schema_id = s.id AND qf.id = f.id ) AS o(id, tpe, nme) JOIN sys.comments c ON c.id = o.id; CREATE VIEW sys.describe_privileges AS @@ -5559,7 +5582,7 @@ GRANT SELECT ON sys.describe_partition_t GRANT SELECT ON sys.describe_sequences TO PUBLIC; GRANT SELECT ON sys.describe_functions TO PUBLIC; update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1; -update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; +update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'fully_qualified_functions', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; CREATE VIEW sys.dump_create_roles AS SELECT 'CREATE ROLE ' || sys.dq(name) || ';' stmt, diff --git a/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out b/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out --- a/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out +++ b/sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out @@ -4605,6 +4605,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list