Changeset: e721f09b9caa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e721f09b9caa
Added Files:
        sql/test/BugTracker-2016/Tests/consolidated_table.Bug-3954.sql
        sql/test/BugTracker-2016/Tests/invalidcolumns.Bug-3968.sql
        sql/test/BugTracker-2016/Tests/invalidcolumns.Bug-3968.stable.err
        sql/test/BugTracker-2016/Tests/invalidcolumns.Bug-3968.stable.out
        sql/test/BugTracker-2016/Tests/stream_table_crash.Bug-3952.stable.err
        sql/test/BugTracker-2016/Tests/stream_table_crash.Bug-3952.stable.out
        sql/test/pg_regress/Tests/oid.stable.err.32bit
Modified Files:
        .hgtags
        MonetDB.spec
        NT/installer32/MonetDB-ODBC-Installer.vdproj
        NT/installer32/MonetDB5-Geom-Module.vdproj
        NT/installer32/MonetDB5-SQL-Installer.vdproj
        NT/installer64/MonetDB-ODBC-Installer.vdproj
        NT/installer64/MonetDB5-Geom-Module.vdproj
        NT/installer64/MonetDB5-SQL-Installer.vdproj
        NT/monetdb_config.h.in
        NT/rules.msc
        clients/R/MonetDB.R/DESCRIPTION
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/SQL-dump.SQL.py
        clients/Tests/SQL-dump.stable.out
        clients/Tests/SQL-dump.stable.out.int128
        clients/Tests/exports.stable.out
        clients/mapilib/mapi.rc
        clients/odbc/driver/driver.rc
        clients/odbc/winsetup/setup.rc
        clients/python2/setup.py
        clients/python3/setup.py
        configure.ag
        debian/changelog
        gdk/ChangeLog-Archive
        gdk/ChangeLog.Jul2015
        gdk/gdk_atoms.c
        gdk/gdk_bbp.c
        gdk/libbat.rc
        java/ChangeLog.Jun2016
        java/src/main/java/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
        libversions
        monetdb5/ChangeLog
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_profiler.h
        monetdb5/modules/kernel/batmmath.c
        monetdb5/modules/kernel/batmmath.h
        monetdb5/modules/kernel/batmmath.mal
        monetdb5/modules/mal/profiler.c
        monetdb5/modules/mal/profiler.h
        monetdb5/modules/mal/profiler.mal
        monetdb5/modules/mal/querylog.c
        monetdb5/modules/mal/querylog.h
        monetdb5/modules/mal/querylog.mal
        monetdb5/modules/mal/remote.c
        monetdb5/optimizer/opt_costModel.c
        monetdb5/optimizer/opt_deadcode.c
        monetdb5/optimizer/opt_mergetable.c
        monetdb5/optimizer/opt_prelude.c
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_querylog.c
        monetdb5/optimizer/opt_support.c
        monetdb5/optimizer/opt_support.h
        monetdb5/optimizer/opt_volcano.c
        monetdb5/tools/libmonetdb5.rc
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_optimizer.c
        sql/backends/monet5/sql_result.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_statement.c
        sql/backends/monet5/sql_upgrades.c
        sql/server/Makefile.ag
        sql/server/rel_exp.h
        sql/server/rel_optimizer.c
        sql/server/rel_psm.c
        sql/server/rel_select.c
        sql/server/sql_mvc.h
        sql/storage/bat/bat_logger.c
        sql/storage/store.c
        sql/test/BugTracker-2012/Tests/All
        sql/test/BugTracker-2014/Tests/nil_2dec_lng.Bug-3592.stable.out
        sql/test/BugTracker-2016/Tests/All
        
sql/test/BugTracker-2016/Tests/column_alias_in_where_clause.Bug-3947.stable.err
        
sql/test/BugTracker-2016/Tests/column_alias_in_where_clause.Bug-3947.stable.out
        sql/test/BugTracker-2016/Tests/decimal_vs_integer.Bug-3941.stable.out
        sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.sql
        sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.stable.err
        sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.stable.out
        sql/test/BugTracker-2016/Tests/stream_table_crash.Bug-3952.sql
        sql/test/Dependencies/Tests/Dependencies.stable.out
        sql/test/Dependencies/Tests/Dependencies.stable.out.int128
        sql/test/Dependencies/Tests/dependency_loop.stable.out
        sql/test/Dependencies/Tests/dependency_loop.stable.out.int128
        sql/test/Tests/systemfunctions.stable.out
        sql/test/Tests/systemfunctions.stable.out.int128
        sql/test/Users/Tests/dropManyUsers.Bug-3764.stable.out
        sql/test/Users/Tests/grantMonetdb.stable.err
        sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade-hge/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
        sql/test/emptydb-upgrade/Tests/check.stable.out
        sql/test/emptydb-upgrade/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out
        sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
        sql/test/emptydb/Tests/check.stable.out
        sql/test/emptydb/Tests/check.stable.out.int128
        sql/test/json/Tests/All
        sql/test/pg_regress/Tests/All
        sql/test/pg_regress/Tests/arrays.stable.err
        sql/test/pg_regress/Tests/oid.stable.err
        sql/test/pg_regress/Tests/without_oid.stable.out
        sql/test/remote/Tests/ssbm.SQL.py
        sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out
        sql/test/testdb-upgrade/Tests/upgrade.stable.out
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
        testing/Mfilter.py
        testing/Mtest.py.in
        tools/embedded/Tests/All
        tools/embedded/build-on-windows.bat
        tools/embedded/build-rpkg.sh
        tools/embedded/rpackage/DESCRIPTION
        tools/mserver/mserver5.c
        vertoo.data
