Changeset: 9bbd1063375d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9bbd1063375d
Modified Files:
        sql/test/Dependencies/Tests/dependency_owner_schema_3.test
        sql/test/emptydb/Tests/check.stable.out
        sql/test/emptydb/Tests/check.stable.out.32bit
        sql/test/emptydb/Tests/check.stable.out.int128
Branch: Mar2025
Log Message:

Approve new output after adding table type LOCAL TEMPORARY VIEW


diffs (191 lines):

diff --git a/sql/test/Dependencies/Tests/dependency_owner_schema_3.test 
b/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
--- a/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
+++ b/sql/test/Dependencies/Tests/dependency_owner_schema_3.test
@@ -86,9 +86,6 @@ DEP_VIEW
 _tables
 tables
 DEP_VIEW
-_tables
-views
-DEP_VIEW
 args
 dependency_args_on_types
 DEP_VIEW
@@ -764,6 +761,9 @@ DEP_VIEW
 tables
 tables
 DEP_VIEW
+tables
+views
+DEP_VIEW
 triggers
 dependency_columns_on_triggers
 DEP_VIEW
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
@@ -455,8 +455,8 @@ select 'null in fkeys.delete_action', de
 [ "sys._tables",       "information_schema",   "schemata",     "create view 
information_schema.schemata as select cast(null as varchar(1)) as catalog_name, 
s.\"name\" as schema_name, a.\"name\" as schema_owner, cast(null as varchar(1)) 
as default_character_set_catalog, cast(null as varchar(1)) as 
default_character_set_schema, cast('UTF-8' as varchar(16)) as 
default_character_set_name, cast(null as varchar(1)) as sql_path, s.\"id\" as 
schema_id, s.\"system\" as is_system, cm.\"remark\" as comments from 
sys.\"schemas\" s inner join sys.\"auths\" a on s.\"owner\" = a.\"id\" left 
outer join sys.\"comments\" cm on s.\"id\" = cm.\"id\" order by s.\"name\";",   
"VIEW", true,   "COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "information_schema",   "sequences",    "create view 
information_schema.sequences as select cast(null as varchar(1)) as 
sequence_catalog, s.\"name\" as sequence_schema, sq.\"name\" as sequence_name, 
cast('BIGINT' as varchar(16)) as data_type, cast(64 as smallint) as 
numeric_precision, cast(2 as smallint) as numeric_precision_radix, cast(0 as 
smallint) as numeric_scale, sq.\"start\" as start_value, sq.\"minvalue\" as 
minimum_value, sq.\"maxvalue\" as maximum_value, sq.\"increment\" as increment, 
cast(sys.ifthenelse(sq.\"cycle\", 'YES', 'NO') as varchar(3)) as cycle_option, 
cast(null as varchar(16)) as declared_data_type, cast(null as smallint) as 
declared_numeric_precision, cast(null as smallint) as declared_numeric_scale, 
sq.\"schema_id\" as schema_id, sq.\"id\" as sequence_id, 
get_value_for(s.\"name\", sq.\"name\") as current_value, sq.\"cacheinc\" as 
cacheinc, cm.\"remark\" as comments from sys.\"sequences\" sq inner join 
sys.\"schemas\" s on sq.\"schema_id\" = s.\"id\
 " left outer join sys.\"comments\" cm on sq.\"id\" = cm.\"id\" order by 
s.\"name\", sq.\"name\";",     "VIEW", true,   "COMMIT",       "WRITABLE",     
NULL    ]
 [ "sys._tables",       "information_schema",   "table_constraints",    "create 
view information_schema.table_constraints as select cast(null as varchar(1)) as 
constraint_catalog, s.\"name\" as constraint_schema, k.\"name\" as 
constraint_name, cast(null as varchar(1)) as table_catalog, s.\"name\" as 
table_schema, t.\"name\" as table_name, cast(case k.\"type\" when 0 then 
'PRIMARY KEY' when 1 then 'UNIQUE' when 2 then 'FOREIGN KEY' when 3 then 
'UNIQUE NULLS NOT DISTINCT' when 4 then 'CHECK' else null end as varchar(26)) 
as constraint_type, cast('NO' as varchar(3)) as is_deferrable, cast('NO' as 
varchar(3)) as initially_deferred, cast('YES' as varchar(3)) as enforced, 
t.\"schema_id\" as schema_id, t.\"id\" as table_id, k.\"id\" as key_id, 
k.\"type\" as key_type, t.\"system\" as is_system from (select sk.\"id\", 
sk.\"table_id\", sk.\"name\", sk.\"type\" from sys.\"keys\" sk union all select 
tk.\"id\", tk.\"table_id\", tk.\"name\", tk.\"type\" from tmp.\"keys\" tk) k 
inner join (select st.\"id\", s
 t.\"schema_id\", st.\"name\", st.\"system\" from sys.\"_tables\" st union all 
select tt.\"id\", tt.\"schema_id\", tt.\"name\", tt.\"system\" from 
tmp.\"_tables\" tt) t on k.\"table_id\" = t.\"id\" inner join sys.\"schemas\" s 
on t.\"schema_id\" = s.\"id\" order by s.\"name\", t.\"name\", k.\"name\";", 
"VIEW", true,   "COMMIT",       "WRITABLE",     NULL    ]
-[ "sys._tables",       "information_schema",   "tables",       "create view 
information_schema.tables as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, tt.\"table_type_name\" as 
table_type, cast(null as varchar(1)) as self_referencing_column_name, cast(null 
as varchar(1)) as reference_generation, cast(null as varchar(1)) as 
user_defined_type_catalog, cast(null as varchar(1)) as 
user_defined_type_schema, cast(null as varchar(1)) as user_defined_type_name, 
cast(sys.ifthenelse((t.\"type\" in (0, 3, 7, 20, 30) and t.\"access\" in (0, 
2)), 'YES', 'NO') as varchar(3)) as is_insertable_into, cast('NO' as 
varchar(3)) as is_typed, cast((case t.\"commit_action\" when 1 then 'DELETE' 
when 2 then 'PRESERVE' when 3 then 'DROP' else null end) as varchar(10)) as 
commit_action, t.\"schema_id\" as schema_id, t.\"id\" as table_id, t.\"type\" 
as table_type_id, st.\"count\" as row_count, t.\"system\" as is_system, 
sys.ifthenelse(t.\"type\" in (1, 11), true, fa
 lse) as is_view, t.\"query\" as query_def, cm.\"remark\" as comments from 
sys.\"tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = s.\"id\" 
inner join sys.\"table_types\" tt on t.\"type\" = tt.\"table_type_id\" left 
outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" left outer join (select 
distinct \"schema\", \"table\", \"count\" from sys.\"statistics\"()) st on 
(s.\"name\" = st.\"schema\" and t.\"name\" = st.\"table\") order by s.\"name\", 
t.\"name\";",      "VIEW", true,   "COMMIT",       "WRITABLE",     NULL    ]
-[ "sys._tables",       "information_schema",   "views",        "create view 
information_schema.views as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, t.\"query\" as 
view_definition, cast('NONE' as varchar(10)) as check_option, cast('NO' as 
varchar(3)) as is_updatable, cast('NO' as varchar(3)) as insertable_into, 
cast('NO' as varchar(3)) as is_trigger_updatable, cast('NO' as varchar(3)) as 
is_trigger_deletable, cast('NO' as varchar(3)) as is_trigger_insertable_into, 
t.\"schema_id\" as schema_id, t.\"id\" as table_id, 
cast(sys.ifthenelse(t.\"system\", t.\"type\" + 10 , t.\"type\") as smallint) as 
table_type_id, t.\"system\" as is_system, cm.\"remark\" as comments from 
sys.\"_tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = s.\"id\" 
left outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" where t.\"type\" = 
1 order by s.\"name\", t.\"name\";",  "VIEW", true,   "COMMIT",       
"WRITABLE",     NULL    ]
+[ "sys._tables",       "information_schema",   "tables",       "create view 
information_schema.tables as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, tt.\"table_type_name\" as 
table_type, cast(null as varchar(1)) as self_referencing_column_name, cast(null 
as varchar(1)) as reference_generation, cast(null as varchar(1)) as 
user_defined_type_catalog, cast(null as varchar(1)) as 
user_defined_type_schema, cast(null as varchar(1)) as user_defined_type_name, 
cast(sys.ifthenelse((t.\"type\" in (0, 3, 7, 20, 30) and t.\"access\" in (0, 
2)), 'YES', 'NO') as varchar(3)) as is_insertable_into, cast('NO' as 
varchar(3)) as is_typed, cast((case t.\"commit_action\" when 1 then 'DELETE' 
when 2 then 'PRESERVE' when 3 then 'DROP' else null end) as varchar(10)) as 
commit_action, t.\"schema_id\" as schema_id, t.\"id\" as table_id, t.\"type\" 
as table_type_id, st.\"count\" as row_count, t.\"system\" as is_system, 
sys.ifthenelse(t.\"type\" in (1, 11, 21, 31), 
 true, false) as is_view, t.\"query\" as query_def, cm.\"remark\" as comments 
from sys.\"tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = 
s.\"id\" inner join sys.\"table_types\" tt on t.\"type\" = tt.\"table_type_id\" 
left outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" left outer join 
(select distinct \"schema\", \"table\", \"count\" from sys.\"statistics\"()) st 
on (s.\"name\" = st.\"schema\" and t.\"name\" = st.\"table\") order by 
s.\"name\", t.\"name\";",      "VIEW", true,   "COMMIT",       "WRITABLE",     
NULL    ]
+[ "sys._tables",       "information_schema",   "views",        "create view 
information_schema.views as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, t.\"query\" as 
view_definition, cast('NONE' as varchar(10)) as check_option, cast('NO' as 
varchar(3)) as is_updatable, cast('NO' as varchar(3)) as insertable_into, 
cast('NO' as varchar(3)) as is_trigger_updatable, cast('NO' as varchar(3)) as 
is_trigger_deletable, cast('NO' as varchar(3)) as is_trigger_insertable_into, 
t.\"schema_id\" as schema_id, t.\"id\" as table_id, t.\"type\" as 
table_type_id, t.\"system\" as is_system, cm.\"remark\" as comments from 
sys.\"tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = s.\"id\" 
left outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" where t.\"type\" in 
(1, 11, 21, 31) order by s.\"name\", t.\"name\";",      "VIEW", true,   
"COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "logging",      "compinfo",     "create view 
logging.compinfo as select * from logging.compinfo();",    "VIEW", true,   
"COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "sys",  "_columns",     NULL,   "TABLE",        true,   
"COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "sys",  "_tables",      NULL,   "TABLE",        true,   
"COMMIT",       "WRITABLE",     NULL    ]
@@ -3222,9 +3222,9 @@ select 'null in fkeys.delete_action', de
 [ "table used by view",        "sys",  "schemas",      "information_schema",   
"tables",       "VIEW"  ]
 [ "table used by view",        "sys",  "table_types",  "information_schema",   
"tables",       "VIEW"  ]
 [ "table used by view",        "sys",  "tables",       "information_schema",   
"tables",       "VIEW"  ]
-[ "table used by view",        "sys",  "_tables",      "information_schema",   
"views",        "VIEW"  ]
 [ "table used by view",        "sys",  "comments",     "information_schema",   
"views",        "VIEW"  ]
 [ "table used by view",        "sys",  "schemas",      "information_schema",   
"views",        "VIEW"  ]
+[ "table used by view",        "sys",  "tables",       "information_schema",   
"views",        "VIEW"  ]
 [ "table used by view",        "sys",  "_columns",     "sys",  "columns",      
"VIEW"  ]
 [ "table used by view",        "tmp",  "_columns",     "sys",  "columns",      
"VIEW"  ]
 [ "table used by view",        "sys",  "dependencies", "sys",  
"dependencies_vw",      "VIEW"  ]
@@ -3604,16 +3604,16 @@ select 'null in fkeys.delete_action', de
 [ "column used by view",       "sys",  "tables",       "schema_id",    
"information_schema",   "tables",       "VIEW"  ]
 [ "column used by view",       "sys",  "tables",       "system",       
"information_schema",   "tables",       "VIEW"  ]
 [ "column used by view",       "sys",  "tables",       "type", 
"information_schema",   "tables",       "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "id",   
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "name", 
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "query",        
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "schema_id",    
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "system",       
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "type", 
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "comments",     "id",   
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "comments",     "remark",       
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "schemas",      "id",   
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "schemas",      "name", 
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "id",   
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "name", 
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "query",        
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "schema_id",    
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "system",       
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "type", 
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "_columns",     "default",      "sys",  
"columns",      "VIEW"  ]
 [ "column used by view",       "sys",  "_columns",     "id",   "sys",  
"columns",      "VIEW"  ]
 [ "column used by view",       "sys",  "_columns",     "name", "sys",  
"columns",      "VIEW"  ]
@@ -5471,6 +5471,7 @@ select 'null in fkeys.delete_action', de
 [ "sys.table_types",   11,     "SYSTEM VIEW"   ]
 [ "sys.table_types",   20,     "GLOBAL TEMPORARY TABLE"        ]
 [ "sys.table_types",   30,     "LOCAL TEMPORARY TABLE" ]
+[ "sys.table_types",   31,     "LOCAL TEMPORARY VIEW"  ]
 % .%1, .function_types,        .function_types # table_name
 % %1,  function_type_name,     function_type_keyword # name
 % varchar,     varchar,        varchar # type
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
@@ -455,8 +455,8 @@ select 'null in fkeys.delete_action', de
 [ "sys._tables",       "information_schema",   "schemata",     "create view 
information_schema.schemata as select cast(null as varchar(1)) as catalog_name, 
s.\"name\" as schema_name, a.\"name\" as schema_owner, cast(null as varchar(1)) 
as default_character_set_catalog, cast(null as varchar(1)) as 
default_character_set_schema, cast('UTF-8' as varchar(16)) as 
default_character_set_name, cast(null as varchar(1)) as sql_path, s.\"id\" as 
schema_id, s.\"system\" as is_system, cm.\"remark\" as comments from 
sys.\"schemas\" s inner join sys.\"auths\" a on s.\"owner\" = a.\"id\" left 
outer join sys.\"comments\" cm on s.\"id\" = cm.\"id\" order by s.\"name\";",   
"VIEW", true,   "COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "information_schema",   "sequences",    "create view 
information_schema.sequences as select cast(null as varchar(1)) as 
sequence_catalog, s.\"name\" as sequence_schema, sq.\"name\" as sequence_name, 
cast('BIGINT' as varchar(16)) as data_type, cast(64 as smallint) as 
numeric_precision, cast(2 as smallint) as numeric_precision_radix, cast(0 as 
smallint) as numeric_scale, sq.\"start\" as start_value, sq.\"minvalue\" as 
minimum_value, sq.\"maxvalue\" as maximum_value, sq.\"increment\" as increment, 
cast(sys.ifthenelse(sq.\"cycle\", 'YES', 'NO') as varchar(3)) as cycle_option, 
cast(null as varchar(16)) as declared_data_type, cast(null as smallint) as 
declared_numeric_precision, cast(null as smallint) as declared_numeric_scale, 
sq.\"schema_id\" as schema_id, sq.\"id\" as sequence_id, 
get_value_for(s.\"name\", sq.\"name\") as current_value, sq.\"cacheinc\" as 
cacheinc, cm.\"remark\" as comments from sys.\"sequences\" sq inner join 
sys.\"schemas\" s on sq.\"schema_id\" = s.\"id\
 " left outer join sys.\"comments\" cm on sq.\"id\" = cm.\"id\" order by 
s.\"name\", sq.\"name\";",     "VIEW", true,   "COMMIT",       "WRITABLE",     
NULL    ]
 [ "sys._tables",       "information_schema",   "table_constraints",    "create 
view information_schema.table_constraints as select cast(null as varchar(1)) as 
constraint_catalog, s.\"name\" as constraint_schema, k.\"name\" as 
constraint_name, cast(null as varchar(1)) as table_catalog, s.\"name\" as 
table_schema, t.\"name\" as table_name, cast(case k.\"type\" when 0 then 
'PRIMARY KEY' when 1 then 'UNIQUE' when 2 then 'FOREIGN KEY' when 3 then 
'UNIQUE NULLS NOT DISTINCT' when 4 then 'CHECK' else null end as varchar(26)) 
as constraint_type, cast('NO' as varchar(3)) as is_deferrable, cast('NO' as 
varchar(3)) as initially_deferred, cast('YES' as varchar(3)) as enforced, 
t.\"schema_id\" as schema_id, t.\"id\" as table_id, k.\"id\" as key_id, 
k.\"type\" as key_type, t.\"system\" as is_system from (select sk.\"id\", 
sk.\"table_id\", sk.\"name\", sk.\"type\" from sys.\"keys\" sk union all select 
tk.\"id\", tk.\"table_id\", tk.\"name\", tk.\"type\" from tmp.\"keys\" tk) k 
inner join (select st.\"id\", s
 t.\"schema_id\", st.\"name\", st.\"system\" from sys.\"_tables\" st union all 
select tt.\"id\", tt.\"schema_id\", tt.\"name\", tt.\"system\" from 
tmp.\"_tables\" tt) t on k.\"table_id\" = t.\"id\" inner join sys.\"schemas\" s 
on t.\"schema_id\" = s.\"id\" order by s.\"name\", t.\"name\", k.\"name\";", 
"VIEW", true,   "COMMIT",       "WRITABLE",     NULL    ]
-[ "sys._tables",       "information_schema",   "tables",       "create view 
information_schema.tables as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, tt.\"table_type_name\" as 
table_type, cast(null as varchar(1)) as self_referencing_column_name, cast(null 
as varchar(1)) as reference_generation, cast(null as varchar(1)) as 
user_defined_type_catalog, cast(null as varchar(1)) as 
user_defined_type_schema, cast(null as varchar(1)) as user_defined_type_name, 
cast(sys.ifthenelse((t.\"type\" in (0, 3, 7, 20, 30) and t.\"access\" in (0, 
2)), 'YES', 'NO') as varchar(3)) as is_insertable_into, cast('NO' as 
varchar(3)) as is_typed, cast((case t.\"commit_action\" when 1 then 'DELETE' 
when 2 then 'PRESERVE' when 3 then 'DROP' else null end) as varchar(10)) as 
commit_action, t.\"schema_id\" as schema_id, t.\"id\" as table_id, t.\"type\" 
as table_type_id, st.\"count\" as row_count, t.\"system\" as is_system, 
sys.ifthenelse(t.\"type\" in (1, 11), true, fa
 lse) as is_view, t.\"query\" as query_def, cm.\"remark\" as comments from 
sys.\"tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = s.\"id\" 
inner join sys.\"table_types\" tt on t.\"type\" = tt.\"table_type_id\" left 
outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" left outer join (select 
distinct \"schema\", \"table\", \"count\" from sys.\"statistics\"()) st on 
(s.\"name\" = st.\"schema\" and t.\"name\" = st.\"table\") order by s.\"name\", 
t.\"name\";",      "VIEW", true,   "COMMIT",       "WRITABLE",     NULL    ]
-[ "sys._tables",       "information_schema",   "views",        "create view 
information_schema.views as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, t.\"query\" as 
view_definition, cast('NONE' as varchar(10)) as check_option, cast('NO' as 
varchar(3)) as is_updatable, cast('NO' as varchar(3)) as insertable_into, 
cast('NO' as varchar(3)) as is_trigger_updatable, cast('NO' as varchar(3)) as 
is_trigger_deletable, cast('NO' as varchar(3)) as is_trigger_insertable_into, 
t.\"schema_id\" as schema_id, t.\"id\" as table_id, 
cast(sys.ifthenelse(t.\"system\", t.\"type\" + 10 , t.\"type\") as smallint) as 
table_type_id, t.\"system\" as is_system, cm.\"remark\" as comments from 
sys.\"_tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = s.\"id\" 
left outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" where t.\"type\" = 
1 order by s.\"name\", t.\"name\";",  "VIEW", true,   "COMMIT",       
"WRITABLE",     NULL    ]
+[ "sys._tables",       "information_schema",   "tables",       "create view 
information_schema.tables as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, tt.\"table_type_name\" as 
table_type, cast(null as varchar(1)) as self_referencing_column_name, cast(null 
as varchar(1)) as reference_generation, cast(null as varchar(1)) as 
user_defined_type_catalog, cast(null as varchar(1)) as 
user_defined_type_schema, cast(null as varchar(1)) as user_defined_type_name, 
cast(sys.ifthenelse((t.\"type\" in (0, 3, 7, 20, 30) and t.\"access\" in (0, 
2)), 'YES', 'NO') as varchar(3)) as is_insertable_into, cast('NO' as 
varchar(3)) as is_typed, cast((case t.\"commit_action\" when 1 then 'DELETE' 
when 2 then 'PRESERVE' when 3 then 'DROP' else null end) as varchar(10)) as 
commit_action, t.\"schema_id\" as schema_id, t.\"id\" as table_id, t.\"type\" 
as table_type_id, st.\"count\" as row_count, t.\"system\" as is_system, 
sys.ifthenelse(t.\"type\" in (1, 11, 21, 31), 
 true, false) as is_view, t.\"query\" as query_def, cm.\"remark\" as comments 
from sys.\"tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = 
s.\"id\" inner join sys.\"table_types\" tt on t.\"type\" = tt.\"table_type_id\" 
left outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" left outer join 
(select distinct \"schema\", \"table\", \"count\" from sys.\"statistics\"()) st 
on (s.\"name\" = st.\"schema\" and t.\"name\" = st.\"table\") order by 
s.\"name\", t.\"name\";",      "VIEW", true,   "COMMIT",       "WRITABLE",     
NULL    ]
+[ "sys._tables",       "information_schema",   "views",        "create view 
information_schema.views as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, t.\"query\" as 
view_definition, cast('NONE' as varchar(10)) as check_option, cast('NO' as 
varchar(3)) as is_updatable, cast('NO' as varchar(3)) as insertable_into, 
cast('NO' as varchar(3)) as is_trigger_updatable, cast('NO' as varchar(3)) as 
is_trigger_deletable, cast('NO' as varchar(3)) as is_trigger_insertable_into, 
t.\"schema_id\" as schema_id, t.\"id\" as table_id, t.\"type\" as 
table_type_id, t.\"system\" as is_system, cm.\"remark\" as comments from 
sys.\"tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = s.\"id\" 
left outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" where t.\"type\" in 
(1, 11, 21, 31) order by s.\"name\", t.\"name\";",      "VIEW", true,   
"COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "logging",      "compinfo",     "create view 
logging.compinfo as select * from logging.compinfo();",    "VIEW", true,   
"COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "sys",  "_columns",     NULL,   "TABLE",        true,   
"COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "sys",  "_tables",      NULL,   "TABLE",        true,   
"COMMIT",       "WRITABLE",     NULL    ]
@@ -3222,9 +3222,9 @@ select 'null in fkeys.delete_action', de
 [ "table used by view",        "sys",  "schemas",      "information_schema",   
"tables",       "VIEW"  ]
 [ "table used by view",        "sys",  "table_types",  "information_schema",   
"tables",       "VIEW"  ]
 [ "table used by view",        "sys",  "tables",       "information_schema",   
"tables",       "VIEW"  ]
-[ "table used by view",        "sys",  "_tables",      "information_schema",   
"views",        "VIEW"  ]
 [ "table used by view",        "sys",  "comments",     "information_schema",   
"views",        "VIEW"  ]
 [ "table used by view",        "sys",  "schemas",      "information_schema",   
"views",        "VIEW"  ]
+[ "table used by view",        "sys",  "tables",       "information_schema",   
"views",        "VIEW"  ]
 [ "table used by view",        "sys",  "_columns",     "sys",  "columns",      
"VIEW"  ]
 [ "table used by view",        "tmp",  "_columns",     "sys",  "columns",      
"VIEW"  ]
 [ "table used by view",        "sys",  "dependencies", "sys",  
"dependencies_vw",      "VIEW"  ]
@@ -3604,16 +3604,16 @@ select 'null in fkeys.delete_action', de
 [ "column used by view",       "sys",  "tables",       "schema_id",    
"information_schema",   "tables",       "VIEW"  ]
 [ "column used by view",       "sys",  "tables",       "system",       
"information_schema",   "tables",       "VIEW"  ]
 [ "column used by view",       "sys",  "tables",       "type", 
"information_schema",   "tables",       "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "id",   
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "name", 
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "query",        
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "schema_id",    
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "system",       
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "type", 
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "comments",     "id",   
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "comments",     "remark",       
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "schemas",      "id",   
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "schemas",      "name", 
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "id",   
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "name", 
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "query",        
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "schema_id",    
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "system",       
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "type", 
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "_columns",     "default",      "sys",  
"columns",      "VIEW"  ]
 [ "column used by view",       "sys",  "_columns",     "id",   "sys",  
"columns",      "VIEW"  ]
 [ "column used by view",       "sys",  "_columns",     "name", "sys",  
"columns",      "VIEW"  ]
@@ -5471,6 +5471,7 @@ select 'null in fkeys.delete_action', de
 [ "sys.table_types",   11,     "SYSTEM VIEW"   ]
 [ "sys.table_types",   20,     "GLOBAL TEMPORARY TABLE"        ]
 [ "sys.table_types",   30,     "LOCAL TEMPORARY TABLE" ]
+[ "sys.table_types",   31,     "LOCAL TEMPORARY VIEW"  ]
 % .%1, .function_types,        .function_types # table_name
 % %1,  function_type_name,     function_type_keyword # name
 % varchar,     varchar,        varchar # type
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
@@ -455,8 +455,8 @@ select 'null in fkeys.delete_action', de
 [ "sys._tables",       "information_schema",   "schemata",     "create view 
information_schema.schemata as select cast(null as varchar(1)) as catalog_name, 
s.\"name\" as schema_name, a.\"name\" as schema_owner, cast(null as varchar(1)) 
as default_character_set_catalog, cast(null as varchar(1)) as 
default_character_set_schema, cast('UTF-8' as varchar(16)) as 
default_character_set_name, cast(null as varchar(1)) as sql_path, s.\"id\" as 
schema_id, s.\"system\" as is_system, cm.\"remark\" as comments from 
sys.\"schemas\" s inner join sys.\"auths\" a on s.\"owner\" = a.\"id\" left 
outer join sys.\"comments\" cm on s.\"id\" = cm.\"id\" order by s.\"name\";",   
"VIEW", true,   "COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "information_schema",   "sequences",    "create view 
information_schema.sequences as select cast(null as varchar(1)) as 
sequence_catalog, s.\"name\" as sequence_schema, sq.\"name\" as sequence_name, 
cast('BIGINT' as varchar(16)) as data_type, cast(64 as smallint) as 
numeric_precision, cast(2 as smallint) as numeric_precision_radix, cast(0 as 
smallint) as numeric_scale, sq.\"start\" as start_value, sq.\"minvalue\" as 
minimum_value, sq.\"maxvalue\" as maximum_value, sq.\"increment\" as increment, 
cast(sys.ifthenelse(sq.\"cycle\", 'YES', 'NO') as varchar(3)) as cycle_option, 
cast(null as varchar(16)) as declared_data_type, cast(null as smallint) as 
declared_numeric_precision, cast(null as smallint) as declared_numeric_scale, 
sq.\"schema_id\" as schema_id, sq.\"id\" as sequence_id, 
get_value_for(s.\"name\", sq.\"name\") as current_value, sq.\"cacheinc\" as 
cacheinc, cm.\"remark\" as comments from sys.\"sequences\" sq inner join 
sys.\"schemas\" s on sq.\"schema_id\" = s.\"id\
 " left outer join sys.\"comments\" cm on sq.\"id\" = cm.\"id\" order by 
s.\"name\", sq.\"name\";",     "VIEW", true,   "COMMIT",       "WRITABLE",     
NULL    ]
 [ "sys._tables",       "information_schema",   "table_constraints",    "create 
view information_schema.table_constraints as select cast(null as varchar(1)) as 
constraint_catalog, s.\"name\" as constraint_schema, k.\"name\" as 
constraint_name, cast(null as varchar(1)) as table_catalog, s.\"name\" as 
table_schema, t.\"name\" as table_name, cast(case k.\"type\" when 0 then 
'PRIMARY KEY' when 1 then 'UNIQUE' when 2 then 'FOREIGN KEY' when 3 then 
'UNIQUE NULLS NOT DISTINCT' when 4 then 'CHECK' else null end as varchar(26)) 
as constraint_type, cast('NO' as varchar(3)) as is_deferrable, cast('NO' as 
varchar(3)) as initially_deferred, cast('YES' as varchar(3)) as enforced, 
t.\"schema_id\" as schema_id, t.\"id\" as table_id, k.\"id\" as key_id, 
k.\"type\" as key_type, t.\"system\" as is_system from (select sk.\"id\", 
sk.\"table_id\", sk.\"name\", sk.\"type\" from sys.\"keys\" sk union all select 
tk.\"id\", tk.\"table_id\", tk.\"name\", tk.\"type\" from tmp.\"keys\" tk) k 
inner join (select st.\"id\", s
 t.\"schema_id\", st.\"name\", st.\"system\" from sys.\"_tables\" st union all 
select tt.\"id\", tt.\"schema_id\", tt.\"name\", tt.\"system\" from 
tmp.\"_tables\" tt) t on k.\"table_id\" = t.\"id\" inner join sys.\"schemas\" s 
on t.\"schema_id\" = s.\"id\" order by s.\"name\", t.\"name\", k.\"name\";", 
"VIEW", true,   "COMMIT",       "WRITABLE",     NULL    ]
-[ "sys._tables",       "information_schema",   "tables",       "create view 
information_schema.tables as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, tt.\"table_type_name\" as 
table_type, cast(null as varchar(1)) as self_referencing_column_name, cast(null 
as varchar(1)) as reference_generation, cast(null as varchar(1)) as 
user_defined_type_catalog, cast(null as varchar(1)) as 
user_defined_type_schema, cast(null as varchar(1)) as user_defined_type_name, 
cast(sys.ifthenelse((t.\"type\" in (0, 3, 7, 20, 30) and t.\"access\" in (0, 
2)), 'YES', 'NO') as varchar(3)) as is_insertable_into, cast('NO' as 
varchar(3)) as is_typed, cast((case t.\"commit_action\" when 1 then 'DELETE' 
when 2 then 'PRESERVE' when 3 then 'DROP' else null end) as varchar(10)) as 
commit_action, t.\"schema_id\" as schema_id, t.\"id\" as table_id, t.\"type\" 
as table_type_id, st.\"count\" as row_count, t.\"system\" as is_system, 
sys.ifthenelse(t.\"type\" in (1, 11), true, fa
 lse) as is_view, t.\"query\" as query_def, cm.\"remark\" as comments from 
sys.\"tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = s.\"id\" 
inner join sys.\"table_types\" tt on t.\"type\" = tt.\"table_type_id\" left 
outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" left outer join (select 
distinct \"schema\", \"table\", \"count\" from sys.\"statistics\"()) st on 
(s.\"name\" = st.\"schema\" and t.\"name\" = st.\"table\") order by s.\"name\", 
t.\"name\";",      "VIEW", true,   "COMMIT",       "WRITABLE",     NULL    ]
-[ "sys._tables",       "information_schema",   "views",        "create view 
information_schema.views as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, t.\"query\" as 
view_definition, cast('NONE' as varchar(10)) as check_option, cast('NO' as 
varchar(3)) as is_updatable, cast('NO' as varchar(3)) as insertable_into, 
cast('NO' as varchar(3)) as is_trigger_updatable, cast('NO' as varchar(3)) as 
is_trigger_deletable, cast('NO' as varchar(3)) as is_trigger_insertable_into, 
t.\"schema_id\" as schema_id, t.\"id\" as table_id, 
cast(sys.ifthenelse(t.\"system\", t.\"type\" + 10 , t.\"type\") as smallint) as 
table_type_id, t.\"system\" as is_system, cm.\"remark\" as comments from 
sys.\"_tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = s.\"id\" 
left outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" where t.\"type\" = 
1 order by s.\"name\", t.\"name\";",  "VIEW", true,   "COMMIT",       
"WRITABLE",     NULL    ]
+[ "sys._tables",       "information_schema",   "tables",       "create view 
information_schema.tables as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, tt.\"table_type_name\" as 
table_type, cast(null as varchar(1)) as self_referencing_column_name, cast(null 
as varchar(1)) as reference_generation, cast(null as varchar(1)) as 
user_defined_type_catalog, cast(null as varchar(1)) as 
user_defined_type_schema, cast(null as varchar(1)) as user_defined_type_name, 
cast(sys.ifthenelse((t.\"type\" in (0, 3, 7, 20, 30) and t.\"access\" in (0, 
2)), 'YES', 'NO') as varchar(3)) as is_insertable_into, cast('NO' as 
varchar(3)) as is_typed, cast((case t.\"commit_action\" when 1 then 'DELETE' 
when 2 then 'PRESERVE' when 3 then 'DROP' else null end) as varchar(10)) as 
commit_action, t.\"schema_id\" as schema_id, t.\"id\" as table_id, t.\"type\" 
as table_type_id, st.\"count\" as row_count, t.\"system\" as is_system, 
sys.ifthenelse(t.\"type\" in (1, 11, 21, 31), 
 true, false) as is_view, t.\"query\" as query_def, cm.\"remark\" as comments 
from sys.\"tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = 
s.\"id\" inner join sys.\"table_types\" tt on t.\"type\" = tt.\"table_type_id\" 
left outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" left outer join 
(select distinct \"schema\", \"table\", \"count\" from sys.\"statistics\"()) st 
on (s.\"name\" = st.\"schema\" and t.\"name\" = st.\"table\") order by 
s.\"name\", t.\"name\";",      "VIEW", true,   "COMMIT",       "WRITABLE",     
NULL    ]
+[ "sys._tables",       "information_schema",   "views",        "create view 
information_schema.views as select cast(null as varchar(1)) as table_catalog, 
s.\"name\" as table_schema, t.\"name\" as table_name, t.\"query\" as 
view_definition, cast('NONE' as varchar(10)) as check_option, cast('NO' as 
varchar(3)) as is_updatable, cast('NO' as varchar(3)) as insertable_into, 
cast('NO' as varchar(3)) as is_trigger_updatable, cast('NO' as varchar(3)) as 
is_trigger_deletable, cast('NO' as varchar(3)) as is_trigger_insertable_into, 
t.\"schema_id\" as schema_id, t.\"id\" as table_id, t.\"type\" as 
table_type_id, t.\"system\" as is_system, cm.\"remark\" as comments from 
sys.\"tables\" t inner join sys.\"schemas\" s on t.\"schema_id\" = s.\"id\" 
left outer join sys.\"comments\" cm on t.\"id\" = cm.\"id\" where t.\"type\" in 
(1, 11, 21, 31) order by s.\"name\", t.\"name\";",      "VIEW", true,   
"COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "logging",      "compinfo",     "create view 
logging.compinfo as select * from logging.compinfo();",    "VIEW", true,   
"COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "sys",  "_columns",     NULL,   "TABLE",        true,   
"COMMIT",       "WRITABLE",     NULL    ]
 [ "sys._tables",       "sys",  "_tables",      NULL,   "TABLE",        true,   
"COMMIT",       "WRITABLE",     NULL    ]
@@ -3337,9 +3337,9 @@ select 'null in fkeys.delete_action', de
 [ "table used by view",        "sys",  "schemas",      "information_schema",   
"tables",       "VIEW"  ]
 [ "table used by view",        "sys",  "table_types",  "information_schema",   
"tables",       "VIEW"  ]
 [ "table used by view",        "sys",  "tables",       "information_schema",   
"tables",       "VIEW"  ]
-[ "table used by view",        "sys",  "_tables",      "information_schema",   
"views",        "VIEW"  ]
 [ "table used by view",        "sys",  "comments",     "information_schema",   
"views",        "VIEW"  ]
 [ "table used by view",        "sys",  "schemas",      "information_schema",   
"views",        "VIEW"  ]
+[ "table used by view",        "sys",  "tables",       "information_schema",   
"views",        "VIEW"  ]
 [ "table used by view",        "sys",  "_columns",     "sys",  "columns",      
"VIEW"  ]
 [ "table used by view",        "tmp",  "_columns",     "sys",  "columns",      
"VIEW"  ]
 [ "table used by view",        "sys",  "dependencies", "sys",  
"dependencies_vw",      "VIEW"  ]
@@ -3719,16 +3719,16 @@ select 'null in fkeys.delete_action', de
 [ "column used by view",       "sys",  "tables",       "schema_id",    
"information_schema",   "tables",       "VIEW"  ]
 [ "column used by view",       "sys",  "tables",       "system",       
"information_schema",   "tables",       "VIEW"  ]
 [ "column used by view",       "sys",  "tables",       "type", 
"information_schema",   "tables",       "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "id",   
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "name", 
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "query",        
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "schema_id",    
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "system",       
"information_schema",   "views",        "VIEW"  ]
-[ "column used by view",       "sys",  "_tables",      "type", 
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "comments",     "id",   
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "comments",     "remark",       
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "schemas",      "id",   
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "schemas",      "name", 
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "id",   
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "name", 
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "query",        
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "schema_id",    
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "system",       
"information_schema",   "views",        "VIEW"  ]
+[ "column used by view",       "sys",  "tables",       "type", 
"information_schema",   "views",        "VIEW"  ]
 [ "column used by view",       "sys",  "_columns",     "default",      "sys",  
"columns",      "VIEW"  ]
 [ "column used by view",       "sys",  "_columns",     "id",   "sys",  
"columns",      "VIEW"  ]
 [ "column used by view",       "sys",  "_columns",     "name", "sys",  
"columns",      "VIEW"  ]
@@ -5614,6 +5614,7 @@ select 'null in fkeys.delete_action', de
 [ "sys.table_types",   11,     "SYSTEM VIEW"   ]
 [ "sys.table_types",   20,     "GLOBAL TEMPORARY TABLE"        ]
 [ "sys.table_types",   30,     "LOCAL TEMPORARY TABLE" ]
+[ "sys.table_types",   31,     "LOCAL TEMPORARY VIEW"  ]
 % .%1, .function_types,        .function_types # table_name
 % %1,  function_type_name,     function_type_keyword # name
 % varchar,     varchar,        varchar # type
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to