Changeset: e83e4677adb8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e83e4677adb8
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
        sql/test/testdb-upgrade/Tests/dump.stable.out
Branch: default
Log Message:

Approve output.


diffs (233 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
@@ -1382,7 +1382,7 @@ create function timestamp_to_str(d times
 create function sys.tracelog() returns table (ticks bigint, stmt string) 
external name sql.dump_trace;
 create function sys.uuid() returns uuid external name uuid."new";
 create procedure vacuum(sys string, tab string) external name sql.vacuum;
-CREATE FUNCTION var() RETURNS TABLE(name varchar(1024)) EXTERNAL NAME 
sql.sql_variables;
+CREATE FUNCTION "sys"."var"() RETURNS TABLE("schema" string, "name" string, 
"type" string, "value" string) EXTERNAL NAME "sql"."sql_variables";
 create aggregate var_pop(val bigint) returns double external name 
"aggr"."variancep";
 create aggregate var_pop(val double) returns double external name 
"aggr"."variancep";
 create aggregate var_pop(val integer) returns double external name 
"aggr"."variancep";
@@ -1447,12 +1447,12 @@ select 'sys.db_user_info', u.name, u.ful
 select 'function used by function', s1.name, f1.name, s2.name, f2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.functions 
f1, sys.functions f2, sys.schemas s1, sys.schemas s2 where d.id = f1.id and 
d.depend_id = f2.id and f1.schema_id = s1.id and f2.schema_id = s2.id order by 
s2.name, f2.name, s1.name, f1.name;
 select 'table used by function', s1.name, t.name, s2.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._tables 
t, sys.schemas s1, sys.functions f, sys.schemas s2 where d.id = t.id and 
d.depend_id = f.id and t.schema_id = s1.id and f.schema_id = s2.id order by 
s2.name, f.name, s1.name, t.name;
 select 'column used by function', s1.name, t.name, c.name, s2.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._columns 
c, sys._tables t, sys.schemas s1, sys.functions f, sys.schemas s2 where d.id = 
c.id and d.depend_id = f.id and c.table_id = t.id and t.schema_id = s1.id and 
f.schema_id = s2.id order by s2.name, f.name, s1.name, t.name, c.name;
-select 'function used by view', s1.name, f1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, schemas s1, 
functions f1, schemas s2, _tables t2 where d.id = f1.id and f1.schema_id = 
s1.id and d.depend_id = t2.id and t2.schema_id = s2.id order by s2.name, 
t2.name, s1.name, f1.name;
-select 'table used by view', s1.name, t1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, schemas s1, 
_tables t1, schemas s2, _tables t2 where d.id = t1.id and t1.schema_id = s1.id 
and d.depend_id = t2.id and t2.schema_id = s2.id order by s2.name, t2.name, 
s1.name, t1.name;
-select 'column used by view', s1.name, t1.name, c1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, schemas s1, 
_tables t1, _columns c1, schemas s2, _tables t2 where d.id = c1.id and 
c1.table_id = t1.id and t1.schema_id = s1.id and d.depend_id = t2.id and 
t2.schema_id = s2.id order by s2.name, t2.name, s1.name, t1.name, c1.name;
-select 'column used by key', s1.name, t1.name, c1.name, s2.name, t2.name, 
k2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, _tables t1, 
_tables t2, schemas s1, schemas s2, _columns c1, keys k2 where d.id = c1.id and 
d.depend_id = k2.id and c1.table_id = t1.id and t1.schema_id = s1.id and 
k2.table_id = t2.id and t2.schema_id = s2.id order by s2.name, t2.name, 
k2.name, s1.name, t1.name, c1.name;
-select 'column used by index', s1.name, t1.name, c1.name, s2.name, t2.name, 
i2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, _tables t1, 
_tables t2, schemas s1, schemas s2, _columns c1, idxs i2 where d.id = c1.id and 
d.depend_id = i2.id and c1.table_id = t1.id and t1.schema_id = s1.id and 
i2.table_id = t2.id and t2.schema_id = s2.id order by s2.name, t2.name, 
i2.name, s1.name, t1.name, c1.name;
-select 'type used by function', t.systemname, t.sqlname, s.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, types t, 
functions f, schemas s where d.id = t.id and d.depend_id = f.id and f.schema_id 
= s.id order by s.name, f.name, t.systemname, t.sqlname;
+select 'function used by view', s1.name, f1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.schemas 
s1, sys.functions f1, sys.schemas s2, sys._tables t2 where d.id = f1.id and 
f1.schema_id = s1.id and d.depend_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, s1.name, f1.name;
+select 'table used by view', s1.name, t1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.schemas 
s1, sys._tables t1, sys.schemas s2, sys._tables t2 where d.id = t1.id and 
t1.schema_id = s1.id and d.depend_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, s1.name, t1.name;
+select 'column used by view', s1.name, t1.name, c1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.schemas 
s1, sys._tables t1, sys._columns c1, sys.schemas s2, sys._tables t2 where d.id 
= c1.id and c1.table_id = t1.id and t1.schema_id = s1.id and d.depend_id = 
t2.id and t2.schema_id = s2.id order by s2.name, t2.name, s1.name, t1.name, 
c1.name;
+select 'column used by key', s1.name, t1.name, c1.name, s2.name, t2.name, 
k2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._tables 
t1, sys._tables t2, sys.schemas s1, sys.schemas s2, sys._columns c1, sys.keys 
k2 where d.id = c1.id and d.depend_id = k2.id and c1.table_id = t1.id and 
t1.schema_id = s1.id and k2.table_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, k2.name, s1.name, t1.name, c1.name;
+select 'column used by index', s1.name, t1.name, c1.name, s2.name, t2.name, 
i2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._tables 
t1, sys._tables t2, sys.schemas s1, sys.schemas s2, sys._columns c1, sys.idxs 
i2 where d.id = c1.id and d.depend_id = i2.id and c1.table_id = t1.id and 
t1.schema_id = s1.id and i2.table_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, i2.name, s1.name, t1.name, c1.name;
+select 'type used by function', t.systemname, t.sqlname, s.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.types t, 
sys.functions f, sys.schemas s where d.id = t.id and d.depend_id = f.id and 
f.schema_id = s.id order by s.name, f.name, t.systemname, t.sqlname;
 -- idxs
 select 'sys.idxs', t.name, i.name, it.index_type_name from sys.idxs i left 
outer join sys._tables t on t.id = i.table_id left outer join sys.index_types 
as it on i.type = it.index_type_id order by t.name, i.name;
 -- keys
@@ -3918,7 +3918,7 @@ drop function pcre_replace(string, strin
 [ "sys.functions",     "sys",  "upper",        "SYSTEM",       "toUpper",      
"str",  "Internal C",   "Scalar function",      false,  false,  false,  false,  
"res_0",        "varchar",      0,      0,      "out",  "arg_1",        
"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,   
NULL,   NULL,   NULL,   NULL,   NULL    ]
 [ "sys.functions",     "sys",  "uuid", "SYSTEM",       "create function 
sys.uuid() returns uuid external name uuid.\"new\";",  "uuid", "MAL",  "Scalar 
function",      true,   false,  false,  true,   "result",       "uuid", 0,      
0,      "out",  NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   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",  "vacuum",       "SYSTEM",       "create 
procedure vacuum(sys string, tab string) external name sql.vacuum;",    "sql",  
"MAL",  "Procedure",    true,   false,  false,  true,   "sys",  "clob", 0,      
0,      "in",   "tab",  "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",  "var",  "SYSTEM",       "CREATE FUNCTION var() 
RETURNS TABLE(name varchar(1024)) EXTERNAL NAME sql.sql_variables;",     "sql", 
 "SQL",  "Function returning a table",   false,  false,  false,  true,   
"name", "varchar",      1024,   0,      "out",  NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   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",  "var",  "SYSTEM",       "CREATE FUNCTION 
\"sys\".\"var\"() RETURNS TABLE(\"schema\" string, \"name\" string, \"type\" 
string, \"value\" string) EXTERNAL NAME \"sql\".\"sql_variables\";",      
"sql",  "SQL",  "Function returning a table",   false,  false,  false,  true,   
"schema",       "char", 0,      0,      "out",  "name", "char", 0,      0,      
"out",  "type", "char", 0,      0,      "out",  "value",        "char", 0,      
0,      "out",  NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   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",  "var_pop",      "SYSTEM",       "create 
aggregate var_pop(val bigint) returns double external name 
\"aggr\".\"variancep\";",    "aggr", "MAL",  "Aggregate function",   false,  
false,  false,  true,   "result",       "double",       53,     0,      "out",  
"val",  "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",  "var_pop",      "SYSTEM",       "create 
aggregate var_pop(val double) returns double external name 
\"aggr\".\"variancep\";",    "aggr", "MAL",  "Aggregate function",   false,  
false,  false,  true,   "result",       "double",       53,     0,      "out",  
"val",  "double",       53,     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",  "var_pop",      "SYSTEM",       "create 
aggregate var_pop(val integer) returns double external name 
\"aggr\".\"variancep\";",   "aggr", "MAL",  "Aggregate function",   false,  
false,  false,  true,   "result",       "double",       53,     0,      "out",  
"val",  "int",  32,     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    ]
@@ -5274,6 +5274,7 @@ drop function pcre_replace(string, strin
 [ "grant on function", "tojsonarray",  "public",       "EXECUTE",      
"monetdb",      0       ]
 [ "grant on function", "uuid", "public",       "EXECUTE",      "monetdb",      
0       ]
 [ "grant on function", "valuearray",   "public",       "EXECUTE",      
"monetdb",      0       ]
+[ "grant on function", "var",  "public",       "EXECUTE",      NULL,   0       
]
 [ "grant on function", "var_pop",      "public",       "EXECUTE",      
"monetdb",      0       ]
 [ "grant on function", "var_pop",      "public",       "EXECUTE",      
"monetdb",      0       ]
 [ "grant on function", "var_pop",      "public",       "EXECUTE",      
"monetdb",      0       ]
diff --git a/sql/test/emptydb/Tests/check.stable.out.32bit 
b/sql/test/emptydb/Tests/check.stable.out.32bit
--- a/sql/test/emptydb/Tests/check.stable.out.32bit
+++ b/sql/test/emptydb/Tests/check.stable.out.32bit
@@ -1382,7 +1382,7 @@ create function timestamp_to_str(d times
 create function sys.tracelog() returns table (ticks bigint, stmt string) 
external name sql.dump_trace;
 create function sys.uuid() returns uuid external name uuid."new";
 create procedure vacuum(sys string, tab string) external name sql.vacuum;
-CREATE FUNCTION var() RETURNS TABLE(name varchar(1024)) EXTERNAL NAME 
sql.sql_variables;
+CREATE FUNCTION "sys"."var"() RETURNS TABLE("schema" string, "name" string, 
"type" string, "value" string) EXTERNAL NAME "sql"."sql_variables";
 create aggregate var_pop(val bigint) returns double external name 
"aggr"."variancep";
 create aggregate var_pop(val double) returns double external name 
"aggr"."variancep";
 create aggregate var_pop(val integer) returns double external name 
"aggr"."variancep";
@@ -1447,12 +1447,12 @@ select 'sys.db_user_info', u.name, u.ful
 select 'function used by function', s1.name, f1.name, s2.name, f2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.functions 
f1, sys.functions f2, sys.schemas s1, sys.schemas s2 where d.id = f1.id and 
d.depend_id = f2.id and f1.schema_id = s1.id and f2.schema_id = s2.id order by 
s2.name, f2.name, s1.name, f1.name;
 select 'table used by function', s1.name, t.name, s2.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._tables 
t, sys.schemas s1, sys.functions f, sys.schemas s2 where d.id = t.id and 
d.depend_id = f.id and t.schema_id = s1.id and f.schema_id = s2.id order by 
s2.name, f.name, s1.name, t.name;
 select 'column used by function', s1.name, t.name, c.name, s2.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._columns 
c, sys._tables t, sys.schemas s1, sys.functions f, sys.schemas s2 where d.id = 
c.id and d.depend_id = f.id and c.table_id = t.id and t.schema_id = s1.id and 
f.schema_id = s2.id order by s2.name, f.name, s1.name, t.name, c.name;
-select 'function used by view', s1.name, f1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, schemas s1, 
functions f1, schemas s2, _tables t2 where d.id = f1.id and f1.schema_id = 
s1.id and d.depend_id = t2.id and t2.schema_id = s2.id order by s2.name, 
t2.name, s1.name, f1.name;
-select 'table used by view', s1.name, t1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, schemas s1, 
_tables t1, schemas s2, _tables t2 where d.id = t1.id and t1.schema_id = s1.id 
and d.depend_id = t2.id and t2.schema_id = s2.id order by s2.name, t2.name, 
s1.name, t1.name;
-select 'column used by view', s1.name, t1.name, c1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, schemas s1, 
_tables t1, _columns c1, schemas s2, _tables t2 where d.id = c1.id and 
c1.table_id = t1.id and t1.schema_id = s1.id and d.depend_id = t2.id and 
t2.schema_id = s2.id order by s2.name, t2.name, s1.name, t1.name, c1.name;
-select 'column used by key', s1.name, t1.name, c1.name, s2.name, t2.name, 
k2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, _tables t1, 
_tables t2, schemas s1, schemas s2, _columns c1, keys k2 where d.id = c1.id and 
d.depend_id = k2.id and c1.table_id = t1.id and t1.schema_id = s1.id and 
k2.table_id = t2.id and t2.schema_id = s2.id order by s2.name, t2.name, 
k2.name, s1.name, t1.name, c1.name;
-select 'column used by index', s1.name, t1.name, c1.name, s2.name, t2.name, 
i2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, _tables t1, 
_tables t2, schemas s1, schemas s2, _columns c1, idxs i2 where d.id = c1.id and 
d.depend_id = i2.id and c1.table_id = t1.id and t1.schema_id = s1.id and 
i2.table_id = t2.id and t2.schema_id = s2.id order by s2.name, t2.name, 
i2.name, s1.name, t1.name, c1.name;
-select 'type used by function', t.systemname, t.sqlname, s.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, types t, 
functions f, schemas s where d.id = t.id and d.depend_id = f.id and f.schema_id 
= s.id order by s.name, f.name, t.systemname, t.sqlname;
+select 'function used by view', s1.name, f1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.schemas 
s1, sys.functions f1, sys.schemas s2, sys._tables t2 where d.id = f1.id and 
f1.schema_id = s1.id and d.depend_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, s1.name, f1.name;
+select 'table used by view', s1.name, t1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.schemas 
s1, sys._tables t1, sys.schemas s2, sys._tables t2 where d.id = t1.id and 
t1.schema_id = s1.id and d.depend_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, s1.name, t1.name;
+select 'column used by view', s1.name, t1.name, c1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.schemas 
s1, sys._tables t1, sys._columns c1, sys.schemas s2, sys._tables t2 where d.id 
= c1.id and c1.table_id = t1.id and t1.schema_id = s1.id and d.depend_id = 
t2.id and t2.schema_id = s2.id order by s2.name, t2.name, s1.name, t1.name, 
c1.name;
+select 'column used by key', s1.name, t1.name, c1.name, s2.name, t2.name, 
k2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._tables 
t1, sys._tables t2, sys.schemas s1, sys.schemas s2, sys._columns c1, sys.keys 
k2 where d.id = c1.id and d.depend_id = k2.id and c1.table_id = t1.id and 
t1.schema_id = s1.id and k2.table_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, k2.name, s1.name, t1.name, c1.name;
+select 'column used by index', s1.name, t1.name, c1.name, s2.name, t2.name, 
i2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._tables 
t1, sys._tables t2, sys.schemas s1, sys.schemas s2, sys._columns c1, sys.idxs 
i2 where d.id = c1.id and d.depend_id = i2.id and c1.table_id = t1.id and 
t1.schema_id = s1.id and i2.table_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, i2.name, s1.name, t1.name, c1.name;
+select 'type used by function', t.systemname, t.sqlname, s.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.types t, 
sys.functions f, sys.schemas s where d.id = t.id and d.depend_id = f.id and 
f.schema_id = s.id order by s.name, f.name, t.systemname, t.sqlname;
 -- idxs
 select 'sys.idxs', t.name, i.name, it.index_type_name from sys.idxs i left 
outer join sys._tables t on t.id = i.table_id left outer join sys.index_types 
as it on i.type = it.index_type_id order by t.name, i.name;
 -- keys
@@ -3918,7 +3918,7 @@ drop function pcre_replace(string, strin
 [ "sys.functions",     "sys",  "upper",        "SYSTEM",       "toUpper",      
"str",  "Internal C",   "Scalar function",      false,  false,  false,  false,  
"res_0",        "varchar",      0,      0,      "out",  "arg_1",        
"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,   
NULL,   NULL,   NULL,   NULL,   NULL    ]
 [ "sys.functions",     "sys",  "uuid", "SYSTEM",       "create function 
sys.uuid() returns uuid external name uuid.\"new\";",  "uuid", "MAL",  "Scalar 
function",      true,   false,  false,  true,   "result",       "uuid", 0,      
0,      "out",  NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   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",  "vacuum",       "SYSTEM",       "create 
procedure vacuum(sys string, tab string) external name sql.vacuum;",    "sql",  
"MAL",  "Procedure",    true,   false,  false,  true,   "sys",  "clob", 0,      
0,      "in",   "tab",  "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",  "var",  "SYSTEM",       "CREATE FUNCTION var() 
RETURNS TABLE(name varchar(1024)) EXTERNAL NAME sql.sql_variables;",     "sql", 
 "SQL",  "Function returning a table",   false,  false,  false,  true,   
"name", "varchar",      1024,   0,      "out",  NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   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",  "var",  "SYSTEM",       "CREATE FUNCTION 
\"sys\".\"var\"() RETURNS TABLE(\"schema\" string, \"name\" string, \"type\" 
string, \"value\" string) EXTERNAL NAME \"sql\".\"sql_variables\";",      
"sql",  "SQL",  "Function returning a table",   false,  false,  false,  true,   
"schema",       "char", 0,      0,      "out",  "name", "char", 0,      0,      
"out",  "type", "char", 0,      0,      "out",  "value",        "char", 0,      
0,      "out",  NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   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",  "var_pop",      "SYSTEM",       "create 
aggregate var_pop(val bigint) returns double external name 
\"aggr\".\"variancep\";",    "aggr", "MAL",  "Aggregate function",   false,  
false,  false,  true,   "result",       "double",       53,     0,      "out",  
"val",  "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",  "var_pop",      "SYSTEM",       "create 
aggregate var_pop(val double) returns double external name 
\"aggr\".\"variancep\";",    "aggr", "MAL",  "Aggregate function",   false,  
false,  false,  true,   "result",       "double",       53,     0,      "out",  
"val",  "double",       53,     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",  "var_pop",      "SYSTEM",       "create 
aggregate var_pop(val integer) returns double external name 
\"aggr\".\"variancep\";",   "aggr", "MAL",  "Aggregate function",   false,  
false,  false,  true,   "result",       "double",       53,     0,      "out",  
"val",  "int",  32,     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    ]
@@ -5274,6 +5274,7 @@ drop function pcre_replace(string, strin
 [ "grant on function", "tojsonarray",  "public",       "EXECUTE",      
"monetdb",      0       ]
 [ "grant on function", "uuid", "public",       "EXECUTE",      "monetdb",      
0       ]
 [ "grant on function", "valuearray",   "public",       "EXECUTE",      
"monetdb",      0       ]
+[ "grant on function", "var",  "public",       "EXECUTE",      NULL,   0       
]
 [ "grant on function", "var_pop",      "public",       "EXECUTE",      
"monetdb",      0       ]
 [ "grant on function", "var_pop",      "public",       "EXECUTE",      
"monetdb",      0       ]
 [ "grant on function", "var_pop",      "public",       "EXECUTE",      
"monetdb",      0       ]
diff --git a/sql/test/emptydb/Tests/check.stable.out.int128 
b/sql/test/emptydb/Tests/check.stable.out.int128
--- a/sql/test/emptydb/Tests/check.stable.out.int128
+++ b/sql/test/emptydb/Tests/check.stable.out.int128
@@ -1399,7 +1399,7 @@ create function timestamp_to_str(d times
 create function sys.tracelog() returns table (ticks bigint, stmt string) 
external name sql.dump_trace;
 create function sys.uuid() returns uuid external name uuid."new";
 create procedure vacuum(sys string, tab string) external name sql.vacuum;
-CREATE FUNCTION var() RETURNS TABLE(name varchar(1024)) EXTERNAL NAME 
sql.sql_variables;
+CREATE FUNCTION "sys"."var"() RETURNS TABLE("schema" string, "name" string, 
"type" string, "value" string) EXTERNAL NAME "sql"."sql_variables";
 create aggregate var_pop(val bigint) returns double external name 
"aggr"."variancep";
 create aggregate var_pop(val double) returns double external name 
"aggr"."variancep";
 create aggregate var_pop(val hugeint) returns double external name 
"aggr"."variancep";
@@ -1468,12 +1468,12 @@ select 'sys.db_user_info', u.name, u.ful
 select 'function used by function', s1.name, f1.name, s2.name, f2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.functions 
f1, sys.functions f2, sys.schemas s1, sys.schemas s2 where d.id = f1.id and 
d.depend_id = f2.id and f1.schema_id = s1.id and f2.schema_id = s2.id order by 
s2.name, f2.name, s1.name, f1.name;
 select 'table used by function', s1.name, t.name, s2.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._tables 
t, sys.schemas s1, sys.functions f, sys.schemas s2 where d.id = t.id and 
d.depend_id = f.id and t.schema_id = s1.id and f.schema_id = s2.id order by 
s2.name, f.name, s1.name, t.name;
 select 'column used by function', s1.name, t.name, c.name, s2.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._columns 
c, sys._tables t, sys.schemas s1, sys.functions f, sys.schemas s2 where d.id = 
c.id and d.depend_id = f.id and c.table_id = t.id and t.schema_id = s1.id and 
f.schema_id = s2.id order by s2.name, f.name, s1.name, t.name, c.name;
-select 'function used by view', s1.name, f1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, schemas s1, 
functions f1, schemas s2, _tables t2 where d.id = f1.id and f1.schema_id = 
s1.id and d.depend_id = t2.id and t2.schema_id = s2.id order by s2.name, 
t2.name, s1.name, f1.name;
-select 'table used by view', s1.name, t1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, schemas s1, 
_tables t1, schemas s2, _tables t2 where d.id = t1.id and t1.schema_id = s1.id 
and d.depend_id = t2.id and t2.schema_id = s2.id order by s2.name, t2.name, 
s1.name, t1.name;
-select 'column used by view', s1.name, t1.name, c1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, schemas s1, 
_tables t1, _columns c1, schemas s2, _tables t2 where d.id = c1.id and 
c1.table_id = t1.id and t1.schema_id = s1.id and d.depend_id = t2.id and 
t2.schema_id = s2.id order by s2.name, t2.name, s1.name, t1.name, c1.name;
-select 'column used by key', s1.name, t1.name, c1.name, s2.name, t2.name, 
k2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, _tables t1, 
_tables t2, schemas s1, schemas s2, _columns c1, keys k2 where d.id = c1.id and 
d.depend_id = k2.id and c1.table_id = t1.id and t1.schema_id = s1.id and 
k2.table_id = t2.id and t2.schema_id = s2.id order by s2.name, t2.name, 
k2.name, s1.name, t1.name, c1.name;
-select 'column used by index', s1.name, t1.name, c1.name, s2.name, t2.name, 
i2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, _tables t1, 
_tables t2, schemas s1, schemas s2, _columns c1, idxs i2 where d.id = c1.id and 
d.depend_id = i2.id and c1.table_id = t1.id and t1.schema_id = s1.id and 
i2.table_id = t2.id and t2.schema_id = s2.id order by s2.name, t2.name, 
i2.name, s1.name, t1.name, c1.name;
-select 'type used by function', t.systemname, t.sqlname, s.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, types t, 
functions f, schemas s where d.id = t.id and d.depend_id = f.id and f.schema_id 
= s.id order by s.name, f.name, t.systemname, t.sqlname;
+select 'function used by view', s1.name, f1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.schemas 
s1, sys.functions f1, sys.schemas s2, sys._tables t2 where d.id = f1.id and 
f1.schema_id = s1.id and d.depend_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, s1.name, f1.name;
+select 'table used by view', s1.name, t1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.schemas 
s1, sys._tables t1, sys.schemas s2, sys._tables t2 where d.id = t1.id and 
t1.schema_id = s1.id and d.depend_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, s1.name, t1.name;
+select 'column used by view', s1.name, t1.name, c1.name, s2.name, t2.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.schemas 
s1, sys._tables t1, sys._columns c1, sys.schemas s2, sys._tables t2 where d.id 
= c1.id and c1.table_id = t1.id and t1.schema_id = s1.id and d.depend_id = 
t2.id and t2.schema_id = s2.id order by s2.name, t2.name, s1.name, t1.name, 
c1.name;
+select 'column used by key', s1.name, t1.name, c1.name, s2.name, t2.name, 
k2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._tables 
t1, sys._tables t2, sys.schemas s1, sys.schemas s2, sys._columns c1, sys.keys 
k2 where d.id = c1.id and d.depend_id = k2.id and c1.table_id = t1.id and 
t1.schema_id = s1.id and k2.table_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, k2.name, s1.name, t1.name, c1.name;
+select 'column used by index', s1.name, t1.name, c1.name, s2.name, t2.name, 
i2.name, dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys._tables 
t1, sys._tables t2, sys.schemas s1, sys.schemas s2, sys._columns c1, sys.idxs 
i2 where d.id = c1.id and d.depend_id = i2.id and c1.table_id = t1.id and 
t1.schema_id = s1.id and i2.table_id = t2.id and t2.schema_id = s2.id order by 
s2.name, t2.name, i2.name, s1.name, t1.name, c1.name;
+select 'type used by function', t.systemname, t.sqlname, s.name, f.name, 
dt.dependency_type_name from sys.dependencies d left outer join 
sys.dependency_types dt on d.depend_type = dt.dependency_type_id, sys.types t, 
sys.functions f, sys.schemas s where d.id = t.id and d.depend_id = f.id and 
f.schema_id = s.id order by s.name, f.name, t.systemname, t.sqlname;
 -- idxs
 select 'sys.idxs', t.name, i.name, it.index_type_name from sys.idxs i left 
outer join sys._tables t on t.id = i.table_id left outer join sys.index_types 
as it on i.type = it.index_type_id order by t.name, i.name;
 -- keys
@@ -4147,7 +4147,7 @@ drop function pcre_replace(string, strin
 [ "sys.functions",     "sys",  "upper",        "SYSTEM",       "toUpper",      
"str",  "Internal C",   "Scalar function",      false,  false,  false,  false,  
"res_0",        "varchar",      0,      0,      "out",  "arg_1",        
"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,   
NULL,   NULL,   NULL,   NULL,   NULL    ]
 [ "sys.functions",     "sys",  "uuid", "SYSTEM",       "create function 
sys.uuid() returns uuid external name uuid.\"new\";",  "uuid", "MAL",  "Scalar 
function",      true,   false,  false,  true,   "result",       "uuid", 0,      
0,      "out",  NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   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",  "vacuum",       "SYSTEM",       "create 
procedure vacuum(sys string, tab string) external name sql.vacuum;",    "sql",  
"MAL",  "Procedure",    true,   false,  false,  true,   "sys",  "clob", 0,      
0,      "in",   "tab",  "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",  "var",  "SYSTEM",       "CREATE FUNCTION var() 
RETURNS TABLE(name varchar(1024)) EXTERNAL NAME sql.sql_variables;",     "sql", 
 "SQL",  "Function returning a table",   false,  false,  false,  true,   
"name", "varchar",      1024,   0,      "out",  NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   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",  "var",  "SYSTEM",       "CREATE FUNCTION 
\"sys\".\"var\"() RETURNS TABLE(\"schema\" string, \"name\" string, \"type\" 
string, \"value\" string) EXTERNAL NAME \"sql\".\"sql_variables\";",      
"sql",  "SQL",  "Function returning a table",   false,  false,  false,  true,   
"schema",       "char", 0,      0,      "out",  "name", "char", 0,      0,      
"out",  "type", "char", 0,      0,      "out",  "value",        "char", 0,      
0,      "out",  NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   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",  "var_pop",      "SYSTEM",       "create 
aggregate var_pop(val bigint) returns double external name 
\"aggr\".\"variancep\";",    "aggr", "MAL",  "Aggregate function",   false,  
false,  false,  true,   "result",       "double",       53,     0,      "out",  
"val",  "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",  "var_pop",      "SYSTEM",       "create 
aggregate var_pop(val double) returns double external name 
\"aggr\".\"variancep\";",    "aggr", "MAL",  "Aggregate function",   false,  
false,  false,  true,   "result",       "double",       53,     0,      "out",  
"val",  "double",       53,     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",  "var_pop",      "SYSTEM",       "create 
aggregate var_pop(val hugeint) returns double external name 
\"aggr\".\"variancep\";",   "aggr", "MAL",  "Aggregate function",   false,  
false,  false,  true,   "result",       "double",       53,     0,      "out",  
"val",  "hugeint",      128,    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    ]
@@ -5527,6 +5527,7 @@ drop function pcre_replace(string, strin
 [ "grant on function", "tojsonarray",  "public",       "EXECUTE",      
"monetdb",      0       ]
 [ "grant on function", "uuid", "public",       "EXECUTE",      "monetdb",      
0       ]
 [ "grant on function", "valuearray",   "public",       "EXECUTE",      
"monetdb",      0       ]
+[ "grant on function", "var",  "public",       "EXECUTE",      NULL,   0       
]
 [ "grant on function", "var_pop",      "public",       "EXECUTE",      
"monetdb",      0       ]
 [ "grant on function", "var_pop",      "public",       "EXECUTE",      
"monetdb",      0       ]
 [ "grant on function", "var_pop",      "public",       "EXECUTE",      
"monetdb",      0       ]
diff --git a/sql/test/testdb-upgrade/Tests/dump.stable.out 
b/sql/test/testdb-upgrade/Tests/dump.stable.out
--- a/sql/test/testdb-upgrade/Tests/dump.stable.out
+++ b/sql/test/testdb-upgrade/Tests/dump.stable.out
@@ -101315,6 +101315,26 @@ CREATE TABLE "testschema"."subtable3" (
        "a" INTEGER,
        "b" VARCHAR(32)
 );
+CREATE MERGE TABLE "testschema"."testme2" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+) PARTITION BY RANGE ON (a);
+CREATE TABLE "testschema"."subtable4" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+);
+CREATE TABLE "testschema"."subtable5" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+);
+CREATE MERGE TABLE "testschema"."testme3" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+) PARTITION BY RANGE ON (a);
+CREATE TABLE "testschema"."subtable6" (
+       "a" INTEGER,
+       "b" VARCHAR(32)
+);
 CREATE MERGE TABLE "testschema"."testvaluespartitions" (
        "a" INTEGER,
        "b" VARCHAR(32)
@@ -101350,6 +101370,48 @@ 8    "attempt"
 CREATE TABLE "testschema"."""" (
        """" INTEGER
 );
+CREATE FUNCTION "testschema"."pyapi01"("i" INTEGER) RETURNS TABLE ("i" 
INTEGER, "d" DOUBLE) LANGUAGE PYTHON
+{
+        x = range(1, i + 1)
+        y = [42.0] * i
+        return([x,y])
+};
+CREATE FUNCTION "testschema"."pyapi02"("i" INTEGER, "j" INTEGER, "z" INTEGER) 
RETURNS INTEGER LANGUAGE PYTHON3
+{
+    x = i * sum(j) * z
+    return x
+};
+CREATE FUNCTION "testschema"."rapi01"("i" INTEGER) RETURNS TABLE ("i" INTEGER, 
"d" DOUBLE) LANGUAGE R
+{
+        return(data.frame(i=seq(1,i),d=42.0));
+};
+CREATE FUNCTION "testschema"."rapi02"("i" INTEGER, "j" INTEGER, "z" INTEGER) 
RETURNS INTEGER LANGUAGE R
+{
+        return(i*sum(j)*z);
+};
+CREATE FUNCTION "testschema"."capi00"("inp" INTEGER) RETURNS INTEGER LANGUAGE C
+{
+    size_t i;
+    result->initialize(result, inp.count);
+    for(i = 0; i < inp.count; i++) {
+        result->data[i] = inp.data[i] * 2;
+    }
+};
+CREATE AGGREGATE "testschema"."aggrmedian"("val" INTEGER) RETURNS INTEGER 
LANGUAGE PYTHON
+{
+        if 'aggr_group' in locals():
+                unique = numpy.unique(aggr_group)
+                x = numpy.zeros(shape=(unique.size))
+                for i in range(0,unique.size):
+                        x[i] = 
numpy.median(val[numpy.where(aggr_group==unique[i])])
+                return(x)
+        else:
+                return(numpy.median(val))
+};
+CREATE FUNCTION "testschema"."pyapi10_mult"("i" INTEGER, "j" INTEGER) RETURNS 
INTEGER LANGUAGE PYTHON_MAP
+{
+    return(i*j)
+};
 CREATE TABLE "testschema"."geomtest" (
        "p"   GEOMETRY(POINT),
        "c"   GEOMETRY(LINESTRING),
@@ -101371,6 +101433,9 @@ NULL  NULL    NULL    NULL    NULL    NULL    NULL    
NULL    
 ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable1" AS 
PARTITION FROM RANGE MINVALUE TO '11' WITH NULL VALUES;
 ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable2" AS 
PARTITION FROM '11' TO '20';
 ALTER TABLE "testschema"."testme" ADD TABLE "testschema"."subtable3" AS 
PARTITION FROM '21' TO RANGE MAXVALUE;
+ALTER TABLE "testschema"."testme2" ADD TABLE "testschema"."subtable4" AS 
PARTITION FROM RANGE MINVALUE TO RANGE MAXVALUE;
+ALTER TABLE "testschema"."testme2" ADD TABLE "testschema"."subtable5" AS 
PARTITION FOR NULL VALUES;
+ALTER TABLE "testschema"."testme3" ADD TABLE "testschema"."subtable6" AS 
PARTITION FROM RANGE MINVALUE TO RANGE MAXVALUE WITH NULL VALUES;
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits1" AS PARTITION IN ('1', '2', '3');
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits2" AS PARTITION IN ('4', '5', '6') WITH NULL VALUES;
 ALTER TABLE "testschema"."testvaluespartitions" ADD TABLE 
"testschema"."sublimits3" AS PARTITION IN ('7', '8', '9');
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to