Branch: iot
Log Message:

Merge with default


diffs (truncated from 81308 to 300 lines):

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -620,3 +620,5 @@ feec2e4020548d3137a0e946b7a4e29db5b9e14a
 ee2d8c8d65c35ed022ca0785f30fcf4b051a542e Jun2016_root
 ee54e50fccb17db48bbfd983882e8491a869131c Jul2015_17
 ee54e50fccb17db48bbfd983882e8491a869131c Jul2015_SP3_release
+51322027cb7e7c27f03fc7c3cab4db4fd4cd4446 Jul2015_19
+51322027cb7e7c27f03fc7c3cab4db4fd4cd4446 Jul2015_SP4_release
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -104,7 +104,7 @@ Vendor: MonetDB BV <i...@monetdb.org>
 Group: Applications/Databases
 License: MPLv2.0
 URL: http://www.monetdb.org/
-Source: 
http://dev.monetdb.org/downloads/sources/Jul2015-SP3/%{name}-%{version}.tar.bz2
+Source: 
http://dev.monetdb.org/downloads/sources/Jul2015-SP4/%{name}-%{version}.tar.bz2
 
 # we need systemd for the _unitdir macro to exist
 BuildRequires: systemd
@@ -986,6 +986,20 @@ rm -f %{buildroot}%{_bindir}/Maddlog
 %postun -p /sbin/ldconfig
 
 %changelog
+* Tue Apr 05 2016 Sjoerd Mullender <sjo...@acm.org> - 11.21.19-20160405
+- Rebuilt.
+- BZ#3905: MonetDB doesn't handle ANY/SOME/ALL operator correctly
+- BZ#3929: R aggregate not recognized when using 3 or more parameters
+- BZ#3965: Not possible to quote/escape single quote character in the
+  name of the file to load.
+- BZ#3968: Missing double use of column names
+
+* Mon Apr  4 2016 Sjoerd Mullender <sjo...@acm.org> - 11.21.19-20160405
+- gdk: Fixed a bug that caused various instances where old data returned or
+  where crashes occurred.  The problem was that internally data wasn't
+  always marked dirty when it was being changed, causiing later processing
+  to not deal with the changed data correctly.
+
 * Thu Mar 24 2016 Sjoerd Mullender <sjo...@acm.org> - 11.21.17-20160324
 - Rebuilt.
 - BZ#2972: SQL URL functionality contains errors
diff --git a/clients/R/MonetDB.R/DESCRIPTION b/clients/R/MonetDB.R/DESCRIPTION
--- a/clients/R/MonetDB.R/DESCRIPTION
+++ b/clients/R/MonetDB.R/DESCRIPTION
@@ -1,5 +1,5 @@
 Package: MonetDB.R
