Changeset: ce8ddcc3d014 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ce8ddcc3d014
Modified Files:
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:
Approve output.
diffs (truncated from 1989 to 300 lines):
diff --git a/sql/test/emptydb/Tests/check.stable.out
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -100,19 +100,21 @@
\dSv sys.describe_user_defined_types
\dSv sys.dump_add_schemas_to_users
\dSv sys.dump_column_defaults
+\dSv sys.dump_column_grants
\dSv sys.dump_comments
\dSv sys.dump_create_roles
\dSv sys.dump_create_schemas
\dSv sys.dump_create_users
\dSv sys.dump_foreign_keys
+\dSv sys.dump_function_grants
\dSv sys.dump_functions
\dSv sys.dump_grant_user_privileges
\dSv sys.dump_indices
\dSv sys.dump_partition_tables
-\dSv sys.dump_privileges
\dSv sys.dump_sequences
\dSv sys.dump_start_sequences
\dSv sys.dump_table_constraint_type
+\dSv sys.dump_table_grants
\dSv sys.dump_tables
\dSv sys.dump_triggers
\dSv sys.dump_user_defined_types
@@ -140,7 +142,6 @@
\dSv sys.tracelog
\dSv sys.users
\dSv sys.var_values
-\dSf sys."_dump_table_data"
\dSf sys."abbrev"
\dSf sys."alpha"
\dSf sys."alter_table"
@@ -464,19 +465,21 @@ SYSTEM VIEW sys.describe_triggers
SYSTEM VIEW sys.describe_user_defined_types
SYSTEM VIEW sys.dump_add_schemas_to_users
SYSTEM VIEW sys.dump_column_defaults
+SYSTEM VIEW sys.dump_column_grants
SYSTEM VIEW sys.dump_comments
SYSTEM VIEW sys.dump_create_roles
SYSTEM VIEW sys.dump_create_schemas
SYSTEM VIEW sys.dump_create_users
SYSTEM VIEW sys.dump_foreign_keys
+SYSTEM VIEW sys.dump_function_grants
SYSTEM VIEW sys.dump_functions
SYSTEM VIEW sys.dump_grant_user_privileges
SYSTEM VIEW sys.dump_indices
SYSTEM VIEW sys.dump_partition_tables
-SYSTEM VIEW sys.dump_privileges
SYSTEM VIEW sys.dump_sequences
SYSTEM VIEW sys.dump_start_sequences
SYSTEM VIEW sys.dump_table_constraint_type
+SYSTEM VIEW sys.dump_table_grants
SYSTEM VIEW sys.dump_tables
SYSTEM VIEW sys.dump_triggers
SYSTEM VIEW sys.dump_user_defined_types
@@ -510,7 +513,6 @@ SYSTEM FUNCTION sys.<>
SYSTEM FUNCTION sys.=
SYSTEM FUNCTION sys.>
SYSTEM FUNCTION sys.>=
-SYSTEM PROCEDURE sys._dump_table_data
SYSTEM FUNCTION sys.abbrev
SYSTEM FUNCTION sys.abs
SYSTEM FUNCTION sys.acos
@@ -1030,7 +1032,7 @@ create view sys.describe_column_defaults
create view sys.describe_comments as select o.id id, o.tpe tpe, o.nme fqn,
c.remark rem from (select id, 'SCHEMA', sys.dq(name) from sys.schemas union all
select t.id, case when ts.table_type_name = 'VIEW' then 'VIEW' else 'TABLE'
end, sys.fqn(s.name, t.name) from sys.schemas s join sys.tables t on s.id =
t.schema_id join sys.table_types ts on t.type = ts.table_type_id where not
s.name <> 'tmp' union all select c.id, 'COLUMN', sys.fqn(s.name, t.name) || '.'
|| sys.dq(c.name) from sys.columns c, sys.tables t, sys.schemas s where
c.table_id = t.id and t.schema_id = s.id union all select idx.id, 'INDEX',
sys.fqn(s.name, idx.name) from sys.idxs idx, sys._tables t, sys.schemas s where
idx.table_id = t.id and t.schema_id = s.id 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) as o(id, tpe, nme) join
sys.comments c on c.id = o.id;
create view sys.describe_constraints as select s.name sch, t.name tbl, kc.name
col, k.name con, case when k.type = 0 then 'PRIMARY KEY' when k.type = 1 then
'UNIQUE' end tpe from sys.schemas s, sys._tables t, sys.objects kc, sys.keys k
where kc.id = k.id and k.table_id = t.id and s.id = t.schema_id and t.system =
false and k.type in (0, 1) and t.type in (0, 6);
create view sys.describe_foreign_keys as with action_type (id, act) as (values
(0, 'NO ACTION'), (1, 'CASCADE'), (2, 'RESTRICT'), (3, 'SET NULL'), (4, 'SET
DEFAULT')) select fs.name fk_s, fkt.name fk_t, fkkc.name fk_c, fkkc.nr o,
fkk.name fk, ps.name pk_s, pkt.name pk_t, pkkc.name pk_c, ou.act on_update,
od.act on_delete from sys._tables fkt, sys.objects fkkc, sys.keys fkk,
sys._tables pkt, sys.objects pkkc, sys.keys pkk, sys.schemas ps, sys.schemas
fs, action_type ou, action_type od where fkt.id = fkk.table_id and pkt.id =
pkk.table_id and fkk.id = fkkc.id and pkk.id = pkkc.id and fkk.rkey = pkk.id
and fkkc.nr = pkkc.nr and pkt.schema_id = ps.id and fkt.schema_id = fs.id and
(fkk."action" & 255) = od.id and ((fkk."action" >> 8) & 255) = ou.id order by
fkk.name, fkkc.nr;
-create view sys.describe_functions as select f.id o, s.name sch, f.name fun,
f.func def from sys.functions f join sys.schemas s on f.schema_id = s.id where
s.name <> 'tmp' and not f.system;
+create view sys.describe_functions as with func_args_all(func_id, number,
max_number, func_arg) as (select func_id, number, max(number) over (partition
by func_id order by number desc), group_concat(sys.dq(name) || ' ' ||
sys.describe_type(type, type_digits, type_scale),', ') over (partition by
func_id order by number) from sys.args where inout = 1), func_args(func_id,
func_arg) as (select func_id, func_arg from func_args_all where number =
max_number), func_rets_all(func_id, number, max_number, func_ret,
func_ret_type) as (select func_id, number, max(number) over (partition by
func_id order by number desc), group_concat(sys.dq(name) || ' ' ||
sys.describe_type(type, type_digits, type_scale),', ') over (partition by
func_id order by number), group_concat(sys.describe_type(type, type_digits,
type_scale),', ') over (partition by func_id order by number) from sys.args
where inout = 0), func_rets(func_id, func_ret, func_ret_type) as (select
func_id, func_ret, func_ret_type from func_ret
s_all where number = max_number) select f.id o, s.name sch, f.name fun, case
when f.language in (1, 2) then f.func else 'CREATE ' ||
ft.function_type_keyword || ' ' || sys.fqn(s.name, f.name) || '(' ||
coalesce(fa.func_arg, '') || ')' || case when f.type = 5 then ' RETURNS TABLE
(' || coalesce(fr.func_ret, '') || ')' when f.type in (1,3) then ' RETURNS ' ||
fr.func_ret_type else '' end || case when fl.language_keyword is null then ''
else ' LANGUAGE ' || fl.language_keyword end || ' ' || f.func end def from
sys.functions f left outer join func_args fa on fa.func_id = f.id left outer
join func_rets fr on fr.func_id = f.id join sys.schemas s on f.schema_id = s.id
join sys.function_types ft on f.type = ft.function_type_id left outer join
sys.function_languages fl on f.language = fl.language_id where s.name <> 'tmp'
and not f.system;
create view sys.describe_indices as with it (id, idx) as (values (0, 'INDEX'),
(4, 'IMPRINTS INDEX'), (5, 'ORDERED INDEX')) select i.name ind, s.name sch,
t.name tbl, c.name col, it.idx tpe from sys.idxs as i left join sys.keys as k
on i.name = k.name, sys.objects as kc, sys._columns as c, sys.schemas s,
sys._tables as t, it where i.table_id = t.id and i.id = kc.id and kc.name =
c.name and t.id = c.table_id and t.schema_id = s.id and k.type is null and
i.type = it.id order by i.name, kc.nr;
create view sys.describe_partition_tables as select m_sch, m_tbl, p_sch,
p_tbl, case when p_raw_type is null then 'READ ONLY' when (p_raw_type =
'VALUES' and pvalues is null) or (p_raw_type = 'RANGE' and minimum is null and
maximum is null and with_nulls) then 'FOR NULLS' else p_raw_type end as tpe,
pvalues, minimum, maximum, with_nulls from (with tp("type", table_id) as
(select case when (table_partitions."type" & 2) = 2 then 'VALUES' else 'RANGE'
end, table_partitions.table_id from sys.table_partitions), subq(m_tid, p_mid,
"type", m_sch, m_tbl, p_sch, p_tbl) as (select m_t.id, p_m.id, m_t."type",
m_s.name, m_t.name, p_s.name, p_m.name from sys.schemas m_s, sys._tables m_t,
sys.dependencies d, sys.schemas p_s, sys._tables p_m where m_t."type" in (3, 6)
and m_t.schema_id = m_s.id and m_s.name <> 'tmp' and m_t.system = false and
m_t.id = d.depend_id and d.id = p_m.id and p_m.schema_id = p_s.id order by
m_t.id, p_m.id) select subq.m_sch, subq.m_tbl, subq.p_sch, subq.p_tbl,
tp."type" a
s p_raw_type, case when tp."type" = 'VALUES' then (select
group_concat(vp.value, ',')from sys.value_partitions vp where vp.table_id =
subq.p_mid) else null end as pvalues, case when tp."type" = 'RANGE' then
(select minimum from sys.range_partitions rp where rp.table_id = subq.p_mid)
else null end as minimum, case when tp."type" = 'RANGE' then (select maximum
from sys.range_partitions rp where rp.table_id = subq.p_mid) else null end as
maximum, case when tp."type" = 'VALUES' then exists(select vp.value from
sys.value_partitions vp where vp.table_id = subq.p_mid and vp.value is null)
else (select rp.with_nulls from sys.range_partitions rp where rp.table_id =
subq.p_mid) end as with_nulls from subq left outer join tp on subq.m_tid =
tp.table_id) as tmp_pi;
create view sys.describe_privileges as select case when o.tpe is null and
pc.privilege_code_name = 'SELECT' then 'COPY FROM' when o.tpe is null and
pc.privilege_code_name = 'UPDATE' then 'COPY INTO' else o.nme end o_nme, case
when o.tpe is not null then o.tpe else 'GLOBAL' end o_tpe,
pc.privilege_code_name p_nme, a.name a_nme, g.name g_nme, p.grantable grantable
from sys.privileges p left join (select t.id, s.name || '.' || t.name , 'TABLE'
from sys.schemas s, sys.tables t where s.id = t.schema_id union all select
c.id, s.name || '.' || t.name || '.' || c.name, 'COLUMN' from sys.schemas s,
sys.tables t, sys.columns c where s.id = t.schema_id and t.id = c.table_id
union all select f.id, f.nme, f.tpe from sys.fully_qualified_functions f) o(id,
nme, tpe) on o.id = p.obj_id, sys.privilege_codes pc, auths a, auths g where
p.privileges = pc.privilege_code_id and p.auth_id = a.id and p.grantor = g.id;
@@ -1038,24 +1040,26 @@ create view sys.describe_sequences as se
create view sys.describe_tables as select t.id o, s.name sch, t.name tab,
ts.table_type_name typ, (select ' (' || group_concat(sys.dq(c.name) || ' ' ||
sys.describe_type(c.type, c.type_digits, c.type_scale) || ifthenelse(c."null" =
'false', ' NOT NULL', '') , ', ') || ')' from sys._columns c where c.table_id =
t.id) col, case when ts.table_type_name = 'REMOTE TABLE' then
sys.get_remote_table_expressions(s.name, t.name) when ts.table_type_name =
'MERGE TABLE' then sys.get_merge_table_partition_expressions(t.id) when
ts.table_type_name = 'VIEW' then sys.schema_guard(s.name, t.name, t.query) else
'' end opt from sys.schemas s, sys.table_types ts, sys.tables t where
ts.table_type_name in ('TABLE', 'VIEW', 'MERGE TABLE', 'REMOTE TABLE', 'REPLICA
TABLE') and t.system = false and s.id = t.schema_id and ts.table_type_id =
t.type and s.name <> 'tmp';
create view sys.describe_triggers as select s.name sch, t.name tab, tr.name
tri, tr.statement def from sys.schemas s, sys.tables t, sys.triggers tr where
s.id = t.schema_id and t.id = tr.table_id and not t.system;
create view sys.describe_user_defined_types as select s.name sch, t.sqlname
sql_tpe, t.systemname ext_tpe from sys.types t join sys.schemas s on
t.schema_id = s.id where t.eclass = 18 and ((s.name = 'sys' and t.sqlname not
in ('geometrya', 'mbr', 'url', 'inet', 'json', 'uuid', 'xml')) or (s.name <>
'sys'));
-create view sys.dump_add_schemas_to_users as select 'ALTER USER ' ||
sys.dq(ui.name) || ' SET SCHEMA ' || sys.dq(s.name) || ';' stmt from
sys.db_user_info ui, sys.schemas s where ui.default_schema = s.id and ui.name
<> 'monetdb' and ui.name <> '.snapshot' and s.name <> 'sys';
-create view sys.dump_column_defaults as select 'ALTER TABLE ' || sys.fqn(sch,
tbl) || ' ALTER COLUMN ' || sys.dq(col) || ' SET DEFAULT ' || def || ';' stmt
from sys.describe_column_defaults;
+create view sys.dump_add_schemas_to_users as select 'ALTER USER ' ||
sys.dq(ui.name) || ' SET SCHEMA ' || sys.dq(s.name) || ';' stmt, s.name
schema_name, ui.name user_name from sys.db_user_info ui, sys.schemas s where
ui.default_schema = s.id and ui.name <> 'monetdb' and ui.name <> '.snapshot'
and s.name <> 'sys';
+create view sys.dump_column_defaults as select 'ALTER TABLE ' || sys.fqn(sch,
tbl) || ' ALTER COLUMN ' || sys.dq(col) || ' SET DEFAULT ' || def || ';' stmt,
sch schema_name, tbl table_name, col column_name from
sys.describe_column_defaults;
+create view sys.dump_column_grants as select 'GRANT ' ||
pc.privilege_code_name || '(' || sys.dq(c.name) || ') ON ' || sys.dq(s.name) ||
'.' || sys.dq(t.name) || ' TO ' || ifthenelse(a.name = 'public', 'PUBLIC',
sys.dq(a.name)) || case when p.grantable = 1 then ' WITH GRANT OPTION' else ''
end || ';' stmt, s.name schema_name, t.name table_name, c.name column_name,
a.name grantee from sys.schemas s, sys.tables t, sys.columns c, sys.auths a,
sys.privileges p, sys.auths g, sys.privilege_codes pc where p.obj_id = c.id and
c.table_id = t.id and p.auth_id = a.id and t.schema_id = s.id and not t.system
and p.grantor = g.id and p.privileges = pc.privilege_code_id order by s.name,
t.name, c.name, a.name, g.name, p.grantable;
create view sys.dump_comments as select 'COMMENT ON ' || c.tpe || ' ' || c.fqn
|| ' IS ' || sys.sq(c.rem) || ';' stmt from sys.describe_comments c;
-create view sys.dump_create_roles as select 'CREATE ROLE ' || sys.dq(name) ||
';' stmt from sys.auths where name not in (select name from sys.db_user_info)
and grantor <> 0;
-create view sys.dump_create_schemas as select 'CREATE SCHEMA ' ||
sys.dq(s.name) || ifthenelse(a.name <> 'sysadmin', ' AUTHORIZATION ' || a.name,
' ') || ';' stmt from sys.schemas s, sys.auths a where s.authorization = a.id
and s.system = false;
-create view sys.dump_create_users as select 'CREATE USER ' || sys.dq(ui.name)
|| ' WITH ENCRYPTED PASSWORD ' || sys.sq(sys.password_hash(ui.name)) || ' NAME
' || sys.sq(ui.fullname) || ' SCHEMA sys;' stmt from sys.db_user_info ui,
sys.schemas s where ui.default_schema = s.id and ui.name <> 'monetdb' and
ui.name <> '.snapshot';
-create view sys.dump_foreign_keys as select 'ALTER TABLE ' || sys.dq(fk_s) ||
'.'|| sys.dq(fk_t) || ' ADD CONSTRAINT ' || sys.dq(fk) || ' ' || 'FOREIGN KEY('
|| group_concat(sys.dq(fk_c), ',') ||') ' || 'REFERENCES ' || sys.dq(pk_s) ||
'.' || sys.dq(pk_t) || '(' || group_concat(sys.dq(pk_c), ',') || ') ' || 'ON
DELETE ' || on_delete || ' ON UPDATE ' || on_update || ';' stmt from
sys.describe_foreign_keys group by fk_s, fk_t, pk_s, pk_t, fk, on_delete,
on_update;
-create view sys.dump_functions as select f.o o, sys.schema_guard(f.sch, f.fun,
f.def) stmt from sys.describe_functions f;
-create view sys.dump_grant_user_privileges as select 'GRANT ' ||
sys.dq(a2.name) || ' ' || ifthenelse(a1.name = 'public', 'PUBLIC',
sys.dq(a1.name)) || ';' stmt from sys.auths a1, sys.auths a2, sys.user_role ur
where a1.id = ur.login_id and a2.id = ur.role_id;
-create view sys.dump_indices as select 'CREATE ' || tpe || ' ' || sys.dq(ind)
|| ' ON ' || sys.dq(sch) || '.' || sys.dq(tbl) || '(' || group_concat(col) ||
');' stmt from sys.describe_indices group by ind, tpe, sch, tbl;
-create view sys.dump_partition_tables as select sys.alter_table(m_sch, m_tbl)
|| ' ADD TABLE ' || sys.fqn(p_sch, p_tbl) || case when tpe = 'VALUES' then ' AS
PARTITION IN (' || pvalues || ')' when tpe = 'RANGE' then ' AS PARTITION FROM '
|| ifthenelse(minimum is not null, sys.sq(minimum), 'RANGE MINVALUE') || ' TO '
|| ifthenelse(maximum is not null, sys.sq(maximum), 'RANGE MAXVALUE') when tpe
= 'FOR NULLS' then ' AS PARTITION FOR NULL VALUES' else '' end || case when tpe
in ('VALUES', 'RANGE') and with_nulls then ' WITH NULL VALUES' else '' end ||
';' stmt from sys.describe_partition_tables;
-create view sys.dump_privileges as select 'INSERT INTO sys.privileges VALUES
(' || case when dp.o_tpe = 'GLOBAL' then '0,' when dp.o_tpe = 'TABLE' then
'(SELECT t.id FROM sys.schemas s, sys.tables t WHERE s.id = t.schema_id' || '
AND s.name || \'.\' || t.name =' || sys.sq(dp.o_nme) || '),' when dp.o_tpe =
'COLUMN' then '(SELECT c.id FROM sys.schemas s, sys.tables t, sys.columns c
WHERE s.id = t.schema_id AND t.id = c.table_id' || ' AND s.name || \'.\' ||
t.name || \'.\' || c.name =' || sys.sq(dp.o_nme) || '),' else '(SELECT fqn.id
FROM sys.fully_qualified_functions fqn WHERE' || ' fqn.nme = ' ||
sys.sq(dp.o_nme) || ' AND fqn.tpe = ' || sys.sq(dp.o_tpe) || '),' end ||
'(SELECT id FROM sys.auths a WHERE a.name = ' || sys.sq(dp.a_nme) || '),' ||
'(SELECT pc.privilege_code_id FROM sys.privilege_codes pc WHERE
pc.privilege_code_name = ' || sys.sq(p_nme) || '),' '(SELECT id FROM sys.auths
g WHERE g.name = ' || sys.sq(dp.g_nme) || '),' || dp.grantable || ');' stmt
from sys.describe_privile
ges dp;
-create view sys.dump_sequences as select 'CREATE SEQUENCE ' || sys.fqn(sch,
seq) || ' AS BIGINT ' || case when "s" <> 0 then 'START WITH ' || "rs" else ''
end || case when "inc" <> 1 then ' INCREMENT BY ' || "inc" else '' end || case
when "mi" <> 0 then ' MINVALUE ' || "mi" else '' end || case when "ma" <> 0
then ' MAXVALUE ' || "ma" else '' end || case when "cache" <> 1 then ' CACHE '
|| "cache" else '' end || case when "cycle" then ' CYCLE' else '' end || ';'
stmt from sys.describe_sequences;
-create view sys.dump_start_sequences as select 'UPDATE sys.sequences seq SET
start = ' || s || ' WHERE name = ' || sys.sq(seq) || ' AND schema_id = (SELECT
s.id FROM sys.schemas s WHERE s.name = ' || sys.sq(sch) || ');' stmt from
sys.describe_sequences;
-create view sys.dump_table_constraint_type as select 'ALTER TABLE ' ||
sys.dq(sch) || '.' || sys.dq(tbl) || ' ADD CONSTRAINT ' || sys.dq(con) || ' '||
tpe || ' (' || group_concat(sys.dq(col), ', ') || ');' stmt from
sys.describe_constraints group by sch, tbl, con, tpe;
-create view sys.dump_tables as select t.o o, case when t.typ <> 'VIEW' then
'CREATE ' || t.typ || ' ' || sys.fqn(t.sch, t.tab) || t.col || t.opt || ';'
else t.opt end stmt from sys.describe_tables t;
-create view sys.dump_triggers as select sys.schema_guard(sch, tab, def) stmt
from sys.describe_triggers;
-create view sys.dump_user_defined_types as select 'CREATE TYPE ' ||
sys.fqn(sch, sql_tpe) || ' EXTERNAL NAME ' || sys.dq(ext_tpe) || ';' stmt from
sys.describe_user_defined_types;
+create view sys.dump_create_roles as select 'CREATE ROLE ' || sys.dq(name) ||
';' stmt, name user_name from sys.auths where name not in (select name from
sys.db_user_info) and grantor <> 0;
+create view sys.dump_create_schemas as select 'CREATE SCHEMA ' ||
sys.dq(s.name) || ifthenelse(a.name <> 'sysadmin', ' AUTHORIZATION ' ||
sys.dq(a.name), ' ') || ';' stmt, s.name schema_name from sys.schemas s,
sys.auths a where s.authorization = a.id and s.system = false;
+create view sys.dump_create_users as select 'CREATE USER ' || sys.dq(ui.name)
|| ' WITH ENCRYPTED PASSWORD ' || sys.sq(sys.password_hash(ui.name)) || ' NAME
' || sys.sq(ui.fullname) || ' SCHEMA sys;' stmt, ui.name user_name from
sys.db_user_info ui, sys.schemas s where ui.default_schema = s.id and ui.name
<> 'monetdb' and ui.name <> '.snapshot';
+create view sys.dump_foreign_keys as select 'ALTER TABLE ' || sys.dq(fk_s) ||
'.'|| sys.dq(fk_t) || ' ADD CONSTRAINT ' || sys.dq(fk) || ' ' || 'FOREIGN KEY('
|| group_concat(sys.dq(fk_c), ',') ||') ' || 'REFERENCES ' || sys.dq(pk_s) ||
'.' || sys.dq(pk_t) || '(' || group_concat(sys.dq(pk_c), ',') || ') ' || 'ON
DELETE ' || on_delete || ' ON UPDATE ' || on_update || ';' stmt, fk_s
foreign_schema_name, fk_t foreign_table_name, pk_s primary_schema_name, pk_t
primary_table_name, fk key_name from sys.describe_foreign_keys group by fk_s,
fk_t, pk_s, pk_t, fk, on_delete, on_update;
+create view sys.dump_function_grants as with func_args_all(func_id, number,
max_number, func_arg) as (select a.func_id, a.number, max(a.number) over
(partition by a.func_id order by a.number desc),
group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ', ') over
(partition by a.func_id order by a.number) from sys.args a where a.inout = 1),
func_args(func_id, func_arg) as (select func_id, func_arg from func_args_all
where number = max_number) select 'GRANT ' || pc.privilege_code_name || ' ON '
|| ft.function_type_keyword || ' ' || sys.dq(s.name) || '.' || sys.dq(f.name)
|| '(' || coalesce(fa.func_arg, '') || ') TO ' || ifthenelse(a.name = 'public',
'PUBLIC', sys.dq(a.name)) || case when p.grantable = 1 then ' WITH GRANT
OPTION' else '' end || ';' stmt, s.name schema_name, f.name function_name,
a.name grantee from sys.schemas s, sys.functions f left outer join func_args fa
on f.id = fa.func_id, sys.auths a, sys.privileges p, sys.auths g,
sys.function_types ft, sys.privi
lege_codes pc where s.id = f.schema_id and f.id = p.obj_id and p.auth_id =
a.id and p.grantor = g.id and p.privileges = pc.privilege_code_id and f.type =
ft.function_type_id and not f.system order by s.name, f.name, a.name, g.name,
p.grantable;
+create view sys.dump_functions as select f.o o, sys.schema_guard(f.sch, f.fun,
f.def) stmt, f.sch schema_name, f.fun function_name from sys.describe_functions
f;
+create view sys.dump_grant_user_privileges as select 'GRANT ' ||
sys.dq(a2.name) || ' ' || ifthenelse(a1.name = 'public', 'PUBLIC',
sys.dq(a1.name)) || ';' stmt, a2.name grantee, a1.name grantor from sys.auths
a1, sys.auths a2, sys.user_role ur where a1.id = ur.login_id and a2.id =
ur.role_id;
+create view sys.dump_indices as select 'CREATE ' || tpe || ' ' || sys.dq(ind)
|| ' ON ' || sys.dq(sch) || '.' || sys.dq(tbl) || '(' || group_concat(col) ||
');' stmt, sch schema_name, tbl table_name, ind index_name from
sys.describe_indices group by ind, tpe, sch, tbl;
+create view sys.dump_partition_tables as select sys.alter_table(m_sch, m_tbl)
|| ' ADD TABLE ' || sys.fqn(p_sch, p_tbl) || case when tpe = 'VALUES' then ' AS
PARTITION IN (' || pvalues || ')' when tpe = 'RANGE' then ' AS PARTITION FROM '
|| ifthenelse(minimum is not null, sys.sq(minimum), 'RANGE MINVALUE') || ' TO '
|| ifthenelse(maximum is not null, sys.sq(maximum), 'RANGE MAXVALUE') when tpe
= 'FOR NULLS' then ' AS PARTITION FOR NULL VALUES' else '' end || case when tpe
in ('VALUES', 'RANGE') and with_nulls then ' WITH NULL VALUES' else '' end ||
';' stmt, m_sch merge_schema_name, m_tbl merge_table_name, p_sch
partition_schema_name, p_tbl partition_table_name from
sys.describe_partition_tables;
+create view sys.dump_sequences as select 'CREATE SEQUENCE ' || sys.fqn(sch,
seq) || ' AS BIGINT ' || case when "s" <> 0 then 'START WITH ' || "rs" else ''
end || case when "inc" <> 1 then ' INCREMENT BY ' || "inc" else '' end || case
when "mi" <> 0 then ' MINVALUE ' || "mi" else '' end || case when "ma" <> 0
then ' MAXVALUE ' || "ma" else '' end || case when "cache" <> 1 then ' CACHE '
|| "cache" else '' end || case when "cycle" then ' CYCLE' else '' end || ';'
stmt, sch schema_name, seq seqname from sys.describe_sequences;
+create view sys.dump_start_sequences as select 'UPDATE sys.sequences seq SET
start = ' || s || ' WHERE name = ' || sys.sq(seq) || ' AND schema_id = (SELECT
s.id FROM sys.schemas s WHERE s.name = ' || sys.sq(sch) || ');' stmt, sch
schema_name, seq sequence_name from sys.describe_sequences;
+create view sys.dump_table_constraint_type as select 'ALTER TABLE ' ||
sys.dq(sch) || '.' || sys.dq(tbl) || ' ADD CONSTRAINT ' || sys.dq(con) || ' '||
tpe || ' (' || group_concat(sys.dq(col), ', ') || ');' stmt, sch schema_name,
tbl table_name, con constraint_name from sys.describe_constraints group by sch,
tbl, con, tpe;
+create view sys.dump_table_grants as with table_grants (sname, tname, grantee,
grants, grantor, grantable) as (select s.name, t.name, a.name,
sum(p.privileges), g.name, p.grantable from sys.schemas s, sys.tables t,
sys.auths a, sys.privileges p, sys.auths g where p.obj_id = t.id and p.auth_id
= a.id and t.schema_id = s.id and t.system = false and p.grantor = g.id group
by s.name, t.name, a.name, g.name, p.grantable order by s.name, t.name, a.name,
g.name, p.grantable) select 'GRANT ' || pc.privilege_code_name || ' ON TABLE '
|| sys.dq(sname) || '.' || sys.dq(tname) || ' TO ' || ifthenelse(grantee =
'public', 'PUBLIC', sys.dq(grantee)) || case when grantable = 1 then ' WITH
GRANT OPTION' else '' end || ';' stmt, sname schema_name, tname table_name,
grantee from table_grants left outer join sys.privilege_codes pc on grants =
pc.privilege_code_id;
+create view sys.dump_tables as select t.o o, case when t.typ <> 'VIEW' then
'CREATE ' || t.typ || ' ' || sys.fqn(t.sch, t.tab) || t.col || t.opt || ';'
else t.opt end stmt, t.sch schema_name, t.tab table_name from
sys.describe_tables t;
+create view sys.dump_triggers as select sys.schema_guard(sch, tab, def) stmt,
sch schema_name, tab table_name, tri trigger_name from sys.describe_triggers;
+create view sys.dump_user_defined_types as select 'CREATE TYPE ' ||
sys.fqn(sch, sql_tpe) || ' EXTERNAL NAME ' || sys.dq(ext_tpe) || ';' stmt, sch
schema_name, sql_tpe type_name from sys.describe_user_defined_types;
create view sys.environment as select * from sys.env();
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 s.name ||
'.' || f.name || '()' else 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.geometry_columns as select cast(null as varchar(1)) as
f_table_catalog, s.name as f_table_schema, t.name as f_table_name, c.name as
f_geometry_column, cast(has_z(c.type_digits) + has_m(c.type_digits) +2 as
integer) as coord_dimension, c.type_scale as srid, get_type(c.type_digits, 0)
as type from sys.columns c, sys.tables t, sys.schemas s where c.table_id = t.id
and t.schema_id = s.id and c.type in (select sqlname from sys.types where
systemname in ('wkb', 'wkba'));
@@ -1080,7 +1084,6 @@ create view sys.tablestoragemodel as sel
create view sys.tracelog as select * from sys.tracelog();
create view sys.users as select u."name" as "name", ui."fullname",
ui."default_schema", ui."schema_path" from sys.db_users() as u left join
"sys"."db_user_info" as ui on u."name" = ui."name";
create view sys.var_values (var_name, value) as select 'current_role',
current_role union all select 'current_schema', current_schema union all select
'current_timezone', current_timezone union all select 'current_user',
current_user union all select 'debug', debug union all select 'last_id',
last_id union all select 'optimizer', optimizer union all select 'pi', pi()
union all select 'rowcnt', rowcnt;
-create procedure sys._dump_table_data(sch string, tbl string) begin declare k
int; set k = (select min(c.id) from sys.columns c, sys.tables t where
c.table_id = t.id and t.name = tbl); if k is not null then declare cname
string; declare ctype string; set cname = (select c.name from sys.columns c
where c.id = k); set ctype = (select c.type from sys.columns c where c.id = k);
declare copy_into_stmt string; declare _cnt int; set _cnt = (select
min(s.count) from sys.storage() s where s.schema = sch and s.table = tbl); if
_cnt > 0 then set copy_into_stmt = 'COPY ' || _cnt || ' RECORDS INTO ' ||
sys.fqn(sch, tbl) || '(' || sys.dq(cname); declare select_data_stmt string; set
select_data_stmt = 'SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK()
OVER(), ' || sys.prepare_esc(cname, ctype); declare m int; set m = (select
max(c.id) from sys.columns c, sys.tables t where c.table_id = t.id and t.name =
tbl); while (k < m) do set k = (select min(c.id) from sys.columns c, sys.tables
t wher
e c.table_id = t.id and t.name = tbl and c.id > k); set cname = (select c.name
from sys.columns c where c.id = k); set ctype = (select c.type from sys.columns
c where c.id = k); set copy_into_stmt = (copy_into_stmt || ', ' ||
sys.dq(cname)); set select_data_stmt = select_data_stmt || '|| \'|\' || ' ||
sys.prepare_esc(cname, ctype); end while; set copy_into_stmt = (copy_into_stmt
|| ') FROM STDIN USING DELIMITERS \'|\',E\'\\n\',\'"\';'); set select_data_stmt
= select_data_stmt || ' FROM ' || sys.fqn(sch, tbl); insert into
sys.dump_statements values ((select count(*) from sys.dump_statements) + 1,
copy_into_stmt); call sys.eval('INSERT INTO sys.dump_statements ' ||
select_data_stmt || ';'); end if; end if; end;
create function "abbrev" (p inet) returns clob external name inet."abbrev";
create function alpha(pdec double, pradius double) returns double external
name sql.alpha;
create function sys.alter_table(s string, t string) returns string begin
return 'ALTER TABLE ' || sys.fqn(s, t) || ' '; end;
@@ -1148,8 +1151,9 @@ create function sys.describe_type(ctype
end;
create function sys.dq (s string) returns string begin return '"' ||
sys.replace(s,'"','""') || '"'; end;
create procedure sys.droporderindex(sys string, tab string, col string)
external name sql.droporderindex;
-create function sys.dump_database(describe boolean) returns table(o int, stmt
string) begin set schema sys; truncate sys.dump_statements; insert into
sys.dump_statements values (1, 'START TRANSACTION;'); insert into
sys.dump_statements values ((select count(*) from sys.dump_statements) + 1,
'SET SCHEMA "sys";'); insert into sys.dump_statements select (select count(*)
from sys.dump_statements) + rank() over(), stmt from sys.dump_create_roles;
insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt from sys.dump_create_users; insert
into sys.dump_statements select (select count(*) from sys.dump_statements) +
rank() over(), stmt from sys.dump_create_schemas; insert into
sys.dump_statements select (select count(*) from sys.dump_statements) + rank()
over(), stmt from sys.dump_user_defined_types; insert into sys.dump_statements
select (select count(*) from sys.dump_statements) + rank() over(), stmt from
sys.dump_add_schemas_to_users; insert
into sys.dump_statements select (select count(*) from sys.dump_statements) +
rank() over(), stmt from sys.dump_grant_user_privileges; insert into
sys.dump_statements select (select count(*) from sys.dump_statements) + rank()
over(), stmt from sys.dump_sequences; insert into sys.dump_statements select
(select count(*) from sys.dump_statements) + rank() over(), stmt from
sys.dump_start_sequences; insert into sys.dump_statements select (select
count(*) from sys.dump_statements) + rank() over(order by stmts.o), stmts.s
from (select * from sys.dump_functions f union select * from sys.dump_tables t)
as stmts(o, s); insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt from sys.dump_column_defaults;
insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt from sys.dump_table_constraint_type;
insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt
from sys.dump_indices; insert into sys.dump_statements select (select count(*)
from sys.dump_statements) + rank() over(), stmt from sys.dump_foreign_keys;
insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt from sys.dump_partition_tables;
insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt from sys.dump_triggers; insert into
sys.dump_statements select (select count(*) from sys.dump_statements) + rank()
over(), stmt from sys.dump_comments; insert into sys.dump_statements values
((select count(*) from sys.dump_statements) + 1, 'TRUNCATE sys.privileges;');
insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt from sys.dump_privileges; if not
describe then call sys.dump_table_data(); end if; insert into
sys.dump_statements values ((select count(*) from sys.dump_statements) + 1,
'COMMIT;'); return sys.dump_statements; end;
-create procedure sys.dump_table_data() begin declare i int; set i = (select
min(t.id) from sys.tables t, sys.table_types ts where t.type = ts.table_type_id
and ts.table_type_name = 'TABLE' and not t.system); if i is not null then
declare m int; set m = (select max(t.id) from sys.tables t, sys.table_types ts
where t.type = ts.table_type_id and ts.table_type_name = 'TABLE' and not
t.system); declare sch string; declare tbl string; while i < m do set sch =
(select s.name from sys.tables t, sys.schemas s where s.id = t.schema_id and
t.id = i); set tbl = (select t.name from sys.tables t, sys.schemas s where s.id
= t.schema_id and t.id = i); call sys._dump_table_data(sch, tbl); set i =
(select min(t.id) from sys.tables t, sys.table_types ts where t.type =
ts.table_type_id and ts.table_type_name = 'TABLE' and not t.system and t.id >
i); end while; set sch = (select s.name from sys.tables t, sys.schemas s where
s.id = t.schema_id and t.id = i); set tbl = (select t.name from sys.tables t, sy
s.schemas s where s.id = t.schema_id and t.id = i); call
sys._dump_table_data(sch, tbl); end if; end;
+create function sys.dump_database(describe boolean) returns table(o int, stmt
string) begin set schema sys; truncate sys.dump_statements; insert into
sys.dump_statements values (1, 'START TRANSACTION;'); insert into
sys.dump_statements values ((select count(*) from sys.dump_statements) + 1,
'SET SCHEMA "sys";'); insert into sys.dump_statements select (select count(*)
from sys.dump_statements) + rank() over(), stmt from sys.dump_create_roles;
insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt from sys.dump_create_users; insert
into sys.dump_statements select (select count(*) from sys.dump_statements) +
rank() over(), stmt from sys.dump_create_schemas; insert into
sys.dump_statements select (select count(*) from sys.dump_statements) + rank()
over(), stmt from sys.dump_user_defined_types; insert into sys.dump_statements
select (select count(*) from sys.dump_statements) + rank() over(), stmt from
sys.dump_add_schemas_to_users; insert
into sys.dump_statements select (select count(*) from sys.dump_statements) +
rank() over(), stmt from sys.dump_grant_user_privileges; insert into
sys.dump_statements select (select count(*) from sys.dump_statements) + rank()
over(), stmt from sys.dump_sequences; insert into sys.dump_statements select
(select count(*) from sys.dump_statements) + rank() over(order by stmts.o),
stmts.s from (select f.o, f.stmt from sys.dump_functions f union select t.o,
t.stmt from sys.dump_tables t) as stmts(o, s); insert into sys.dump_statements
select (select count(*) from sys.dump_statements) + rank() over(), stmt from
sys.dump_start_sequences; insert into sys.dump_statements select (select
count(*) from sys.dump_statements) + rank() over(), stmt from
sys.dump_column_defaults; insert into sys.dump_statements select (select
count(*) from sys.dump_statements) + rank() over(), stmt from
sys.dump_table_constraint_type; insert into sys.dump_statements select (select
count(*) from sys.dump_statements) +
rank() over(), stmt from sys.dump_indices; insert into sys.dump_statements
select (select count(*) from sys.dump_statements) + rank() over(), stmt from
sys.dump_foreign_keys; insert into sys.dump_statements select (select count(*)
from sys.dump_statements) + rank() over(), stmt from sys.dump_partition_tables;
insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt from sys.dump_triggers; insert into
sys.dump_statements select (select count(*) from sys.dump_statements) + rank()
over(), stmt from sys.dump_comments; insert into sys.dump_statements select
(select count(*) from sys.dump_statements) + rank() over(), stmt from
sys.dump_table_grants; insert into sys.dump_statements select (select count(*)
from sys.dump_statements) + rank() over(), stmt from sys.dump_column_grants;
insert into sys.dump_statements select (select count(*) from
sys.dump_statements) + rank() over(), stmt from sys.dump_function_grants; if
not describe then call sys.
dump_table_data(); end if; insert into sys.dump_statements values ((select
count(*) from sys.dump_statements) + 1, 'COMMIT;'); return sys.dump_statements;
end;
+create procedure sys.dump_table_data() begin declare i int; set i = (select
min(t.id) from sys.tables t, sys.table_types ts where t.type = ts.table_type_id
and ts.table_type_name = 'TABLE' and not t.system); if i is not null then
declare m int; set m = (select max(t.id) from sys.tables t, sys.table_types ts
where t.type = ts.table_type_id and ts.table_type_name = 'TABLE' and not
t.system); declare sch string; declare tbl string; while i < m do set sch =
(select s.name from sys.tables t, sys.schemas s where s.id = t.schema_id and
t.id = i); set tbl = (select t.name from sys.tables t, sys.schemas s where s.id
= t.schema_id and t.id = i); call sys.dump_table_data(sch, tbl); set i =
(select min(t.id) from sys.tables t, sys.table_types ts where t.type =
ts.table_type_id and ts.table_type_name = 'TABLE' and not t.system and t.id >
i); end while; set sch = (select s.name from sys.tables t, sys.schemas s where
s.id = t.schema_id and t.id = i); set tbl = (select t.name from sys.tables t,
sys
.schemas s where s.id = t.schema_id and t.id = i); call
sys.dump_table_data(sch, tbl); end if; end;
+create procedure sys.dump_table_data(sch string, tbl string) begin declare k
int; set k = (select min(c.id) from sys.columns c, sys.tables t, sys.schemas s
where c.table_id = t.id and t.name = tbl and t.schema_id = s.id and s.name =
sch); if k is not null then declare cname string; declare ctype string; set
cname = (select c.name from sys.columns c where c.id = k); set ctype = (select
c.type from sys.columns c where c.id = k); declare copy_into_stmt string;
declare _cnt int; set _cnt = (select count from sys.storage(sch, tbl, cname));
if _cnt > 0 then set copy_into_stmt = 'COPY ' || _cnt || ' RECORDS INTO ' ||
sys.fqn(sch, tbl) || '(' || sys.dq(cname); declare select_data_stmt string; set
select_data_stmt = 'SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK()
OVER(), ' || sys.prepare_esc(cname, ctype); declare m int; set m = (select
max(c.id) from sys.columns c, sys.tables t where c.table_id = t.id and t.name =
tbl); while (k < m) do set k = (select min(c.id) from sys.columns
c, sys.tables t where c.table_id = t.id and t.name = tbl and c.id > k); set
cname = (select c.name from sys.columns c where c.id = k); set ctype = (select
c.type from sys.columns c where c.id = k); set copy_into_stmt = (copy_into_stmt
|| ', ' || sys.dq(cname)); set select_data_stmt = select_data_stmt || '|| \'|\'
|| ' || sys.prepare_esc(cname, ctype); end while; set copy_into_stmt =
(copy_into_stmt || ') FROM STDIN USING DELIMITERS \'|\',E\'\\n\',\'"\';'); set
select_data_stmt = select_data_stmt || ' FROM ' || sys.fqn(sch, tbl); insert
into sys.dump_statements values ((select count(*) from sys.dump_statements) +
1, copy_into_stmt); call sys.eval('INSERT INTO sys.dump_statements ' ||
select_data_stmt || ';'); end if; end if; end;
CREATE FUNCTION env() RETURNS TABLE(name varchar(1024), value varchar(2048))
EXTERNAL NAME inspect."getEnvironment";
create function sys.epoch(sec decimal(18,3)) returns timestamp with time zone
external name mtime.epoch;
create function sys.epoch(sec int) returns timestamp with time zone external
name mtime.epoch;
@@ -1314,7 +1318,7 @@ create procedure shpload(fid integer) ex
create procedure shpload(fid integer, filter geometry) external name
shp.import;
create procedure sys.shutdown(delay tinyint) external name sql.shutdown;
create procedure sys.shutdown(delay tinyint, force bool) external name
sql.shutdown;
-create function sys.sq (s string) returns string begin return ' \'' ||
sys.replace(s,'\'','\'\'') || '\' '; end;
+create function sys.sq (s string) returns string begin return '\'' ||
sys.replace(s,'\'','\'\'') || '\''; end;
create function st_area(geom geometry) returns double external name
geom."Area";
create function st_asbinary(geom geometry) returns string external name
geom."AsBinary";
create function st_asewkt(geom geometry) returns string external name
geom."AsEWKT";
@@ -1974,7 +1978,7 @@ select 'null in value_partitions.value',
[ "sys._tables", "sys", "describe_comments", "create view
sys.describe_comments as select o.id id, o.tpe tpe, o.nme fqn, c.remark rem
from (select id, 'SCHEMA', sys.dq(name) from sys.schemas union all select t.id,
case when ts.table_type_name = 'VIEW' then 'VIEW' else 'TABLE' end,
sys.fqn(s.name, t.name) from sys.schemas s join sys.tables t on s.id =
t.schema_id join sys.table_types ts on t.type = ts.table_type_id where not
s.name <> 'tmp' union all select c.id, 'COLUMN', sys.fqn(s.name, t.name) || '.'
|| sys.dq(c.name) from sys.columns c, sys.tables t, sys.schemas s where
c.table_id = t.id and t.schema_id = s.id union all select idx.id, 'INDEX',
sys.fqn(s.name, idx.name) from sys.idxs idx, sys._tables t, sys.schemas s where
idx.table_id = t.id and t.schema_id = s.id 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) as o(id, tpe, nme) join sys.comments c on c.id =
o.id;", "VIEW", true, "COMMIT", "WRITABLE" ]
[ "sys._tables", "sys", "describe_constraints", "create view
sys.describe_constraints as select s.name sch, t.name tbl, kc.name col, k.name
con, case when k.type = 0 then 'PRIMARY KEY' when k.type = 1 then 'UNIQUE' end
tpe from sys.schemas s, sys._tables t, sys.objects kc, sys.keys k where kc.id =
k.id and k.table_id = t.id and s.id = t.schema_id and t.system = false and
k.type in (0, 1) and t.type in (0, 6);", "VIEW", true, "COMMIT",
"WRITABLE" ]
[ "sys._tables", "sys", "describe_foreign_keys", "create view
sys.describe_foreign_keys as with action_type (id, act) as (values (0, 'NO
ACTION'), (1, 'CASCADE'), (2, 'RESTRICT'), (3, 'SET NULL'), (4, 'SET DEFAULT'))
select fs.name fk_s, fkt.name fk_t, fkkc.name fk_c, fkkc.nr o, fkk.name fk,
ps.name pk_s, pkt.name pk_t, pkkc.name pk_c, ou.act on_update, od.act on_delete
from sys._tables fkt, sys.objects fkkc, sys.keys fkk, sys._tables pkt,
sys.objects pkkc, sys.keys pkk, sys.schemas ps, sys.schemas fs, action_type ou,
action_type od where fkt.id = fkk.table_id and pkt.id = pkk.table_id and fkk.id
= fkkc.id and pkk.id = pkkc.id and fkk.rkey = pkk.id and fkkc.nr = pkkc.nr and
pkt.schema_id = ps.id and fkt.schema_id = fs.id and (fkk.\"action\" & 255) =
od.id and ((fkk.\"action\" >> 8) & 255) = ou.id order by fkk.name, fkkc.nr;",
"VIEW", true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "describe_functions", "create view
sys.describe_functions as select f.id o, s.name sch, f.name fun, f.func def
from sys.functions f join sys.schemas s on f.schema_id = s.id where s.name <>
'tmp' and not f.system;", "VIEW", true, "COMMIT", "WRITABLE"
]
+[ "sys._tables", "sys", "describe_functions", "create view
sys.describe_functions as with func_args_all(func_id, number, max_number,
func_arg) as (select func_id, number, max(number) over (partition by func_id
order by number desc), group_concat(sys.dq(name) || ' ' ||
sys.describe_type(type, type_digits, type_scale),', ') over (partition by
func_id order by number) from sys.args where inout = 1), func_args(func_id,
func_arg) as (select func_id, func_arg from func_args_all where number =
max_number), func_rets_all(func_id, number, max_number, func_ret,
func_ret_type) as (select func_id, number, max(number) over (partition by
func_id order by number desc), group_concat(sys.dq(name) || ' ' ||
sys.describe_type(type, type_digits, type_scale),', ') over (partition by
func_id order by number), group_concat(sys.describe_type(type, type_digits,
type_scale),', ') over (partition by func_id order by number) from sys.args
where inout = 0), func_rets(func_id, func_ret, func_ret_type) as (select
func_id, func_ret, func_ret_type from func_rets_all where number =
max_number) select f.id o, s.name sch, f.name fun, case when f.language in (1,
2) then f.func else 'CREATE ' || ft.function_type_keyword || ' ' ||
sys.fqn(s.name, f.name) || '(' || coalesce(fa.func_arg, '') || ')' || case when
f.type = 5 then ' RETURNS TABLE (' || coalesce(fr.func_ret, '') || ')' when
f.type in (1,3) then ' RETURNS ' || fr.func_ret_type else '' end || case when
fl.language_keyword is null then '' else ' LANGUAGE ' || fl.language_keyword
end || ' ' || f.func end def from sys.functions f left outer join func_args fa
on fa.func_id = f.id left outer join func_rets fr on fr.func_id = f.id join
sys.schemas s on f.schema_id = s.id join sys.function_types ft on f.type =
ft.function_type_id left outer join sys.function_languages fl on f.language =
fl.language_id where s.name <> 'tmp' and not f.system;", "VIEW", true,
"COMMIT", "WRITABLE" ]
[ "sys._tables", "sys", "describe_indices", "create view
sys.describe_indices as with it (id, idx) as (values (0, 'INDEX'), (4,
'IMPRINTS INDEX'), (5, 'ORDERED INDEX')) select i.name ind, s.name sch, t.name
tbl, c.name col, it.idx tpe from sys.idxs as i left join sys.keys as k on
i.name = k.name, sys.objects as kc, sys._columns as c, sys.schemas s,
sys._tables as t, it where i.table_id = t.id and i.id = kc.id and kc.name =
c.name and t.id = c.table_id and t.schema_id = s.id and k.type is null and
i.type = it.id order by i.name, kc.nr;", "VIEW", true, "COMMIT",
"WRITABLE" ]
[ "sys._tables", "sys", "describe_partition_tables", "create view
sys.describe_partition_tables as select m_sch, m_tbl, p_sch, p_tbl, case when
p_raw_type is null then 'READ ONLY' when (p_raw_type = 'VALUES' and pvalues is
null) or (p_raw_type = 'RANGE' and minimum is null and maximum is null and
with_nulls) then 'FOR NULLS' else p_raw_type end as tpe, pvalues, minimum,
maximum, with_nulls from (with tp(\"type\", table_id) as (select case when
(table_partitions.\"type\" & 2) = 2 then 'VALUES' else 'RANGE' end,
table_partitions.table_id from sys.table_partitions), subq(m_tid, p_mid,
\"type\", m_sch, m_tbl, p_sch, p_tbl) as (select m_t.id, p_m.id, m_t.\"type\",
m_s.name, m_t.name, p_s.name, p_m.name from sys.schemas m_s, sys._tables m_t,
sys.dependencies d, sys.schemas p_s, sys._tables p_m where m_t.\"type\" in (3,
6) and m_t.schema_id = m_s.id and m_s.name <> 'tmp' and m_t.system = false and
m_t.id = d.depend_id and d.id = p_m.id and p_m.schema_id = p_s.id order by
m_t.id, p_m.id) se
lect subq.m_sch, subq.m_tbl, subq.p_sch, subq.p_tbl, tp.\"type\" as
p_raw_type, case when tp.\"type\" = 'VALUES' then (select
group_concat(vp.value, ',')from sys.value_partitions vp where vp.table_id =
subq.p_mid) else null end as pvalues, case when tp.\"type\" = 'RANGE' then
(select minimum from sys.range_partitions rp where rp.table_id = subq.p_mid)
else null end as minimum, case when tp.\"type\" = 'RANGE' then (select maximum
from sys.range_partitions rp where rp.table_id = subq.p_mid) else null end as
maximum, case when tp.\"type\" = 'VALUES' then exists(select vp.value from
sys.value_partitions vp where vp.table_id = subq.p_mid and vp.value is null)
else (select rp.with_nulls from sys.range_partitions rp where rp.table_id =
subq.p_mid) end as with_nulls from subq left outer join tp on subq.m_tid =
tp.table_id) as tmp_pi;", "VIEW", true, "COMMIT", "WRITABLE"
]
[ "sys._tables", "sys", "describe_privileges", "create view
sys.describe_privileges as select case when o.tpe is null and
pc.privilege_code_name = 'SELECT' then 'COPY FROM' when o.tpe is null and
pc.privilege_code_name = 'UPDATE' then 'COPY INTO' else o.nme end o_nme, case
when o.tpe is not null then o.tpe else 'GLOBAL' end o_tpe,
pc.privilege_code_name p_nme, a.name a_nme, g.name g_nme, p.grantable grantable
from sys.privileges p left join (select t.id, s.name || '.' || t.name , 'TABLE'
from sys.schemas s, sys.tables t where s.id = t.schema_id union all select
c.id, s.name || '.' || t.name || '.' || c.name, 'COLUMN' from sys.schemas s,
sys.tables t, sys.columns c where s.id = t.schema_id and t.id = c.table_id
union all select f.id, f.nme, f.tpe from sys.fully_qualified_functions f) o(id,
nme, tpe) on o.id = p.obj_id, sys.privilege_codes pc, auths a, auths g where
p.privileges = pc.privilege_code_id and p.auth_id = a.id and p.grantor =
g.id;", "VIEW", true, "COMMIT", "WRITABLE" ]
@@ -1982,25 +1986,27 @@ select 'null in value_partitions.value',
[ "sys._tables", "sys", "describe_tables", "create view
sys.describe_tables as select t.id o, s.name sch, t.name tab,
ts.table_type_name typ, (select ' (' || group_concat(sys.dq(c.name) || ' ' ||
sys.describe_type(c.type, c.type_digits, c.type_scale) || ifthenelse(c.\"null\"
= 'false', ' NOT NULL', '') , ', ') || ')' from sys._columns c where c.table_id
= t.id) col, case when ts.table_type_name = 'REMOTE TABLE' then
sys.get_remote_table_expressions(s.name, t.name) when ts.table_type_name =
'MERGE TABLE' then sys.get_merge_table_partition_expressions(t.id) when
ts.table_type_name = 'VIEW' then sys.schema_guard(s.name, t.name, t.query) else
'' end opt from sys.schemas s, sys.table_types ts, sys.tables t where
ts.table_type_name in ('TABLE', 'VIEW', 'MERGE TABLE', 'REMOTE TABLE', 'REPLICA
TABLE') and t.system = false and s.id = t.schema_id and ts.table_type_id =
t.type and s.name <> 'tmp';", "VIEW", true, "COMMIT", "WRITABLE"
]
[ "sys._tables", "sys", "describe_triggers", "create view
sys.describe_triggers as select s.name sch, t.name tab, tr.name tri,
tr.statement def from sys.schemas s, sys.tables t, sys.triggers tr where s.id =
t.schema_id and t.id = tr.table_id and not t.system;", "VIEW", true,
"COMMIT", "WRITABLE" ]
[ "sys._tables", "sys", "describe_user_defined_types", "create view
sys.describe_user_defined_types as select s.name sch, t.sqlname sql_tpe,
t.systemname ext_tpe from sys.types t join sys.schemas s on t.schema_id = s.id
where t.eclass = 18 and ((s.name = 'sys' and t.sqlname not in ('geometrya',
'mbr', 'url', 'inet', 'json', 'uuid', 'xml')) or (s.name <> 'sys'));", "VIEW",
true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_add_schemas_to_users", "create view
sys.dump_add_schemas_to_users as select 'ALTER USER ' || sys.dq(ui.name) || '
SET SCHEMA ' || sys.dq(s.name) || ';' stmt from sys.db_user_info ui,
sys.schemas s where ui.default_schema = s.id and ui.name <> 'monetdb' and
ui.name <> '.snapshot' and s.name <> 'sys';", "VIEW", true, "COMMIT",
"WRITABLE" ]
-[ "sys._tables", "sys", "dump_column_defaults", "create view
sys.dump_column_defaults as select 'ALTER TABLE ' || sys.fqn(sch, tbl) || '
ALTER COLUMN ' || sys.dq(col) || ' SET DEFAULT ' || def || ';' stmt from
sys.describe_column_defaults;", "VIEW", true, "COMMIT",
"WRITABLE" ]
+[ "sys._tables", "sys", "dump_add_schemas_to_users", "create view
sys.dump_add_schemas_to_users as select 'ALTER USER ' || sys.dq(ui.name) || '
SET SCHEMA ' || sys.dq(s.name) || ';' stmt, s.name schema_name, ui.name
user_name from sys.db_user_info ui, sys.schemas s where ui.default_schema =
s.id and ui.name <> 'monetdb' and ui.name <> '.snapshot' and s.name <> 'sys';",
"VIEW", true, "COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_column_defaults", "create view
sys.dump_column_defaults as select 'ALTER TABLE ' || sys.fqn(sch, tbl) || '
ALTER COLUMN ' || sys.dq(col) || ' SET DEFAULT ' || def || ';' stmt, sch
schema_name, tbl table_name, col column_name from
sys.describe_column_defaults;", "VIEW", true, "COMMIT", "WRITABLE"
]
+[ "sys._tables", "sys", "dump_column_grants", "create view
sys.dump_column_grants as select 'GRANT ' || pc.privilege_code_name || '(' ||
sys.dq(c.name) || ') ON ' || sys.dq(s.name) || '.' || sys.dq(t.name) || ' TO '
|| ifthenelse(a.name = 'public', 'PUBLIC', sys.dq(a.name)) || case when
p.grantable = 1 then ' WITH GRANT OPTION' else '' end || ';' stmt, s.name
schema_name, t.name table_name, c.name column_name, a.name grantee from
sys.schemas s, sys.tables t, sys.columns c, sys.auths a, sys.privileges p,
sys.auths g, sys.privilege_codes pc where p.obj_id = c.id and c.table_id = t.id
and p.auth_id = a.id and t.schema_id = s.id and not t.system and p.grantor =
g.id and p.privileges = pc.privilege_code_id order by s.name, t.name, c.name,
a.name, g.name, p.grantable;", "VIEW", true, "COMMIT",
"WRITABLE" ]
[ "sys._tables", "sys", "dump_comments", "create view
sys.dump_comments as select 'COMMENT ON ' || c.tpe || ' ' || c.fqn || ' IS ' ||
sys.sq(c.rem) || ';' stmt from sys.describe_comments c;", "VIEW", true,
"COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_create_roles", "create view
sys.dump_create_roles as select 'CREATE ROLE ' || sys.dq(name) || ';' stmt from
sys.auths where name not in (select name from sys.db_user_info) and grantor <>
0;", "VIEW", true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_create_schemas", "create view
sys.dump_create_schemas as select 'CREATE SCHEMA ' || sys.dq(s.name) ||
ifthenelse(a.name <> 'sysadmin', ' AUTHORIZATION ' || a.name, ' ') || ';' stmt
from sys.schemas s, sys.auths a where s.authorization = a.id and s.system =
false;", "VIEW", true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_create_users", "create view
sys.dump_create_users as select 'CREATE USER ' || sys.dq(ui.name) || ' WITH
ENCRYPTED PASSWORD ' || sys.sq(sys.password_hash(ui.name)) || ' NAME ' ||
sys.sq(ui.fullname) || ' SCHEMA sys;' stmt from sys.db_user_info ui,
sys.schemas s where ui.default_schema = s.id and ui.name <> 'monetdb' and
ui.name <> '.snapshot';", "VIEW", true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_foreign_keys", "create view
sys.dump_foreign_keys as select 'ALTER TABLE ' || sys.dq(fk_s) || '.'||
sys.dq(fk_t) || ' ADD CONSTRAINT ' || sys.dq(fk) || ' ' || 'FOREIGN KEY(' ||
group_concat(sys.dq(fk_c), ',') ||') ' || 'REFERENCES ' || sys.dq(pk_s) || '.'
|| sys.dq(pk_t) || '(' || group_concat(sys.dq(pk_c), ',') || ') ' || 'ON DELETE
' || on_delete || ' ON UPDATE ' || on_update || ';' stmt from
sys.describe_foreign_keys group by fk_s, fk_t, pk_s, pk_t, fk, on_delete,
on_update;", "VIEW", true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_functions", "create view
sys.dump_functions as select f.o o, sys.schema_guard(f.sch, f.fun, f.def) stmt
from sys.describe_functions f;", "VIEW", true, "COMMIT", "WRITABLE"
]
-[ "sys._tables", "sys", "dump_grant_user_privileges", "create view
sys.dump_grant_user_privileges as select 'GRANT ' || sys.dq(a2.name) || ' ' ||
ifthenelse(a1.name = 'public', 'PUBLIC', sys.dq(a1.name)) || ';' stmt from
sys.auths a1, sys.auths a2, sys.user_role ur where a1.id = ur.login_id and
a2.id = ur.role_id;", "VIEW", true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_indices", "create view sys.dump_indices
as select 'CREATE ' || tpe || ' ' || sys.dq(ind) || ' ON ' || sys.dq(sch) ||
'.' || sys.dq(tbl) || '(' || group_concat(col) || ');' stmt from
sys.describe_indices group by ind, tpe, sch, tbl;", "VIEW", true, "COMMIT",
"WRITABLE" ]
-[ "sys._tables", "sys", "dump_partition_tables", "create view
sys.dump_partition_tables as select sys.alter_table(m_sch, m_tbl) || ' ADD
TABLE ' || sys.fqn(p_sch, p_tbl) || case when tpe = 'VALUES' then ' AS
PARTITION IN (' || pvalues || ')' when tpe = 'RANGE' then ' AS PARTITION FROM '
|| ifthenelse(minimum is not null, sys.sq(minimum), 'RANGE MINVALUE') || ' TO '
|| ifthenelse(maximum is not null, sys.sq(maximum), 'RANGE MAXVALUE') when tpe
= 'FOR NULLS' then ' AS PARTITION FOR NULL VALUES' else '' end || case when tpe
in ('VALUES', 'RANGE') and with_nulls then ' WITH NULL VALUES' else '' end ||
';' stmt from sys.describe_partition_tables;", "VIEW", true, "COMMIT",
"WRITABLE" ]
-[ "sys._tables", "sys", "dump_privileges", "create view
sys.dump_privileges as select 'INSERT INTO sys.privileges VALUES (' || case
when dp.o_tpe = 'GLOBAL' then '0,' when dp.o_tpe = 'TABLE' then '(SELECT t.id
FROM sys.schemas s, sys.tables t WHERE s.id = t.schema_id' || ' AND s.name ||
\\'.\\' || t.name =' || sys.sq(dp.o_nme) || '),' when dp.o_tpe = 'COLUMN' then
'(SELECT c.id FROM sys.schemas s, sys.tables t, sys.columns c WHERE s.id =
t.schema_id AND t.id = c.table_id' || ' AND s.name || \\'.\\' || t.name ||
\\'.\\' || c.name =' || sys.sq(dp.o_nme) || '),' else '(SELECT fqn.id FROM
sys.fully_qualified_functions fqn WHERE' || ' fqn.nme = ' || sys.sq(dp.o_nme)
|| ' AND fqn.tpe = ' || sys.sq(dp.o_tpe) || '),' end || '(SELECT id FROM
sys.auths a WHERE a.name = ' || sys.sq(dp.a_nme) || '),' || '(SELECT
pc.privilege_code_id FROM sys.privilege_codes pc WHERE pc.privilege_code_name =
' || sys.sq(p_nme) || '),' '(SELECT id FROM sys.auths g WHERE g.name = ' ||
sys.sq(dp.g_nme) || '),' || d
p.grantable || ');' stmt from sys.describe_privileges dp;", "VIEW", true,
"COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_sequences", "create view
sys.dump_sequences as select 'CREATE SEQUENCE ' || sys.fqn(sch, seq) || ' AS
BIGINT ' || case when \"s\" <> 0 then 'START WITH ' || \"rs\" else '' end ||
case when \"inc\" <> 1 then ' INCREMENT BY ' || \"inc\" else '' end || case
when \"mi\" <> 0 then ' MINVALUE ' || \"mi\" else '' end || case when \"ma\" <>
0 then ' MAXVALUE ' || \"ma\" else '' end || case when \"cache\" <> 1 then '
CACHE ' || \"cache\" else '' end || case when \"cycle\" then ' CYCLE' else ''
end || ';' stmt from sys.describe_sequences;", "VIEW", true, "COMMIT",
"WRITABLE" ]
-[ "sys._tables", "sys", "dump_start_sequences", "create view
sys.dump_start_sequences as select 'UPDATE sys.sequences seq SET start = ' || s
|| ' WHERE name = ' || sys.sq(seq) || ' AND schema_id = (SELECT s.id FROM
sys.schemas s WHERE s.name = ' || sys.sq(sch) || ');' stmt from
sys.describe_sequences;", "VIEW", true, "COMMIT", "WRITABLE"
]
+[ "sys._tables", "sys", "dump_create_roles", "create view
sys.dump_create_roles as select 'CREATE ROLE ' || sys.dq(name) || ';' stmt,
name user_name from sys.auths where name not in (select name from
sys.db_user_info) and grantor <> 0;", "VIEW", true, "COMMIT",
"WRITABLE" ]
+[ "sys._tables", "sys", "dump_create_schemas", "create view
sys.dump_create_schemas as select 'CREATE SCHEMA ' || sys.dq(s.name) ||
ifthenelse(a.name <> 'sysadmin', ' AUTHORIZATION ' || sys.dq(a.name), ' ') ||
';' stmt, s.name schema_name from sys.schemas s, sys.auths a where
s.authorization = a.id and s.system = false;", "VIEW", true, "COMMIT",
"WRITABLE" ]
+[ "sys._tables", "sys", "dump_create_users", "create view
sys.dump_create_users as select 'CREATE USER ' || sys.dq(ui.name) || ' WITH
ENCRYPTED PASSWORD ' || sys.sq(sys.password_hash(ui.name)) || ' NAME ' ||
sys.sq(ui.fullname) || ' SCHEMA sys;' stmt, ui.name user_name from
sys.db_user_info ui, sys.schemas s where ui.default_schema = s.id and ui.name
<> 'monetdb' and ui.name <> '.snapshot';", "VIEW", true, "COMMIT",
"WRITABLE" ]
+[ "sys._tables", "sys", "dump_foreign_keys", "create view
sys.dump_foreign_keys as select 'ALTER TABLE ' || sys.dq(fk_s) || '.'||
sys.dq(fk_t) || ' ADD CONSTRAINT ' || sys.dq(fk) || ' ' || 'FOREIGN KEY(' ||
group_concat(sys.dq(fk_c), ',') ||') ' || 'REFERENCES ' || sys.dq(pk_s) || '.'
|| sys.dq(pk_t) || '(' || group_concat(sys.dq(pk_c), ',') || ') ' || 'ON DELETE
' || on_delete || ' ON UPDATE ' || on_update || ';' stmt, fk_s
foreign_schema_name, fk_t foreign_table_name, pk_s primary_schema_name, pk_t
primary_table_name, fk key_name from sys.describe_foreign_keys group by fk_s,
fk_t, pk_s, pk_t, fk, on_delete, on_update;", "VIEW", true, "COMMIT",
"WRITABLE" ]
+[ "sys._tables", "sys", "dump_function_grants", "create view
sys.dump_function_grants as with func_args_all(func_id, number, max_number,
func_arg) as (select a.func_id, a.number, max(a.number) over (partition by
a.func_id order by a.number desc), group_concat(sys.describe_type(a.type,
a.type_digits, a.type_scale), ', ') over (partition by a.func_id order by
a.number) from sys.args a where a.inout = 1), func_args(func_id, func_arg) as
(select func_id, func_arg from func_args_all where number = max_number) select
'GRANT ' || pc.privilege_code_name || ' ON ' || ft.function_type_keyword || ' '
|| sys.dq(s.name) || '.' || sys.dq(f.name) || '(' || coalesce(fa.func_arg, '')
|| ') TO ' || ifthenelse(a.name = 'public', 'PUBLIC', sys.dq(a.name)) || case
when p.grantable = 1 then ' WITH GRANT OPTION' else '' end || ';' stmt, s.name
schema_name, f.name function_name, a.name grantee from sys.schemas s,
sys.functions f left outer join func_args fa on f.id = fa.func_id, sys.auths a,
sys.privileges
p, sys.auths g, sys.function_types ft, sys.privilege_codes pc where s.id =
f.schema_id and f.id = p.obj_id and p.auth_id = a.id and p.grantor = g.id and
p.privileges = pc.privilege_code_id and f.type = ft.function_type_id and not
f.system order by s.name, f.name, a.name, g.name, p.grantable;", "VIEW",
true, "COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_functions", "create view
sys.dump_functions as select f.o o, sys.schema_guard(f.sch, f.fun, f.def) stmt,
f.sch schema_name, f.fun function_name from sys.describe_functions f;",
"VIEW", true, "COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_grant_user_privileges", "create view
sys.dump_grant_user_privileges as select 'GRANT ' || sys.dq(a2.name) || ' ' ||
ifthenelse(a1.name = 'public', 'PUBLIC', sys.dq(a1.name)) || ';' stmt, a2.name
grantee, a1.name grantor from sys.auths a1, sys.auths a2, sys.user_role ur
where a1.id = ur.login_id and a2.id = ur.role_id;", "VIEW", true,
"COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_indices", "create view sys.dump_indices
as select 'CREATE ' || tpe || ' ' || sys.dq(ind) || ' ON ' || sys.dq(sch) ||
'.' || sys.dq(tbl) || '(' || group_concat(col) || ');' stmt, sch schema_name,
tbl table_name, ind index_name from sys.describe_indices group by ind, tpe,
sch, tbl;", "VIEW", true, "COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_partition_tables", "create view
sys.dump_partition_tables as select sys.alter_table(m_sch, m_tbl) || ' ADD
TABLE ' || sys.fqn(p_sch, p_tbl) || case when tpe = 'VALUES' then ' AS
PARTITION IN (' || pvalues || ')' when tpe = 'RANGE' then ' AS PARTITION FROM '
|| ifthenelse(minimum is not null, sys.sq(minimum), 'RANGE MINVALUE') || ' TO '
|| ifthenelse(maximum is not null, sys.sq(maximum), 'RANGE MAXVALUE') when tpe
= 'FOR NULLS' then ' AS PARTITION FOR NULL VALUES' else '' end || case when tpe
in ('VALUES', 'RANGE') and with_nulls then ' WITH NULL VALUES' else '' end ||
';' stmt, m_sch merge_schema_name, m_tbl merge_table_name, p_sch
partition_schema_name, p_tbl partition_table_name from
sys.describe_partition_tables;", "VIEW", true, "COMMIT", "WRITABLE"
]
+[ "sys._tables", "sys", "dump_sequences", "create view
sys.dump_sequences as select 'CREATE SEQUENCE ' || sys.fqn(sch, seq) || ' AS
BIGINT ' || case when \"s\" <> 0 then 'START WITH ' || \"rs\" else '' end ||
case when \"inc\" <> 1 then ' INCREMENT BY ' || \"inc\" else '' end || case
when \"mi\" <> 0 then ' MINVALUE ' || \"mi\" else '' end || case when \"ma\" <>
0 then ' MAXVALUE ' || \"ma\" else '' end || case when \"cache\" <> 1 then '
CACHE ' || \"cache\" else '' end || case when \"cycle\" then ' CYCLE' else ''
end || ';' stmt, sch schema_name, seq seqname from sys.describe_sequences;",
"VIEW", true, "COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_start_sequences", "create view
sys.dump_start_sequences as select 'UPDATE sys.sequences seq SET start = ' || s
|| ' WHERE name = ' || sys.sq(seq) || ' AND schema_id = (SELECT s.id FROM
sys.schemas s WHERE s.name = ' || sys.sq(sch) || ');' stmt, sch schema_name,
seq sequence_name from sys.describe_sequences;", "VIEW", true, "COMMIT",
"WRITABLE" ]
[ "sys._tables", "sys", "dump_statements", NULL, "TABLE",
true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_table_constraint_type", "create view
sys.dump_table_constraint_type as select 'ALTER TABLE ' || sys.dq(sch) || '.'
|| sys.dq(tbl) || ' ADD CONSTRAINT ' || sys.dq(con) || ' '|| tpe || ' (' ||
group_concat(sys.dq(col), ', ') || ');' stmt from sys.describe_constraints
group by sch, tbl, con, tpe;", "VIEW", true, "COMMIT",
"WRITABLE" ]
-[ "sys._tables", "sys", "dump_tables", "create view sys.dump_tables as
select t.o o, case when t.typ <> 'VIEW' then 'CREATE ' || t.typ || ' ' ||
sys.fqn(t.sch, t.tab) || t.col || t.opt || ';' else t.opt end stmt from
sys.describe_tables t;", "VIEW", true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_triggers", "create view
sys.dump_triggers as select sys.schema_guard(sch, tab, def) stmt from
sys.describe_triggers;", "VIEW", true, "COMMIT", "WRITABLE" ]
-[ "sys._tables", "sys", "dump_user_defined_types", "create view
sys.dump_user_defined_types as select 'CREATE TYPE ' || sys.fqn(sch, sql_tpe)
|| ' EXTERNAL NAME ' || sys.dq(ext_tpe) || ';' stmt from
sys.describe_user_defined_types;", "VIEW", true, "COMMIT", "WRITABLE"
]
+[ "sys._tables", "sys", "dump_table_constraint_type", "create view
sys.dump_table_constraint_type as select 'ALTER TABLE ' || sys.dq(sch) || '.'
|| sys.dq(tbl) || ' ADD CONSTRAINT ' || sys.dq(con) || ' '|| tpe || ' (' ||
group_concat(sys.dq(col), ', ') || ');' stmt, sch schema_name, tbl table_name,
con constraint_name from sys.describe_constraints group by sch, tbl, con,
tpe;", "VIEW", true, "COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_table_grants", "create view
sys.dump_table_grants as with table_grants (sname, tname, grantee, grants,
grantor, grantable) as (select s.name, t.name, a.name, sum(p.privileges),
g.name, p.grantable from sys.schemas s, sys.tables t, sys.auths a,
sys.privileges p, sys.auths g where p.obj_id = t.id and p.auth_id = a.id and
t.schema_id = s.id and t.system = false and p.grantor = g.id group by s.name,
t.name, a.name, g.name, p.grantable order by s.name, t.name, a.name, g.name,
p.grantable) select 'GRANT ' || pc.privilege_code_name || ' ON TABLE ' ||
sys.dq(sname) || '.' || sys.dq(tname) || ' TO ' || ifthenelse(grantee =
'public', 'PUBLIC', sys.dq(grantee)) || case when grantable = 1 then ' WITH
GRANT OPTION' else '' end || ';' stmt, sname schema_name, tname table_name,
grantee from table_grants left outer join sys.privilege_codes pc on grants =
pc.privilege_code_id;", "VIEW", true, "COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_tables", "create view sys.dump_tables as
select t.o o, case when t.typ <> 'VIEW' then 'CREATE ' || t.typ || ' ' ||
sys.fqn(t.sch, t.tab) || t.col || t.opt || ';' else t.opt end stmt, t.sch
schema_name, t.tab table_name from sys.describe_tables t;", "VIEW", true,
"COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_triggers", "create view
sys.dump_triggers as select sys.schema_guard(sch, tab, def) stmt, sch
schema_name, tab table_name, tri trigger_name from sys.describe_triggers;",
"VIEW", true, "COMMIT", "WRITABLE" ]
+[ "sys._tables", "sys", "dump_user_defined_types", "create view
sys.dump_user_defined_types as select 'CREATE TYPE ' || sys.fqn(sch, sql_tpe)
|| ' EXTERNAL NAME ' || sys.dq(ext_tpe) || ';' stmt, sch schema_name, sql_tpe
type_name from sys.describe_user_defined_types;", "VIEW", true,
"COMMIT", "WRITABLE" ]
[ "sys._tables", "sys", "environment", "create view sys.environment as
select * from sys.env();", "VIEW", true, "COMMIT", "WRITABLE"
]
[ "sys._tables", "sys", "fully_qualified_functions", "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 s.name || '.' || f.name
|| '()' else 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);", "VIEW", true, "COMMIT",
"WRITABLE" ]
[ "sys._tables", "sys", "function_languages", NULL, "TABLE",
true, "COMMIT", "READONLY" ]
@@ -2349,7 +2355,7 @@ select 'null in value_partitions.value',
[ "sys._columns", "describe_functions", "o", "int", 32, 0,
NULL, true, 0, NULL ]
[ "sys._columns", "describe_functions", "sch", "varchar", 1024,
0, NULL, true, 1, NULL ]
[ "sys._columns", "describe_functions", "fun", "varchar", 256,
0, NULL, true, 2, NULL ]
-[ "sys._columns", "describe_functions", "def", "varchar", 8196,
0, NULL, true, 3, NULL ]
+[ "sys._columns", "describe_functions", "def", "clob", 0, 0,
NULL, true, 3, NULL ]
[ "sys._columns", "describe_indices", "ind", "varchar", 1024,
0, NULL, true, 0, NULL ]
[ "sys._columns", "describe_indices", "sch", "varchar", 1024,
0, NULL, true, 1, NULL ]
[ "sys._columns", "describe_indices", "tbl", "varchar", 1024,
0, NULL, true, 2, NULL ]
@@ -2393,27 +2399,77 @@ select 'null in value_partitions.value',
[ "sys._columns", "describe_user_defined_types", "sql_tpe",
"varchar", 1024, 0, NULL, true, 1, NULL ]
[ "sys._columns", "describe_user_defined_types", "ext_tpe",
"varchar", 256, 0, NULL, true, 2, NULL ]
[ "sys._columns", "dump_add_schemas_to_users", "stmt", "clob", 0,
0, NULL, true, 0, NULL ]
+[ "sys._columns", "dump_add_schemas_to_users", "schema_name",
"varchar", 1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_add_schemas_to_users", "user_name",
"varchar", 1024, 0, NULL, true, 2, NULL ]
[ "sys._columns", "dump_column_defaults", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_column_defaults", "schema_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_column_defaults", "table_name", "varchar",
1024, 0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_column_defaults", "column_name", "varchar",
1024, 0, NULL, true, 3, NULL ]
+[ "sys._columns", "dump_column_grants", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_column_grants", "schema_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_column_grants", "table_name", "varchar",
1024, 0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_column_grants", "column_name", "varchar",
1024, 0, NULL, true, 3, NULL ]
+[ "sys._columns", "dump_column_grants", "grantee", "varchar",
1024, 0, NULL, true, 4, NULL ]
[ "sys._columns", "dump_comments", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
[ "sys._columns", "dump_create_roles", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_create_roles", "user_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
[ "sys._columns", "dump_create_schemas", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_create_schemas", "schema_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
[ "sys._columns", "dump_create_users", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_create_users", "user_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
[ "sys._columns", "dump_foreign_keys", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_foreign_keys", "foreign_schema_name",
"varchar", 1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_foreign_keys", "foreign_table_name",
"varchar", 1024, 0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_foreign_keys", "primary_schema_name",
"varchar", 1024, 0, NULL, true, 3, NULL ]
+[ "sys._columns", "dump_foreign_keys", "primary_table_name",
"varchar", 1024, 0, NULL, true, 4, NULL ]
+[ "sys._columns", "dump_foreign_keys", "key_name", "varchar",
1024, 0, NULL, true, 5, NULL ]
+[ "sys._columns", "dump_function_grants", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_function_grants", "schema_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_function_grants", "function_name",
"varchar", 256, 0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_function_grants", "grantee", "varchar",
1024, 0, NULL, true, 3, NULL ]
[ "sys._columns", "dump_functions", "o", "int", 32, 0,
NULL, true, 0, NULL ]
[ "sys._columns", "dump_functions", "stmt", "clob", 0, 0,
NULL, true, 1, NULL ]
+[ "sys._columns", "dump_functions", "schema_name", "varchar",
1024, 0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_functions", "function_name",
"varchar", 256, 0, NULL, true, 3, NULL ]
[ "sys._columns", "dump_grant_user_privileges", "stmt", "clob", 0,
0, NULL, true, 0, NULL ]
+[ "sys._columns", "dump_grant_user_privileges", "grantee",
"varchar", 1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_grant_user_privileges", "grantor",
"varchar", 1024, 0, NULL, true, 2, NULL ]
[ "sys._columns", "dump_indices", "stmt", "clob", 0, 0, NULL,
true, 0, NULL ]
+[ "sys._columns", "dump_indices", "schema_name", "varchar", 1024,
0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_indices", "table_name", "varchar", 1024,
0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_indices", "index_name", "varchar", 1024,
0, NULL, true, 3, NULL ]
[ "sys._columns", "dump_partition_tables", "stmt", "clob", 0,
0, NULL, true, 0, NULL ]
-[ "sys._columns", "dump_privileges", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_partition_tables", "merge_schema_name",
"varchar", 1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_partition_tables", "merge_table_name",
"varchar", 1024, 0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_partition_tables",
"partition_schema_name", "varchar", 1024, 0, NULL, true,
3, NULL ]
+[ "sys._columns", "dump_partition_tables", "partition_table_name",
"varchar", 1024, 0, NULL, true, 4, NULL ]
[ "sys._columns", "dump_sequences", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_sequences", "schema_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_sequences", "seqname", "varchar",
256, 0, NULL, true, 2, NULL ]
[ "sys._columns", "dump_start_sequences", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_start_sequences", "schema_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_start_sequences", "sequence_name",
"varchar", 256, 0, NULL, true, 2, NULL ]
[ "sys._columns", "dump_statements", "o", "int", 32, 0,
NULL, true, 0, NULL ]
[ "sys._columns", "dump_statements", "s", "clob", 0, 0,
NULL, true, 1, NULL ]
[ "sys._columns", "dump_table_constraint_type", "stmt", "clob", 0,
0, NULL, true, 0, NULL ]
+[ "sys._columns", "dump_table_constraint_type", "schema_name",
"varchar", 1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_table_constraint_type", "table_name",
"varchar", 1024, 0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_table_constraint_type", "constraint_name",
"varchar", 1024, 0, NULL, true, 3, NULL ]
+[ "sys._columns", "dump_table_grants", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_table_grants", "schema_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_table_grants", "table_name", "varchar",
1024, 0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_table_grants", "grantee", "varchar",
1024, 0, NULL, true, 3, NULL ]
[ "sys._columns", "dump_tables", "o", "int", 32, 0, NULL,
true, 0, NULL ]
[ "sys._columns", "dump_tables", "stmt", "clob", 0, 0, NULL,
true, 1, NULL ]
+[ "sys._columns", "dump_tables", "schema_name", "varchar", 1024,
0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_tables", "table_name", "varchar", 1024,
0, NULL, true, 3, NULL ]
[ "sys._columns", "dump_triggers", "stmt", "clob", 0, 0,
NULL, true, 0, NULL ]
+[ "sys._columns", "dump_triggers", "schema_name", "varchar",
1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_triggers", "table_name", "varchar",
1024, 0, NULL, true, 2, NULL ]
+[ "sys._columns", "dump_triggers", "trigger_name", "varchar",
1024, 0, NULL, true, 3, NULL ]
[ "sys._columns", "dump_user_defined_types", "stmt", "clob", 0,
0, NULL, true, 0, NULL ]
+[ "sys._columns", "dump_user_defined_types", "schema_name",
"varchar", 1024, 0, NULL, true, 1, NULL ]
+[ "sys._columns", "dump_user_defined_types", "type_name",
"varchar", 1024, 0, NULL, true, 2, NULL ]
[ "sys._columns", "environment", "name", "varchar", 1024, 0,
NULL, true, 0, NULL ]
[ "sys._columns", "environment", "value", "varchar", 2048,
0, NULL, true, 1, NULL ]
[ "sys._columns", "fully_qualified_functions", "id", "int", 32,
0, NULL, true, 0, NULL ]
@@ -2808,7 +2864,6 @@ select 'null in value_partitions.value',
[ "sys.functions", "sys", "=", "SYSTEM", "=", "calc",
"Internal C", "Scalar function", false, false, false, false,
"res_0", "boolean", 1, 0, "out", "arg_1", "any",
0, 0, "in", "arg_2", "any", 0, 0, "in", NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL ]
[ "sys.functions", "sys", ">", "SYSTEM", ">", "calc",
"Internal C", "Scalar function", false, false, false, false,
"res_0", "boolean", 1, 0, "out", "arg_1", "any",
0, 0, "in", "arg_2", "any", 0, 0, "in", NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL ]
[ "sys.functions", "sys", ">=", "SYSTEM", ">=", "calc",
"Internal C", "Scalar function", false, false, false, false,
"res_0", "boolean", 1, 0, "out", "arg_1", "any",
0, 0, "in", "arg_2", "any", 0, 0, "in", NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL ]
-[ "sys.functions", "sys", "_dump_table_data", "SYSTEM", "create
procedure sys._dump_table_data(sch string, tbl string) begin declare k int; set
k = (select min(c.id) from sys.columns c, sys.tables t where c.table_id = t.id
and t.name = tbl); if k is not null then declare cname string; declare ctype
string; set cname = (select c.name from sys.columns c where c.id = k); set
ctype = (select c.type from sys.columns c where c.id = k); declare
copy_into_stmt string; declare _cnt int; set _cnt = (select min(s.count) from
sys.storage() s where s.schema = sch and s.table = tbl); if _cnt > 0 then set
copy_into_stmt = 'COPY ' || _cnt || ' RECORDS INTO ' || sys.fqn(sch, tbl) ||
'(' || sys.dq(cname); declare select_data_stmt string; set select_data_stmt =
'SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), ' ||
sys.prepare_esc(cname, ctype); declare m int; set m = (select max(c.id) from
sys.columns c, sys.tables t where c.table_id = t.id and t.name = tbl); while (k
< m) do set k
= (select min(c.id) from sys.columns c, sys.tables t where c.table_id = t.id
and t.name = tbl and c.id > k); set cname = (select c.name from sys.columns c
where c.id = k); set ctype = (select c.type from sys.columns c where c.id = k);
set copy_into_stmt = (copy_into_stmt || ', ' || sys.dq(cname)); set
select_data_stmt = select_data_stmt || '|| \\'|\\' || ' ||
sys.prepare_esc(cname, ctype); end while; set copy_into_stmt = (copy_into_stmt
|| ') FROM STDIN USING DELIMITERS \\'|\\',E\\'\\\\n\\',\\'\"\\';'); set
select_data_stmt = select_data_stmt || ' FROM ' || sys.fqn(sch, tbl); insert
into sys.dump_statements values ((select count(*) from sys.dump_statements) +
1, copy_into_stmt); call sys.eval('INSERT INTO sys.dump_statements ' ||
select_data_stmt || ';'); end if; end if; end;", "sql", "SQL", "Procedure",
true, false, false, true, "sch", "clob", 0, 0, "in",
"tbl", "clob", 0, 0, "in", NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL ]
[ "sys.functions", "sys", "abbrev", "SYSTEM", "create
function \"abbrev\" (p inet) returns clob external name inet.\"abbrev\";",
"inet", "MAL", "Scalar function", false, false, false, true,
"result", "clob", 0, 0, "out", "p", "inet", 0, 0,
"in", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL ]
[ "sys.functions", "sys", "abs", "SYSTEM", "abs", "calc",
"Internal C", "Scalar function", false, false, false, false,
"res_0", "bigint", 64, 0, "out", "arg_1",
"bigint", 64, 0, "in", NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL ]
[ "sys.functions", "sys", "abs", "SYSTEM", "abs", "calc",
"Internal C", "Scalar function", false, false, false, false,
"res_0", "day_interval", 4, 0, "out", "arg_1",
"day_interval", 4, 0, "in", NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL ]
@@ -3031,8 +3086,9 @@ select 'null in value_partitions.value',
[ "sys.functions", "sys", "difference", "SYSTEM", "stringdiff",
"txtsim", "Internal C", "Scalar function", false, false, false,
true, "res_0", "int", 32, 0, "out", "arg_1",
"varchar", 0, 0, "in", "arg_2", "varchar", 0,
0, "in", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys.functions", "sys", "dq", "SYSTEM", "create function sys.dq
(s string) returns string begin return '\"' || sys.replace(s,'\"','\"\"') ||
'\"'; end;", "sql", "SQL", "Scalar function", false, false,
false, true, "result", "clob", 0, 0, "out", "s", "clob",
0, 0, "in", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL ]
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list