-Version: 1.0.1
+Version: 1.0.2
 Title: Connect MonetDB to R
 Authors@R: c(person("Hannes Muehleisen", role = c("aut", "cre"),email = 
"han...@cwi.nl"),
        person("Anthony Damico", role = "aut"),
diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -2723,6 +2723,10 @@ command batstr.unicodeAt(s:bat[:str],ind
 address STRbatWChrAt;
 comment get a unicode character (as an int) from a string position.
 
+command batmmath.atan2(x:flt,y:bat[:flt]):bat[:flt] 
+address CMDscience_cst_bat_atan2_flt;
+command batmmath.atan2(x:dbl,y:bat[:dbl]):bat[:dbl] 
+address CMDscience_cst_bat_atan2_dbl;
 command batmmath.atan2(x:bat[:flt],y:flt):bat[:flt] 
 address CMDscience_bat_cst_atan2_flt;
 command batmmath.atan2(x:bat[:dbl],y:dbl):bat[:dbl] 
@@ -2779,6 +2783,10 @@ command batmmath.log(x:bat[:flt]):bat[:f
 address CMDscience_bat_flt_log;
 command batmmath.log(x:bat[:dbl]):bat[:dbl] 
 address CMDscience_bat_dbl_log;
+command batmmath.pow(x:flt,y:bat[:flt]):bat[:flt] 
+address CMDscience_cst_bat_pow_flt;
+command batmmath.pow(x:dbl,y:bat[:dbl]):bat[:dbl] 
+address CMDscience_cst_bat_pow_dbl;
 command batmmath.pow(x:bat[:flt],y:flt):bat[:flt] 
 address CMDscience_bat_cst_pow_flt;
 command batmmath.pow(x:bat[:dbl],y:dbl):bat[:dbl] 
@@ -40434,6 +40442,11 @@ pattern sql.argRecord():str
 address SQLargRecord;
 comment Glue together the calling sequence
 
+inline function 
sql.all(b:bat[:any_1],gp:bat[:oid],gpe:bat[:oid],no_nil:bit):bat[:any_1];
+command sql.all(col:bat[:any_1]):any_1 
+address SQLall;
+comment if col contains exactly one value return this. Incase of more raise an 
exception else return nil
+
 pattern sql.affectedRows(mvc:int,nr:wrd):int 
 address mvc_affected_rows_wrap;
 comment export the number of affected rows by the current query
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -3174,6 +3174,10 @@ command batstr.unicodeAt(s:bat[:str],ind
 address STRbatWChrAt;
 comment get a unicode character (as an int) from a string position.
 
+command batmmath.atan2(x:flt,y:bat[:flt]):bat[:flt] 
+address CMDscience_cst_bat_atan2_flt;
+command batmmath.atan2(x:dbl,y:bat[:dbl]):bat[:dbl] 
+address CMDscience_cst_bat_atan2_dbl;
 command batmmath.atan2(x:bat[:flt],y:flt):bat[:flt] 
 address CMDscience_bat_cst_atan2_flt;
 command batmmath.atan2(x:bat[:dbl],y:dbl):bat[:dbl] 
@@ -3230,6 +3234,10 @@ command batmmath.log(x:bat[:flt]):bat[:f
 address CMDscience_bat_flt_log;
 command batmmath.log(x:bat[:dbl]):bat[:dbl] 
 address CMDscience_bat_dbl_log;
+command batmmath.pow(x:flt,y:bat[:flt]):bat[:flt] 
+address CMDscience_cst_bat_pow_flt;
+command batmmath.pow(x:dbl,y:bat[:dbl]):bat[:dbl] 
+address CMDscience_cst_bat_pow_dbl;
 command batmmath.pow(x:bat[:flt],y:flt):bat[:flt] 
 address CMDscience_bat_cst_pow_flt;
 command batmmath.pow(x:bat[:dbl],y:dbl):bat[:dbl] 
@@ -51293,6 +51301,11 @@ pattern sql.argRecord():str
 address SQLargRecord;
 comment Glue together the calling sequence
 
+inline function 
sql.all(b:bat[:any_1],gp:bat[:oid],gpe:bat[:oid],no_nil:bit):bat[:any_1];
+command sql.all(col:bat[:any_1]):any_1 
+address SQLall;
+comment if col contains exactly one value return this. Incase of more raise an 
exception else return nil
+
 pattern sql.affectedRows(mvc:int,nr:wrd):int 
 address mvc_affected_rows_wrap;
 comment export the number of affected rows by the current query
diff --git a/clients/Tests/SQL-dump.SQL.py b/clients/Tests/SQL-dump.SQL.py
--- a/clients/Tests/SQL-dump.SQL.py
+++ b/clients/Tests/SQL-dump.SQL.py
@@ -73,7 +73,48 @@ select t.name, c.name, c.type, c.type_di
 -- functions
 select s.name, f.name, 
replace(replace(pcre_replace(pcre_replace(pcre_replace(f.func, '--.*\n', '', 
''), '[ \t\n]+', ' ', 'm'), '^ ', '', ''), '( ', '('), ' )', ')') as query, 
f.mod, f.language, f.type, f.side_effect, f.varres, f.vararg from sys.functions 
f left outer join sys.schemas s on f.schema_id = s.id order by s.name, f.name, 
query;
 -- args
-select f.name, a.name, a.type, a.type_digits, a.type_scale, a.inout, a.number 
from sys.args a left outer join sys.functions f on a.func_id = f.id order by 
f.name, a.func_id, a.number;
+'''
+# generate a monster query to get all functions with all their
+# arguments on a single row of a table
+
+# maximum number of arguments used in any standard function (also
+# determines the number of joins in the query and the number of
+# columns in the result):
+MAXARGS = 16
+# columns of the args table we're interested in
+args = ['name', 'type', 'type_digits', 'type_scale', 'inout']
+
+out += "with\n"
+for i in range(1, MAXARGS + 1):
+    out += "arg%d (id" % i
+    for j in range(1, i + 1):
+        for k in ['id'] + args:
+            out += ", %s%d" % (k, j)
+    out += ") as (select "
+    if i == 1:
+        out += "f.id"
+        for k in ['id'] + args:
+            out += ", a%d.%s" % (i, k)
+        out += " from sys.functions f left outer join args a%d on a%d.func_id 
= f.id" % (i, i)
+    else:
+        out += "arg%d.*" % (i - 1)
+        for k in ['id'] + args:
+            out += ", a%d.%s" % (i, k)
+        out += " from arg%d left outer join args a%d on a%d.func_id = 
arg%d.id" % (i - 1, i, i, i - 1)
+    out += " and a%d.number = %d)" % (i, i)
+    if i < MAXARGS:
+        out += ","
+    out += "\n"
+out += "select s.name, f.name"
+for i in range(1, MAXARGS):
+    for k in args:
+        out += ", arg%d.%s%d" % (MAXARGS, k, i)
+out += " from arg%d, sys.schemas s, sys.functions f where s.id = f.schema_id 
and f.id = arg%d.id order by s.name, f.name" % (MAXARGS, MAXARGS)
+for i in range(1, MAXARGS):
+    for k in args:
+        out += ", arg%d.%s%d" % (MAXARGS, k, i)
+out += ";"
+out += '''
 -- auths
 select name, grantor from sys.auths;
 -- connections (expect empty)
@@ -81,15 +122,15 @@ select server, port, db, db_alias, user,
 -- db_user_info
 select u.name, u.fullname, s.name from sys.db_user_info u left outer join 
sys.schemas s on u.default_schema = s.id order by u.name;
 -- dependencies
-select s1.name, f1.name, s2.name, f2.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from sys.dependencies d, 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 s1.name, t.name, s2.name, f.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from sys.dependencies d, 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 s1.name, t.name, c.name, s2.name, f.name, case d.depend_type when 1 
then 'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from sys.dependencies d, 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 s1.name, f1.name, s2.name, t2.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from schemas s1, functions f1, schemas s2, _tables t2, 
dependencies d 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 s1.name, t1.name, s2.name, t2.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from schemas s1, _tables t1, schemas s2, _tables t2, 
dependencies d 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 s1.name, t1.name, c1.name, s2.name, t2.name, case d.depend_type when 1 
then 'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from schemas s1, _tables t1, _columns c1, schemas s2, 
_tables t2, dependencies d 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;
-select s1.name, t1.name, c1.name, s2.name, t2.name, k2.name, case 
d.depend_type when 1 then 'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' 
when 3 then 'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 
'VIEW_DEPENDENCY' when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' 
when 8 then 'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from dependencies d, _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 s1.name, t1.name, c1.name, s2.name, t2.name, i2.name, case 
d.depend_type when 1 then 'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' 
when 3 then 'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 
'VIEW_DEPENDENCY' when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' 
when 8 then 'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from dependencies d, _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 t.systemname, t.sqlname, s.name, f.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from types t, functions f, schemas s, dependencies d 
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 s1.name, f1.name, s2.name, f2.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), sys.dependencies d, sys.functions f1, sys.functions f2, 
sys.schemas s1, sys.schemas s2 where d.depend_type = dt.id and 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 s1.name, t.name, s2.name, f.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), sys.dependencies d, sys._tables t, sys.schemas s1, sys.functions 
f, sys.schemas s2 where d.depend_type = dt.id and 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 s1.name, t.name, c.name, s2.name, f.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), sys.dependencies d, sys._columns c, sys._tables t, sys.schemas 
s1, sys.functions f, sys.schemas s2 where d.depend_type = dt.id and 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 s1.name, f1.name, s2.name, t2.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), schemas s1, functions f1, schemas s2, _tables t2, dependencies d 
where d.depend_type = dt.id and 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 s1.name, t1.name, s2.name, t2.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), schemas s1, _tables t1, schemas s2, _tables t2, dependencies d 
where d.depend_type = dt.id and 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 s1.name, t1.name, c1.name, s2.name, t2.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), schemas s1, _tables t1, _columns c1, schemas s2, _tables t2, 
dependencies d where d.depend_type = dt.id and 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;
+select s1.name, t1.name, c1.name, s2.name, t2.name, k2.name, dt.name from 
(values (1, 'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 
'COLUMN_DEPENDENCY'), (4, 'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 
'USER_DEPENDENCY'), (7, 'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 
'OWNER_DEPENDENCY'), (10, 'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 
'SEQ_DEPENDENCY'), (13, 'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 
'TYPE_DEPENDENCY')) as dt (id, name), dependencies d, _tables t1, _tables t2, 
schemas s1, schemas s2, _columns c1, keys k2 where d.depend_type = dt.id and 
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 s1.name, t1.name, c1.name, s2.name, t2.name, i2.name, dt.name from 
(values (1, 'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 
'COLUMN_DEPENDENCY'), (4, 'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 
'USER_DEPENDENCY'), (7, 'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 
'OWNER_DEPENDENCY'), (10, 'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 
'SEQ_DEPENDENCY'), (13, 'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 
'TYPE_DEPENDENCY')) as dt (id, name), dependencies d, _tables t1, _tables t2, 
schemas s1, schemas s2, _columns c1, idxs i2 where d.depend_type = dt.id and 
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 t.systemname, t.sqlname, s.name, f.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), types t, functions f, schemas s, dependencies d where 
d.depend_type = dt.id and 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 t.name, i.name, i.type from sys.idxs i left outer join sys._tables t on 
t.id = i.table_id order by t.name, i.name;
 -- keys
@@ -97,6 +138,8 @@ with x as (select k.id as id, t.name as 
 -- objects
 select name, nr from sys.objects order by name, nr;
 -- privileges
+--  schemas
+select s.name, u.name from sys.schemas s, sys.users u where s.id = 
u.default_schema order by s.name, u.name;
 --  tables
 select t.name, a.name, p.privileges, g.name, p.grantable from sys._tables t, 
sys.privileges p left outer join sys.auths g on p.grantor = g.id, sys.auths a 
where t.id = p.obj_id and p.auth_id = a.id order by t.name, a.name;
 --  columns
diff --git a/clients/Tests/SQL-dump.stable.out 
b/clients/Tests/SQL-dump.stable.out
--- a/clients/Tests/SQL-dump.stable.out
+++ b/clients/Tests/SQL-dump.stable.out
@@ -1204,7 +1204,24 @@ select s.name, f.name, replace(replace(p
 ', '', ''), '[         
 ]+', ' ', 'm'), '^ ', '', ''), '( ', '('), ' )', ')') as query, f.mod, 
f.language, f.type, f.side_effect, f.varres, f.vararg from sys.functions f left 
outer join sys.schemas s on f.schema_id = s.id order by s.name, f.name, query;
 -- args
-select f.name, a.name, a.type, a.type_digits, a.type_scale, a.inout, a.number 
from sys.args a left outer join sys.functions f on a.func_id = f.id order by 
f.name, a.func_id, a.number;
+with
+arg1 (id, id1, name1, type1, type_digits1, type_scale1, inout1) as (select 
f.id, a1.id, a1.name, a1.type, a1.type_digits, a1.type_scale, a1.inout from 
sys.functions f left outer join args a1 on a1.func_id = f.id and a1.number = 1),
+arg2 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2) as (select arg1.*, a2.id, a2.name, 
a2.type, a2.type_digits, a2.type_scale, a2.inout from arg1 left outer join args 
a2 on a2.func_id = arg1.id and a2.number = 2),
+arg3 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3) as (select arg2.*, a3.id, a3.name, a3.type, 
a3.type_digits, a3.type_scale, a3.inout from arg2 left outer join args a3 on 
a3.func_id = arg2.id and a3.number = 3),
+arg4 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4) as 
(select arg3.*, a4.id, a4.name, a4.type, a4.type_digits, a4.type_scale, 
a4.inout from arg3 left outer join args a4 on a4.func_id = arg3.id and 
a4.number = 4),
+arg5 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5) as (select arg4.*, a5.id, 
a5.name, a5.type, a5.type_digits, a5.type_scale, a5.inout from arg4 left outer 
join args a5 on a5.func_id = arg4.id and a5.number = 5),
+arg6 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6) as (select arg5.*, a6.id, a6.name, a6.type, 
a6.type_digits, a6.type_scale, a6.inout from arg5 left outer join args a6 on 
a6.func_id = arg5.id and a6.number = 6),
+arg7 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7) as (select arg6.*, a7.id, a7.name, a7.type, 
a7.type_digits, a7.type_scale, a7.inout from arg6 left outer join args a7 on 
a7.func_id = arg6.id and a7.number = 7),
+arg8 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7, id8, name8, type8, type_digits8, type_scale8, inout8) as 
(select arg7.*, a8.id, a8.name, a8.type, a8.type_digits, a8.type_scale, 
a8.inout from arg7 left outer join args a8 on a8.func_id = arg7.id and 
a8.number = 8),
+arg9 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7, id8, name8, type8, type_digits8, type_scale8, inout8, id9, 
name9, type9, type_digits9, type_scale9, inout9) as (select arg8.*, a9.id, 
a9.name, a9.type, a9.type_digits, a9.type_scale, a9.inout from arg8 left outer 
join args a9 on a9.func_id = arg8.id and a9.number = 9),
+arg10 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7, id8, name8, type8, type_digits8, type_scale8, inout8, id9, 
name9, type9, type_digits9, type_scale9, inout9, id10, name10, type10, 
type_digits10, type_scale10, inout10) as (select arg9.*, a10.id, a10.name, 
a10.type, a10.type_digits, a10.type_scale, a10.inout from arg9 left outer join 
args a10 on a10.func_id = arg9.id and a10.number = 10),
+arg11 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7, id8, name8, type8, type_digits8, type_scale8, inout8, id9, 
name9, type9, type_digits9, type_scale9, inout9, id10, name10, type10, 
type_digits10, type_scale10, inout10, id11, name11, type11, type_digits11, 
type_scale11, inout11) as (select arg10.*, a11.id, a11.name, a11.type, 
a11.type_digits, a11.type_scale, a11.inout from arg10 left outer join args a11 
on a11.func_id = arg10.id and a11.number = 11),
+arg12 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7, id8, name8, type8, type_digits8, type_scale8, inout8, id9, 
name9, type9, type_digits9, type_scale9, inout9, id10, name10, type10, 
type_digits10, type_scale10, inout10, id11, name11, type11, type_digits11, 
type_scale11, inout11, id12, name12, type12, type_digits12, type_scale12, 
inout12) as (select arg11.*, a12.id, a12.name, a12.type, a12.type_digits, 
a12.type_scale, a12.inout from arg11 left outer join args a12 on a12.func_id = 
arg11.id and a12.number = 12),
+arg13 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7, id8, name8, type8, type_digits8, type_scale8, inout8, id9, 
name9, type9, type_digits9, type_scale9, inout9, id10, name10, type10, 
type_digits10, type_scale10, inout10, id11, name11, type11, type_digits11, 
type_scale11, inout11, id12, name12, type12, type_digits12, type_scale12, 
inout12, id13, name13, type13, type_digits13, type_scale13, inout13) as (select 
arg12.*, a13.id, a13.name, a13.type, a13.type_digits, a13.type_scale, a13.inout 
from arg12 left outer join args a13 on a13.func_id = arg12.id and a13.number = 
13),
+arg14 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7, id8, name8, type8, type_digits8, type_scale8, inout8, id9, 
name9, type9, type_digits9, type_scale9, inout9, id10, name10, type10, 
type_digits10, type_scale10, inout10, id11, name11, type11, type_digits11, 
type_scale11, inout11, id12, name12, type12, type_digits12, type_scale12, 
inout12, id13, name13, type13, type_digits13, type_scale13, inout13, id14, 
name14, type14, type_digits14, type_scale14, inout14) as (select arg13.*, 
a14.id, a14.name, a14.type, a14.type_digits, a14.type_scale, a14.inout from 
arg13 left outer join args a14 on a14.func_id = arg13.id and a14.number = 14),
+arg15 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7, id8, name8, type8, type_digits8, type_scale8, inout8, id9, 
name9, type9, type_digits9, type_scale9, inout9, id10, name10, type10, 
type_digits10, type_scale10, inout10, id11, name11, type11, type_digits11, 
type_scale11, inout11, id12, name12, type12, type_digits12, type_scale12, 
inout12, id13, name13, type13, type_digits13, type_scale13, inout13, id14, 
name14, type14, type_digits14, type_scale14, inout14, id15, name15, type15, 
type_digits15, type_scale15, inout15) as (select arg14.*, a15.id, a15.name, 
a15.type, a15.type_digits, a15.type_scale, a15.inout from arg14 left outer join 
args a15 on a15.func_i
 d = arg14.id and a15.number = 15),
+arg16 (id, id1, name1, type1, type_digits1, type_scale1, inout1, id2, name2, 
type2, type_digits2, type_scale2, inout2, id3, name3, type3, type_digits3, 
type_scale3, inout3, id4, name4, type4, type_digits4, type_scale4, inout4, id5, 
name5, type5, type_digits5, type_scale5, inout5, id6, name6, type6, 
type_digits6, type_scale6, inout6, id7, name7, type7, type_digits7, 
type_scale7, inout7, id8, name8, type8, type_digits8, type_scale8, inout8, id9, 
name9, type9, type_digits9, type_scale9, inout9, id10, name10, type10, 
type_digits10, type_scale10, inout10, id11, name11, type11, type_digits11, 
type_scale11, inout11, id12, name12, type12, type_digits12, type_scale12, 
inout12, id13, name13, type13, type_digits13, type_scale13, inout13, id14, 
name14, type14, type_digits14, type_scale14, inout14, id15, name15, type15, 
type_digits15, type_scale15, inout15, id16, name16, type16, type_digits16, 
type_scale16, inout16) as (select arg15.*, a16.id, a16.name, a16.type, 
a16.type_digits, a16.type_scale,
  a16.inout from arg15 left outer join args a16 on a16.func_id = arg15.id and 
a16.number = 16)
+select s.name, f.name, arg16.name1, arg16.type1, arg16.type_digits1, 
arg16.type_scale1, arg16.inout1, arg16.name2, arg16.type2, arg16.type_digits2, 
arg16.type_scale2, arg16.inout2, arg16.name3, arg16.type3, arg16.type_digits3, 
arg16.type_scale3, arg16.inout3, arg16.name4, arg16.type4, arg16.type_digits4, 
arg16.type_scale4, arg16.inout4, arg16.name5, arg16.type5, arg16.type_digits5, 
arg16.type_scale5, arg16.inout5, arg16.name6, arg16.type6, arg16.type_digits6, 
arg16.type_scale6, arg16.inout6, arg16.name7, arg16.type7, arg16.type_digits7, 
arg16.type_scale7, arg16.inout7, arg16.name8, arg16.type8, arg16.type_digits8, 
arg16.type_scale8, arg16.inout8, arg16.name9, arg16.type9, arg16.type_digits9, 
arg16.type_scale9, arg16.inout9, arg16.name10, arg16.type10, 
arg16.type_digits10, arg16.type_scale10, arg16.inout10, arg16.name11, 
arg16.type11, arg16.type_digits11, arg16.type_scale11, arg16.inout11, 
arg16.name12, arg16.type12, arg16.type_digits12, arg16.type_scale12, 
arg16.inout12, arg16.name1
 3, arg16.type13, arg16.type_digits13, arg16.type_scale13, arg16.inout13, 
arg16.name14, arg16.type14, arg16.type_digits14, arg16.type_scale14, 
arg16.inout14, arg16.name15, arg16.type15, arg16.type_digits15, 
arg16.type_scale15, arg16.inout15 from arg16, sys.schemas s, sys.functions f 
where s.id = f.schema_id and f.id = arg16.id order by s.name, f.name, 
arg16.name1, arg16.type1, arg16.type_digits1, arg16.type_scale1, arg16.inout1, 
arg16.name2, arg16.type2, arg16.type_digits2, arg16.type_scale2, arg16.inout2, 
arg16.name3, arg16.type3, arg16.type_digits3, arg16.type_scale3, arg16.inout3, 
arg16.name4, arg16.type4, arg16.type_digits4, arg16.type_scale4, arg16.inout4, 
arg16.name5, arg16.type5, arg16.type_digits5, arg16.type_scale5, arg16.inout5, 
arg16.name6, arg16.type6, arg16.type_digits6, arg16.type_scale6, arg16.inout6, 
arg16.name7, arg16.type7, arg16.type_digits7, arg16.type_scale7, arg16.inout7, 
arg16.name8, arg16.type8, arg16.type_digits8, arg16.type_scale8, arg16.inout8, 
arg16.name9,
  arg16.type9, arg16.type_digits9, arg16.type_scale9, arg16.inout9, 
arg16.name10, arg16.type10, arg16.type_digits10, arg16.type_scale10, 
arg16.inout10, arg16.name11, arg16.type11, arg16.type_digits11, 
arg16.type_scale11, arg16.inout11, arg16.name12, arg16.type12, 
arg16.type_digits12, arg16.type_scale12, arg16.inout12, arg16.name13, 
arg16.type13, arg16.type_digits13, arg16.type_scale13, arg16.inout13, 
arg16.name14, arg16.type14, arg16.type_digits14, arg16.type_scale14, 
arg16.inout14, arg16.name15, arg16.type15, arg16.type_digits15, 
arg16.type_scale15, arg16.inout15;
 -- auths
 select name, grantor from sys.auths;
 -- connections (expect empty)
@@ -1212,15 +1229,15 @@ select server, port, db, db_alias, user,
 -- db_user_info
 select u.name, u.fullname, s.name from sys.db_user_info u left outer join 
sys.schemas s on u.default_schema = s.id order by u.name;
 -- dependencies
-select s1.name, f1.name, s2.name, f2.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from sys.dependencies d, 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 s1.name, t.name, s2.name, f.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from sys.dependencies d, 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 s1.name, t.name, c.name, s2.name, f.name, case d.depend_type when 1 
then 'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from sys.dependencies d, 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 s1.name, f1.name, s2.name, t2.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from schemas s1, functions f1, schemas s2, _tables t2, 
dependencies d 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 s1.name, t1.name, s2.name, t2.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from schemas s1, _tables t1, schemas s2, _tables t2, 
dependencies d 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 s1.name, t1.name, c1.name, s2.name, t2.name, case d.depend_type when 1 
then 'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from schemas s1, _tables t1, _columns c1, schemas s2, 
_tables t2, dependencies d 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;
-select s1.name, t1.name, c1.name, s2.name, t2.name, k2.name, case 
d.depend_type when 1 then 'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' 
when 3 then 'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 
'VIEW_DEPENDENCY' when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' 
when 8 then 'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from dependencies d, _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 s1.name, t1.name, c1.name, s2.name, t2.name, i2.name, case 
d.depend_type when 1 then 'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' 
when 3 then 'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 
'VIEW_DEPENDENCY' when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' 
when 8 then 'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from dependencies d, _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 t.systemname, t.sqlname, s.name, f.name, case d.depend_type when 1 then 
'SCHEMA_DEPENDENCY' when 2 then 'TABLE_DEPENDENCY' when 3 then 
'COLUMN_DEPENDENCY' when 4 then 'KEY_DEPENDENCY' when 5 then 'VIEW_DEPENDENCY' 
when 6 then 'USER_DEPENDENCY' when 7 then 'FUNC_DEPENDENCY' when 8 then 
'TRIGGER_DEPENDENCY' when 9 then 'OWNER_DEPENDENCY' when 10 then 
'INDEX_DEPENDENCY' when 11 then 'FKEY_DEPENDENCY' when 12 then 'SEQ_DEPENDENCY' 
when 13 then 'PROC_DEPENDENCY' when 14 then 'BEDROPPED_DEPENDENCY' when 15 then 
'TYPE_DEPENDENCY' end from types t, functions f, schemas s, dependencies d 
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 s1.name, f1.name, s2.name, f2.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), sys.dependencies d, sys.functions f1, sys.functions f2, 
sys.schemas s1, sys.schemas s2 where d.depend_type = dt.id and 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 s1.name, t.name, s2.name, f.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), sys.dependencies d, sys._tables t, sys.schemas s1, sys.functions 
f, sys.schemas s2 where d.depend_type = dt.id and 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 s1.name, t.name, c.name, s2.name, f.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), sys.dependencies d, sys._columns c, sys._tables t, sys.schemas 
s1, sys.functions f, sys.schemas s2 where d.depend_type = dt.id and 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 s1.name, f1.name, s2.name, t2.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), schemas s1, functions f1, schemas s2, _tables t2, dependencies d 
where d.depend_type = dt.id and 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 s1.name, t1.name, s2.name, t2.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), schemas s1, _tables t1, schemas s2, _tables t2, dependencies d 
where d.depend_type = dt.id and 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 s1.name, t1.name, c1.name, s2.name, t2.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), schemas s1, _tables t1, _columns c1, schemas s2, _tables t2, 
dependencies d where d.depend_type = dt.id and 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;
+select s1.name, t1.name, c1.name, s2.name, t2.name, k2.name, dt.name from 
(values (1, 'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 
'COLUMN_DEPENDENCY'), (4, 'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 
'USER_DEPENDENCY'), (7, 'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 
'OWNER_DEPENDENCY'), (10, 'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 
'SEQ_DEPENDENCY'), (13, 'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 
'TYPE_DEPENDENCY')) as dt (id, name), dependencies d, _tables t1, _tables t2, 
schemas s1, schemas s2, _columns c1, keys k2 where d.depend_type = dt.id and 
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 s1.name, t1.name, c1.name, s2.name, t2.name, i2.name, dt.name from 
(values (1, 'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 
'COLUMN_DEPENDENCY'), (4, 'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 
'USER_DEPENDENCY'), (7, 'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 
'OWNER_DEPENDENCY'), (10, 'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 
'SEQ_DEPENDENCY'), (13, 'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 
'TYPE_DEPENDENCY')) as dt (id, name), dependencies d, _tables t1, _tables t2, 
schemas s1, schemas s2, _columns c1, idxs i2 where d.depend_type = dt.id and 
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 t.systemname, t.sqlname, s.name, f.name, dt.name from (values (1, 
'SCHEMA_DEPENDENCY'), (2, 'TABLE_DEPENDENCY'), (3, 'COLUMN_DEPENDENCY'), (4, 
'KEY_DEPENDENCY'), (5, 'VIEW_DEPENDENCY'), (6, 'USER_DEPENDENCY'), (7, 
'FUNC_DEPENDENCY'), (8, 'TRIGGER_DEPENDENCY'), (9, 'OWNER_DEPENDENCY'), (10, 
'INDEX_DEPENDENCY'), (11, 'FKEY_DEPENDENCY'), (12, 'SEQ_DEPENDENCY'), (13, 
'PROC_DEPENDENCY'), (14, 'BEDROPPED_DEPENDENCY'), (15, 'TYPE_DEPENDENCY')) as 
dt (id, name), types t, functions f, schemas s, dependencies d where 
d.depend_type = dt.id and 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 t.name, i.name, i.type from sys.idxs i left outer join sys._tables t on 
t.id = i.table_id order by t.name, i.name;
 -- keys
@@ -1228,6 +1245,8 @@ with x as (select k.id as id, t.name as 
 -- objects
 select name, nr from sys.objects order by name, nr;
 -- privileges
+--  schemas
+select s.name, u.name from sys.schemas s, sys.users u where s.id = 
u.default_schema order by s.name, u.name;
 --  tables
 select t.name, a.name, p.privileges, g.name, p.grantable from sys._tables t, 
sys.privileges p left outer join sys.auths g on p.grantor = g.id, sys.auths a 
where t.id = p.obj_id and p.auth_id = a.id order by t.name, a.name;
 --  columns
@@ -3345,4607 +3364,1643 @@ drop function pcre_replace(string, strin
 [ "sys",       "zorder_decode_x",      "create function zorder_decode_x(z oid) 
returns integer external name zorder.decode_x;",        "zorder",       1,      
1,      false,  false,  false   ]
 [ "sys",       "zorder_decode_y",      "create function zorder_decode_y(z oid) 
returns integer external name zorder.decode_y;",        "zorder",       1,      
1,      false,  false,  false   ]
 [ "sys",       "zorder_encode",        "create function zorder_encode(x 
integer, y integer) returns oid external name zorder.encode;", "zorder",       
1,      1,      false,  false,  false   ]
-#select f.name, a.name, a.type, a.type_digits, a.type_scale, a.inout, a.number 
from sys.args a left outer join sys.functions f on a.func_id = f.id order by 
f.name, a.func_id, a.number;
-% .f,  .a,     .a,     .a,     .a,     .a,     .a # table_name
-% name,        name,   type,   type_digits,    type_scale,     inout,  number 
# name
-% varchar,     varchar,        varchar,        int,    int,    tinyint,        
int # type
-% 35,  27,     14,     4,      1,      1,      2 # length
-[ "<", "res_0",        "boolean",      1,      0,      0,      0       ]
-[ "<", "arg_1",        "any",  0,      0,      1,      1       ]
-[ "<", "arg_2",        "any",  0,      0,      1,      2       ]
-[ "<=",        "res_0",        "boolean",      1,      0,      0,      0       
]
-[ "<=",        "arg_1",        "any",  0,      0,      1,      1       ]
-[ "<=",        "arg_2",        "any",  0,      0,      1,      2       ]
-[ "<>",        "res_0",        "boolean",      1,      0,      0,      0       
]
-[ "<>",        "arg_1",        "any",  0,      0,      1,      1       ]
-[ "<>",        "arg_2",        "any",  0,      0,      1,      2       ]
-[ "=", "res_0",        "boolean",      1,      0,      0,      0       ]
-[ "=", "arg_1",        "any",  0,      0,      1,      1       ]
-[ "=", "arg_2",        "any",  0,      0,      1,      2       ]
-[ ">", "res_0",        "boolean",      1,      0,      0,      0       ]
-[ ">", "arg_1",        "any",  0,      0,      1,      1       ]
-[ ">", "arg_2",        "any",  0,      0,      1,      2       ]
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to