Changeset: 06eb4c2e36a0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=06eb4c2e36a0
Modified Files:
        clients/Tests/SQL-dump.stable.out
        clients/Tests/SQL-dump.stable.out.int128
        sql/jdbc/tests/Tests/Test_Dobjects.stable.out
        sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.sql
        sql/test/BugTracker-2011/Tests/count-count-distinct.Bug-2808.sql
        
sql/test/BugTracker-2012/Tests/aggregate_vs_positional_column_crash.Bug-3085.sql
        sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.sql
        sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out
        sql/test/BugTracker-2013/Tests/qualified_aggrname.Bug-3332.sql
        sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql
        sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out
        sql/test/BugTracker-2014/Tests/select-having.Bug-3458.sql
        sql/test/BugTracker-2015/Tests/cardinality.Bug-3761.sql
        
sql/test/BugTracker-2016/Tests/DISTINCT_with_correlated_scalar_subquery_crashes_mserver.Bug-3920.sql
        sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.sql
        sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.stable.out
        sql/test/bugs/Tests/crash_order_by.sql
        sql/test/bugs/Tests/simple_view.sql
        sql/test/bugs/insert_delete-bug-sf-904025.sql
        sql/test/orderidx/Tests/simpletable.sql
        sql/test/orderidx/Tests/smalltable.sql
        sql/test/pg_regress/Tests/vacuum.sql
        sql/test/pg_regress/Tests/without_oid.sql
Branch: default
Log Message:

Approve output result from IMPRINTS as keyword


diffs (truncated from 433 to 300 lines):

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
@@ -846,7 +846,7 @@ create view sys.sessions as select * fro
 create view sys."storage" as select * from sys."storage"();
 create view sys.storagemodel as select * from sys.storagemodel();
 SELECT "id", "name", "schema_id", "query", CAST(CASE WHEN "system" THEN "type" 
+ 10 ELSE (CASE WHEN "commit_action" = 0 THEN "type" ELSE "type" + 20 END) END 
AS SMALLINT) AS "type", "system", "commit_action", "access", CASE WHEN (NOT 
"system" AND "commit_action" > 0) THEN 1 ELSE 0 END AS "temporary" FROM 
"sys"."_tables" WHERE "type" <> 2 UNION ALL SELECT "id", "name", "schema_id", 
"query", CAST("type" + 30 AS SMALLINT) AS "type", "system", "commit_action", 
"access", 1 AS "temporary" FROM "tmp"."_tables";
-create view sys.tablestoragemodel as select "schema","table",max(count) as 
"count", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) 
as hashes, sum(imprints) as imprints, sum(case when sorted = false then 8 * 
count else 0 end) as auxiliary from sys.storagemodel() group by 
"schema","table";
+create view sys.tablestoragemodel as select "schema","table",max(count) as 
"count", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) 
as hashes, sum("imprints") as "imprints", sum(case when sorted = false then 8 * 
count else 0 end) as auxiliary from sys.storagemodel() group by 
"schema","table";
 create view sys.tracelog as select * from sys.tracelog();
 SELECT u."name" AS "name", ui."fullname", ui."default_schema" FROM db_users() 
AS u LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name" ;
 create function "abbrev" (p inet) returns clob external name inet."abbrev";
@@ -1160,11 +1160,11 @@ create aggregate stddev_samp(val time) r
 create aggregate stddev_samp(val timestamp) returns double external name 
"aggr"."stdev";
 create procedure sys.stop(tag int) external name sql.sysmon_stop;
 create procedure sys.stop(tag bigint) external name sql.sysmon_stop;
-create function sys."storage"() returns table ("schema" string, "table" 
string, "column" string, "type" string, "mode" string, location string, "count" 
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, imprints bigint, sorted boolean, orderidx bigint) external name 
sql."storage";
-create function sys."storage"(sname string) returns table ("schema" string, 
"table" string, "column" string, "type" string, "mode" string, location string, 
"count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes 
bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) 
external name sql."storage";
-create function sys."storage"(sname string, tname string) returns table 
("schema" string, "table" string, "column" string, "type" string, "mode" 
string, location string, "count" bigint, typewidth int, columnsize bigint, 
heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, 
orderidx bigint) external name sql."storage";
-create function sys."storage"(sname string, tname string, cname string) 
returns table ("schema" string, "table" string, "column" string, "type" string, 
"mode" string, location string, "count" bigint, typewidth int, columnsize 
bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted 
boolean, orderidx bigint) external name sql."storage";
-create function sys.storagemodel() returns table ("schema" string, "table" 
string, "column" string, "type" string, "count" bigint, columnsize bigint, 
heapsize bigint, hashes bigint, imprints bigint, sorted boolean, orderidx 
bigint) begin return select i."schema", i."table", i."column", i."type", 
i."count", columnsize(i."type", i.count, i."distinct"), heapsize(i."type", 
i."distinct", i."atomwidth"), hashsize(i."reference", i."count"), 
imprintsize(i."count",i."type"), i.sorted, i.orderidx from 
sys.storagemodelinput i; end;
+create function sys."storage"() returns table ("schema" string, "table" 
string, "column" string, "type" string, "mode" string, location string, "count" 
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name 
sql."storage";
+create function sys."storage"(sname string) returns table ("schema" string, 
"table" string, "column" string, "type" string, "mode" string, location string, 
"count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes 
bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) 
external name sql."storage";
+create function sys."storage"(sname string, tname string) returns table 
("schema" string, "table" string, "column" string, "type" string, "mode" 
string, location string, "count" bigint, typewidth int, columnsize bigint, 
heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted 
boolean, orderidx bigint) external name sql."storage";
+create function sys."storage"(sname string, tname string, cname string) 
returns table ("schema" string, "table" string, "column" string, "type" string, 
"mode" string, location string, "count" bigint, typewidth int, columnsize 
bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, 
sorted boolean, orderidx bigint) external name sql."storage";
+create function sys.storagemodel() returns table ("schema" string, "table" 
string, "column" string, "type" string, "count" bigint, columnsize bigint, 
heapsize bigint, hashes bigint, "imprints" bigint, sorted boolean, orderidx 
bigint) begin return select i."schema", i."table", i."column", i."type", 
i."count", columnsize(i."type", i.count, i."distinct"), heapsize(i."type", 
i."distinct", i."atomwidth"), hashsize(i."reference", i."count"), 
imprintsize(i."count",i."type"), i.sorted, i.orderidx from 
sys.storagemodelinput i; end;
 create procedure sys.storagemodelinit() begin delete from 
sys.storagemodelinput; insert into sys.storagemodelinput select x."schema", 
x."table", x."column", x."type", x.typewidth, x.count, 0, x.typewidth, false, 
x.sorted, x.orderidx from sys."storage"() x; update sys.storagemodelinput set 
reference = true where concat(concat("schema","table"), "column") in (select 
concat(concat("fkschema"."name", "fktable"."name"), "fkkeycol"."name") from 
"sys"."keys" as "fkkey", "sys"."objects" as "fkkeycol", "sys"."tables" as 
"fktable", "sys"."schemas" as "fkschema" where "fktable"."id" = 
"fkkey"."table_id" and "fkkey"."id" = "fkkeycol"."id" and "fkschema"."id" = 
"fktable"."schema_id" and "fkkey"."rkey" > -1); update sys.storagemodelinput 
set "distinct" = "count" where "type" = 'varchar' or "type"='clob'; end;
 create function str_to_date(s string, format string) returns date external 
name mtime."str_to_date";
 create function str_to_time(s string, format string) returns time external 
name mtime."str_to_time";
@@ -1349,7 +1349,7 @@ drop function pcre_replace(string, strin
 [ "sys",       "systemfunctions",      NULL,   0,      true,   0,      0       
]
 [ "sys",       "table_types",  NULL,   0,      true,   0,      0       ]
 [ "sys",       "tables",       "SELECT \"id\", \"name\", \"schema_id\", 
\"query\", CAST(CASE WHEN \"system\" THEN \"type\" + 10 /* system table/view */ 
ELSE (CASE WHEN \"commit_action\" = 0 THEN \"type\" /* table/view */ ELSE 
\"type\" + 20 /* global temp table */ END) END AS SMALLINT) AS \"type\", 
\"system\", \"commit_action\", \"access\", CASE WHEN (NOT \"system\" AND 
\"commit_action\" > 0) THEN 1 ELSE 0 END AS \"temporary\" FROM 
\"sys\".\"_tables\" WHERE \"type\" <> 2 UNION ALL SELECT \"id\", \"name\", 
\"schema_id\", \"query\", CAST(\"type\" + 30 /* local temp table */ AS 
SMALLINT) AS \"type\", \"system\", \"commit_action\", \"access\", 1 AS 
\"temporary\" FROM \"tmp\".\"_tables\";",  1,      true,   0,      0       ]
-[ "sys",       "tablestoragemodel",    "create view sys.tablestoragemodel as 
select \"schema\",\"table\",max(count) as \"count\", sum(columnsize) as 
columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(imprints) as 
imprints, sum(case when sorted = false then 8 * count else 0 end) as auxiliary 
from sys.storagemodel() group by \"schema\",\"table\";",    1,      true,   0,  
    0       ]
+[ "sys",       "tablestoragemodel",    "create view sys.tablestoragemodel as 
select \"schema\",\"table\",max(count) as \"count\", sum(columnsize) as 
columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(\"imprints\") 
as \"imprints\", sum(case when sorted = false then 8 * count else 0 end) as 
auxiliary from sys.storagemodel() group by \"schema\",\"table\";",    1,      
true,   0,      0       ]
 [ "sys",       "tracelog",     "create view sys.tracelog as select * from 
sys.tracelog();",    1,      true,   0,      0       ]
 [ "sys",       "triggers",     NULL,   0,      true,   0,      0       ]
 [ "sys",       "types",        NULL,   0,      true,   0,      0       ]
@@ -3289,11 +3289,11 @@ drop function pcre_replace(string, strin
 [ "sys",       "stddev_samp",  "create aggregate stddev_samp(val wrd) returns 
double external name \"aggr\".\"stdev\";",       "aggr", 1,      3,      false, 
 false,  false   ]
 [ "sys",       "stop", "create procedure sys.stop(tag bigint) external name 
sql.sysmon_stop;", "sql",  1,      2,      true,   false,  false   ]
 [ "sys",       "stop", "create procedure sys.stop(tag int) external name 
sql.sysmon_stop;",    "sql",  1,      2,      true,   false,  false   ]
-[ "sys",       "storage",      "create function sys.\"storage\"() returns 
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, 
\"mode\" string, location string, \"count\" bigint, typewidth int, columnsize 
bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted 
boolean, orderidx bigint) external name sql.\"storage\";",      "sql",  1,      
5,      false,  false,  false   ]
-[ "sys",       "storage",      "create function sys.\"storage\"(sname string) 
returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" 
string, \"mode\" string, location string, \"count\" bigint, typewidth int, 
columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints 
bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";",  
"sql",  1,      5,      false,  false,  false   ]
-[ "sys",       "storage",      "create function sys.\"storage\"(sname string, 
tname string) returns table (\"schema\" string, \"table\" string, \"column\" 
string, \"type\" string, \"mode\" string, location string, \"count\" bigint, 
typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, imprints bigint, sorted boolean, orderidx bigint) external name 
sql.\"storage\";",    "sql",  1,      5,      false,  false,  false   ]
-[ "sys",       "storage",      "create function sys.\"storage\"(sname string, 
tname string, cname string) returns table (\"schema\" string, \"table\" string, 
\"column\" string, \"type\" string, \"mode\" string, location string, \"count\" 
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, imprints bigint, sorted boolean, orderidx bigint) external name 
sql.\"storage\";",      "sql",  1,      5,      false,  false,  false   ]
-[ "sys",       "storagemodel", "create function sys.storagemodel() returns 
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, 
\"count\" bigint, columnsize bigint, heapsize bigint, hashes bigint, imprints 
bigint, sorted boolean, orderidx bigint) begin return select i.\"schema\", 
i.\"table\", i.\"column\", i.\"type\", i.\"count\", columnsize(i.\"type\", 
i.count, i.\"distinct\"), heapsize(i.\"type\", i.\"distinct\", 
i.\"atomwidth\"), hashsize(i.\"reference\", i.\"count\"), 
imprintsize(i.\"count\",i.\"type\"), i.sorted, i.orderidx from 
sys.storagemodelinput i; end;", "user", 2,      5,      false,  false,  false   
]
+[ "sys",       "storage",      "create function sys.\"storage\"() returns 
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, 
\"mode\" string, location string, \"count\" bigint, typewidth int, columnsize 
bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, 
sorted boolean, orderidx bigint) external name sql.\"storage\";",  "sql",  1,   
   5,      false,  false,  false   ]
+[ "sys",       "storage",      "create function sys.\"storage\"(sname string) 
returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" 
string, \"mode\" string, location string, \"count\" bigint, typewidth int, 
columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" 
bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";",      
"sql",  1,      5,      false,  false,  false   ]
+[ "sys",       "storage",      "create function sys.\"storage\"(sname string, 
tname string) returns table (\"schema\" string, \"table\" string, \"column\" 
string, \"type\" string, \"mode\" string, location string, \"count\" bigint, 
typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name 
sql.\"storage\";",        "sql",  1,      5,      false,  false,  false   ]
+[ "sys",       "storage",      "create function sys.\"storage\"(sname string, 
tname string, cname string) returns table (\"schema\" string, \"table\" string, 
\"column\" string, \"type\" string, \"mode\" string, location string, \"count\" 
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name 
sql.\"storage\";",  "sql",  1,      5,      false,  false,  false   ]
+[ "sys",       "storagemodel", "create function sys.storagemodel() returns 
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, 
\"count\" bigint, columnsize bigint, heapsize bigint, hashes bigint, 
\"imprints\" bigint, sorted boolean, orderidx bigint) begin return select 
i.\"schema\", i.\"table\", i.\"column\", i.\"type\", i.\"count\", 
columnsize(i.\"type\", i.count, i.\"distinct\"), heapsize(i.\"type\", 
i.\"distinct\", i.\"atomwidth\"), hashsize(i.\"reference\", i.\"count\"), 
imprintsize(i.\"count\",i.\"type\"), i.sorted, i.orderidx from 
sys.storagemodelinput i; end;",     "user", 2,      5,      false,  false,  
false   ]
 [ "sys",       "storagemodelinit",     "create procedure 
sys.storagemodelinit() begin delete from sys.storagemodelinput; insert into 
sys.storagemodelinput select x.\"schema\", x.\"table\", x.\"column\", 
x.\"type\", x.typewidth, x.count, 0, x.typewidth, false, x.sorted, x.orderidx 
from sys.\"storage\"() x; update sys.storagemodelinput set reference = true 
where concat(concat(\"schema\",\"table\"), \"column\") in (select 
concat(concat(\"fkschema\".\"name\", \"fktable\".\"name\"), 
\"fkkeycol\".\"name\") from \"sys\".\"keys\" as \"fkkey\", \"sys\".\"objects\" 
as \"fkkeycol\", \"sys\".\"tables\" as \"fktable\", \"sys\".\"schemas\" as 
\"fkschema\" where \"fktable\".\"id\" = \"fkkey\".\"table_id\" and 
\"fkkey\".\"id\" = \"fkkeycol\".\"id\" and \"fkschema\".\"id\" = 
\"fktable\".\"schema_id\" and \"fkkey\".\"rkey\" > -1); update 
sys.storagemodelinput set \"distinct\" = \"count\" where \"type\" = 'varchar' 
or \"type\"='clob'; end;",       "user", 2,      2,      true,   false,  false  
 ]
 [ "sys",       "str_to_date",  "create function str_to_date(s string, format 
string) returns date external name mtime.\"str_to_date\";",       "mtime",      
  1,      1,      false,  false,  false   ]
 [ "sys",       "str_to_time",  "create function str_to_time(s string, format 
string) returns time external name mtime.\"str_to_time\";",       "mtime",      
  1,      1,      false,  false,  false   ]
diff --git a/clients/Tests/SQL-dump.stable.out.int128 
b/clients/Tests/SQL-dump.stable.out.int128
--- a/clients/Tests/SQL-dump.stable.out.int128
+++ b/clients/Tests/SQL-dump.stable.out.int128
@@ -842,7 +842,7 @@ create view sys.sessions as select * fro
 create view sys."storage" as select * from sys."storage"();
 create view sys.storagemodel as select * from sys.storagemodel();
 SELECT "id", "name", "schema_id", "query", CAST(CASE WHEN "system" THEN "type" 
+ 10 ELSE (CASE WHEN "commit_action" = 0 THEN "type" ELSE "type" + 20 END) END 
AS SMALLINT) AS "type", "system", "commit_action", "access", CASE WHEN (NOT 
"system" AND "commit_action" > 0) THEN 1 ELSE 0 END AS "temporary" FROM 
"sys"."_tables" WHERE "type" <> 2 UNION ALL SELECT "id", "name", "schema_id", 
"query", CAST("type" + 30 AS SMALLINT) AS "type", "system", "commit_action", 
"access", 1 AS "temporary" FROM "tmp"."_tables";
-create view sys.tablestoragemodel as select "schema","table",max(count) as 
"count", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) 
as hashes, sum(imprints) as imprints, sum(case when sorted = false then 8 * 
count else 0 end) as auxiliary from sys.storagemodel() group by 
"schema","table";
+create view sys.tablestoragemodel as select "schema","table",max(count) as 
"count", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) 
as hashes, sum("imprints") as "imprints", sum(case when sorted = false then 8 * 
count else 0 end) as auxiliary from sys.storagemodel() group by 
"schema","table";
 create view sys.tracelog as select * from sys.tracelog();
 SELECT u."name" AS "name", ui."fullname", ui."default_schema" FROM db_users() 
AS u LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name" ;
 create function "abbrev" (p inet) returns clob external name inet."abbrev";
@@ -1165,11 +1165,11 @@ create aggregate stddev_samp(val timesta
 create aggregate stddev_samp(val hugeint) returns double external name 
"aggr"."stdev";
 create procedure sys.stop(tag int) external name sql.sysmon_stop;
 create procedure sys.stop(tag bigint) external name sql.sysmon_stop;
-create function sys."storage"() returns table ("schema" string, "table" 
string, "column" string, "type" string, "mode" string, location string, "count" 
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, imprints bigint, sorted boolean, orderidx bigint) external name 
sql."storage";
-create function sys."storage"(sname string) returns table ("schema" string, 
"table" string, "column" string, "type" string, "mode" string, location string, 
"count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes 
bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) 
external name sql."storage";
-create function sys."storage"(sname string, tname string) returns table 
("schema" string, "table" string, "column" string, "type" string, "mode" 
string, location string, "count" bigint, typewidth int, columnsize bigint, 
heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, 
orderidx bigint) external name sql."storage";
-create function sys."storage"(sname string, tname string, cname string) 
returns table ("schema" string, "table" string, "column" string, "type" string, 
"mode" string, location string, "count" bigint, typewidth int, columnsize 
bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted 
boolean, orderidx bigint) external name sql."storage";
-create function sys.storagemodel() returns table ("schema" string, "table" 
string, "column" string, "type" string, "count" bigint, columnsize bigint, 
heapsize bigint, hashes bigint, imprints bigint, sorted boolean, orderidx 
bigint) begin return select i."schema", i."table", i."column", i."type", 
i."count", columnsize(i."type", i.count, i."distinct"), heapsize(i."type", 
i."distinct", i."atomwidth"), hashsize(i."reference", i."count"), 
imprintsize(i."count",i."type"), i.sorted, i.orderidx from 
sys.storagemodelinput i; end;
+create function sys."storage"() returns table ("schema" string, "table" 
string, "column" string, "type" string, "mode" string, location string, "count" 
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name 
sql."storage";
+create function sys."storage"(sname string) returns table ("schema" string, 
"table" string, "column" string, "type" string, "mode" string, location string, 
"count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes 
bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) 
external name sql."storage";
+create function sys."storage"(sname string, tname string) returns table 
("schema" string, "table" string, "column" string, "type" string, "mode" 
string, location string, "count" bigint, typewidth int, columnsize bigint, 
heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted 
boolean, orderidx bigint) external name sql."storage";
+create function sys."storage"(sname string, tname string, cname string) 
returns table ("schema" string, "table" string, "column" string, "type" string, 
"mode" string, location string, "count" bigint, typewidth int, columnsize 
bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, 
sorted boolean, orderidx bigint) external name sql."storage";
+create function sys.storagemodel() returns table ("schema" string, "table" 
string, "column" string, "type" string, "count" bigint, columnsize bigint, 
heapsize bigint, hashes bigint, "imprints" bigint, sorted boolean, orderidx 
bigint) begin return select i."schema", i."table", i."column", i."type", 
i."count", columnsize(i."type", i.count, i."distinct"), heapsize(i."type", 
i."distinct", i."atomwidth"), hashsize(i."reference", i."count"), 
imprintsize(i."count",i."type"), i.sorted, i.orderidx from 
sys.storagemodelinput i; end;
 create procedure sys.storagemodelinit() begin delete from 
sys.storagemodelinput; insert into sys.storagemodelinput select x."schema", 
x."table", x."column", x."type", x.typewidth, x.count, 0, x.typewidth, false, 
x.sorted, x.orderidx from sys."storage"() x; update sys.storagemodelinput set 
reference = true where concat(concat("schema","table"), "column") in (select 
concat(concat("fkschema"."name", "fktable"."name"), "fkkeycol"."name") from 
"sys"."keys" as "fkkey", "sys"."objects" as "fkkeycol", "sys"."tables" as 
"fktable", "sys"."schemas" as "fkschema" where "fktable"."id" = 
"fkkey"."table_id" and "fkkey"."id" = "fkkeycol"."id" and "fkschema"."id" = 
"fktable"."schema_id" and "fkkey"."rkey" > -1); update sys.storagemodelinput 
set "distinct" = "count" where "type" = 'varchar' or "type"='clob'; end;
 create function str_to_date(s string, format string) returns date external 
name mtime."str_to_date";
 create function str_to_time(s string, format string) returns time external 
name mtime."str_to_time";
@@ -1356,7 +1356,7 @@ drop function pcre_replace(string, strin
 [ "sys",       "systemfunctions",      NULL,   0,      true,   0,      0       
]
 [ "sys",       "table_types",  NULL,   0,      true,   0,      0       ]
 [ "sys",       "tables",       "SELECT \"id\", \"name\", \"schema_id\", 
\"query\", CAST(CASE WHEN \"system\" THEN \"type\" + 10 /* system table/view */ 
ELSE (CASE WHEN \"commit_action\" = 0 THEN \"type\" /* table/view */ ELSE 
\"type\" + 20 /* global temp table */ END) END AS SMALLINT) AS \"type\", 
\"system\", \"commit_action\", \"access\", CASE WHEN (NOT \"system\" AND 
\"commit_action\" > 0) THEN 1 ELSE 0 END AS \"temporary\" FROM 
\"sys\".\"_tables\" WHERE \"type\" <> 2 UNION ALL SELECT \"id\", \"name\", 
\"schema_id\", \"query\", CAST(\"type\" + 30 /* local temp table */ AS 
SMALLINT) AS \"type\", \"system\", \"commit_action\", \"access\", 1 AS 
\"temporary\" FROM \"tmp\".\"_tables\";",  1,      true,   0,      0       ]
-[ "sys",       "tablestoragemodel",    "create view sys.tablestoragemodel as 
select \"schema\",\"table\",max(count) as \"count\", sum(columnsize) as 
columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(imprints) as 
imprints, sum(case when sorted = false then 8 * count else 0 end) as auxiliary 
from sys.storagemodel() group by \"schema\",\"table\";",    1,      true,   0,  
    0       ]
+[ "sys",       "tablestoragemodel",    "create view sys.tablestoragemodel as 
select \"schema\",\"table\",max(count) as \"count\", sum(columnsize) as 
columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(\"imprints\") 
as \"imprints\", sum(case when sorted = false then 8 * count else 0 end) as 
auxiliary from sys.storagemodel() group by \"schema\",\"table\";",    1,      
true,   0,      0       ]
 [ "sys",       "tracelog",     "create view sys.tracelog as select * from 
sys.tracelog();",    1,      true,   0,      0       ]
 [ "sys",       "triggers",     NULL,   0,      true,   0,      0       ]
 [ "sys",       "types",        NULL,   0,      true,   0,      0       ]
@@ -3480,11 +3480,11 @@ drop function pcre_replace(string, strin
 [ "sys",       "stddev_samp",  "create aggregate stddev_samp(val wrd) returns 
double external name \"aggr\".\"stdev\";",       "aggr", 1,      3,      false, 
 false,  false   ]
 [ "sys",       "stop", "create procedure sys.stop(tag bigint) external name 
sql.sysmon_stop;", "sql",  1,      2,      true,   false,  false   ]
 [ "sys",       "stop", "create procedure sys.stop(tag int) external name 
sql.sysmon_stop;",    "sql",  1,      2,      true,   false,  false   ]
-[ "sys",       "storage",      "create function sys.\"storage\"() returns 
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, 
\"mode\" string, location string, \"count\" bigint, typewidth int, columnsize 
bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted 
boolean, orderidx bigint) external name sql.\"storage\";",      "sql",  1,      
5,      false,  false,  false   ]
-[ "sys",       "storage",      "create function sys.\"storage\"(sname string) 
returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" 
string, \"mode\" string, location string, \"count\" bigint, typewidth int, 
columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints 
bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";",  
"sql",  1,      5,      false,  false,  false   ]
-[ "sys",       "storage",      "create function sys.\"storage\"(sname string, 
tname string) returns table (\"schema\" string, \"table\" string, \"column\" 
string, \"type\" string, \"mode\" string, location string, \"count\" bigint, 
typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, imprints bigint, sorted boolean, orderidx bigint) external name 
sql.\"storage\";",    "sql",  1,      5,      false,  false,  false   ]
-[ "sys",       "storage",      "create function sys.\"storage\"(sname string, 
tname string, cname string) returns table (\"schema\" string, \"table\" string, 
\"column\" string, \"type\" string, \"mode\" string, location string, \"count\" 
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, imprints bigint, sorted boolean, orderidx bigint) external name 
sql.\"storage\";",      "sql",  1,      5,      false,  false,  false   ]
-[ "sys",       "storagemodel", "create function sys.storagemodel() returns 
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, 
\"count\" bigint, columnsize bigint, heapsize bigint, hashes bigint, imprints 
bigint, sorted boolean, orderidx bigint) begin return select i.\"schema\", 
i.\"table\", i.\"column\", i.\"type\", i.\"count\", columnsize(i.\"type\", 
i.count, i.\"distinct\"), heapsize(i.\"type\", i.\"distinct\", 
i.\"atomwidth\"), hashsize(i.\"reference\", i.\"count\"), 
imprintsize(i.\"count\",i.\"type\"), i.sorted, i.orderidx from 
sys.storagemodelinput i; end;", "user", 2,      5,      false,  false,  false   
]
+[ "sys",       "storage",      "create function sys.\"storage\"() returns 
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, 
\"mode\" string, location string, \"count\" bigint, typewidth int, columnsize 
bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, 
sorted boolean, orderidx bigint) external name sql.\"storage\";",  "sql",  1,   
   5,      false,  false,  false   ]
+[ "sys",       "storage",      "create function sys.\"storage\"(sname string) 
returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" 
string, \"mode\" string, location string, \"count\" bigint, typewidth int, 
columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" 
bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";",      
"sql",  1,      5,      false,  false,  false   ]
+[ "sys",       "storage",      "create function sys.\"storage\"(sname string, 
tname string) returns table (\"schema\" string, \"table\" string, \"column\" 
string, \"type\" string, \"mode\" string, location string, \"count\" bigint, 
typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name 
sql.\"storage\";",        "sql",  1,      5,      false,  false,  false   ]
+[ "sys",       "storage",      "create function sys.\"storage\"(sname string, 
tname string, cname string) returns table (\"schema\" string, \"table\" string, 
\"column\" string, \"type\" string, \"mode\" string, location string, \"count\" 
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash 
boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name 
sql.\"storage\";",  "sql",  1,      5,      false,  false,  false   ]
+[ "sys",       "storagemodel", "create function sys.storagemodel() returns 
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, 
\"count\" bigint, columnsize bigint, heapsize bigint, hashes bigint, 
\"imprints\" bigint, sorted boolean, orderidx bigint) begin return select 
i.\"schema\", i.\"table\", i.\"column\", i.\"type\", i.\"count\", 
columnsize(i.\"type\", i.count, i.\"distinct\"), heapsize(i.\"type\", 
i.\"distinct\", i.\"atomwidth\"), hashsize(i.\"reference\", i.\"count\"), 
imprintsize(i.\"count\",i.\"type\"), i.sorted, i.orderidx from 
sys.storagemodelinput i; end;",     "user", 2,      5,      false,  false,  
false   ]
 [ "sys",       "storagemodelinit",     "create procedure 
sys.storagemodelinit() begin delete from sys.storagemodelinput; insert into 
sys.storagemodelinput select x.\"schema\", x.\"table\", x.\"column\", 
x.\"type\", x.typewidth, x.count, 0, x.typewidth, false, x.sorted, x.orderidx 
from sys.\"storage\"() x; update sys.storagemodelinput set reference = true 
where concat(concat(\"schema\",\"table\"), \"column\") in (select 
concat(concat(\"fkschema\".\"name\", \"fktable\".\"name\"), 
\"fkkeycol\".\"name\") from \"sys\".\"keys\" as \"fkkey\", \"sys\".\"objects\" 
as \"fkkeycol\", \"sys\".\"tables\" as \"fktable\", \"sys\".\"schemas\" as 
\"fkschema\" where \"fktable\".\"id\" = \"fkkey\".\"table_id\" and 
\"fkkey\".\"id\" = \"fkkeycol\".\"id\" and \"fkschema\".\"id\" = 
\"fktable\".\"schema_id\" and \"fkkey\".\"rkey\" > -1); update 
sys.storagemodelinput set \"distinct\" = \"count\" where \"type\" = 'varchar' 
or \"type\"='clob'; end;",       "user", 2,      2,      true,   false,  false  
 ]
 [ "sys",       "str_to_date",  "create function str_to_date(s string, format 
string) returns date external name mtime.\"str_to_date\";",       "mtime",      
  1,      1,      false,  false,  false   ]
 [ "sys",       "str_to_time",  "create function str_to_time(s string, format 
string) returns time external name mtime.\"str_to_time\";",       "mtime",      
  1,      1,      false,  false,  false   ]
diff --git a/sql/jdbc/tests/Tests/Test_Dobjects.stable.out 
b/sql/jdbc/tests/Tests/Test_Dobjects.stable.out
--- a/sql/jdbc/tests/Tests/Test_Dobjects.stable.out
+++ b/sql/jdbc/tests/Tests/Test_Dobjects.stable.out
@@ -102,7 +102,7 @@ as select "schema","table",max(count) as
        sum(columnsize) as columnsize,
        sum(heapsize) as heapsize,
        sum(hashes) as hashes,
-       sum(imprints) as imprints,
+ sum("imprints") as "imprints",
        sum(case when sorted = false then 8 * count else 0 end) as auxiliary
 from sys.storagemodel() group by "schema","table";     null    null    null    
null    null    
 null   sys     tracelog        SYSTEM VIEW     create view sys.tracelog as 
select * from sys.tracelog();       null    null    null    null    null    
diff --git a/sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.sql 
b/sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.sql
--- a/sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.sql
+++ b/sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.sql
@@ -47,7 +47,7 @@ 5717  "queue" 2000    "create view sys.queue
 6368   "storage"       2000    "create view sys.storage as select * from 
sys.storage();"       1       true    0       false   0
 6380   "storagemodelinput"     2000    NULL    0       true    0       false   0
 6428   "storagemodel"  2000    "create view sys.storagemodel as select * from 
sys.storagemodel();"     1       true    0       false   0
-6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"   1       true    0       false   0
+6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum("imprints") as "imprints",\n\tsum(case when sorted = false then 
8 * count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"       1       true    0       false   0
 6453   "statistics"    2000    NULL    0       true    0       false   0
 6616   "systemfunctions"       2000    NULL    0       true    0       false   0
 
diff --git a/sql/test/BugTracker-2011/Tests/count-count-distinct.Bug-2808.sql 
b/sql/test/BugTracker-2011/Tests/count-count-distinct.Bug-2808.sql
--- a/sql/test/BugTracker-2011/Tests/count-count-distinct.Bug-2808.sql
+++ b/sql/test/BugTracker-2011/Tests/count-count-distinct.Bug-2808.sql
@@ -47,7 +47,7 @@ 5717  "queue" 2000    "create view sys.queue
 6368   "storage"       2000    "create view sys.storage as select * from 
sys.storage();"       1       true    0       false   0
 6380   "storagemodelinput"     2000    NULL    0       true    0       false   0
 6428   "storagemodel"  2000    "create view sys.storagemodel as select * from 
sys.storagemodel();"     1       true    0       false   0
-6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"   1       true    0       false   0
+6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum("imprints") as "imprints",\n\tsum(case when sorted = false then 
8 * count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"       1       true    0       false   0
 6453   "statistics"    2000    NULL    0       true    0       false   0
 6616   "systemfunctions"       2000    NULL    0       true    0       false   0
 
diff --git 
a/sql/test/BugTracker-2012/Tests/aggregate_vs_positional_column_crash.Bug-3085.sql
 
b/sql/test/BugTracker-2012/Tests/aggregate_vs_positional_column_crash.Bug-3085.sql
--- 
a/sql/test/BugTracker-2012/Tests/aggregate_vs_positional_column_crash.Bug-3085.sql
+++ 
b/sql/test/BugTracker-2012/Tests/aggregate_vs_positional_column_crash.Bug-3085.sql
@@ -47,7 +47,7 @@ 5717  "queue" 2000    "create view sys.queue
 6368   "storage"       2000    "create view sys.storage as select * from 
sys.storage();"       1       true    0       false   0
 6380   "storagemodelinput"     2000    NULL    0       true    0       false   0
 6428   "storagemodel"  2000    "create view sys.storagemodel as select * from 
sys.storagemodel();"     1       true    0       false   0
-6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"   1       true    0       false   0
+6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum("imprints") as "imprints",\n\tsum(case when sorted = false then 
8 * count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"       1       true    0       false   0
 6453   "statistics"    2000    NULL    0       true    0       false   0
 6616   "systemfunctions"       2000    NULL    0       true    0       false   0
 
diff --git a/sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.sql 
b/sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.sql
--- a/sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.sql
+++ b/sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.sql
@@ -47,7 +47,7 @@ 5717  "queue" 2000    "create view sys.queue
 6368   "storage"       2000    "create view sys.storage as select * from 
sys.storage();"       1       true    0       false   0
 6380   "storagemodelinput"     2000    NULL    0       true    0       false   0
 6428   "storagemodel"  2000    "create view sys.storagemodel as select * from 
sys.storagemodel();"     1       true    0       false   0
-6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"   1       true    0       false   0
+6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum("imprints") as "imprints",\n\tsum(case when sorted = false then 
8 * count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"       1       true    0       false   0
 6453   "statistics"    2000    NULL    0       true    0       false   0
 6616   "systemfunctions"       2000    NULL    0       true    0       false   0
 
diff --git 
a/sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out 
b/sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out
--- a/sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out
+++ b/sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out
@@ -51,7 +51,7 @@ Ready.
 % sys.tbls,    sys.tbls,       sys.tbls,       sys.tbls,       sys.tbls,       
sys.tbls,       sys.tbls,       sys.tbls # table_name
 % name,        schema_id,      query,  type,   system, commit_action,  
readonly,       temporary # name
 % varchar,     int,    varchar,        smallint,       boolean,        
smallint,       boolean,        smallint # type
-% 17,  4,      522,    1,      5,      1,      5,      1 # length
+% 17,  4,      379,    1,      5,      1,      5,      1 # length
 [ "schemas",   2000,   NULL,   0,      true,   0,      false,  0       ]
 [ "types",     2000,   NULL,   0,      true,   0,      false,  0       ]
 [ "functions", 2000,   NULL,   0,      true,   0,      false,  0       ]
@@ -89,7 +89,7 @@ Ready.
 [ "storage",   2000,   "create view sys.storage as select * from 
sys.storage();",      1,      true,   0,      false,  0       ]
 [ "storagemodelinput", 2000,   NULL,   0,      true,   0,      false,  0       
]
 [ "storagemodel",      2000,   "create view sys.storagemodel as select * from 
sys.storagemodel();",    1,      true,   0,      false,  0       ]
-[ "tablestoragemodel", 2000,   "-- A summary of the table storage requirement 
is is available as a table view.\n-- The auxiliary column denotes the maximum 
space if all non-sorted columns\n-- would be augmented with a hash (rare 
situation)\ncreate view sys.tablestoragemodel\nas select 
\"schema\",\"table\",max(count) as \"count\",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
\"schema\",\"table\";",  1,      true,   0,      false,  0       ]
+[ "tablestoragemodel", 2000,   "-- A summary of the table storage requirement 
is is available as a table view.\n-- The auxiliary column denotes the maximum 
space if all non-sorted columns\n-- would be augmented with a hash (rare 
situation)\ncreate view sys.tablestoragemodel\nas select 
\"schema\",\"table\",max(count) as \"count\",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as hashes,\n\tsum(",   
     1,      true,   0,      false,  0       ]
 [ "statistics",        2000,   NULL,   0,      true,   0,      false,  0       
]
 [ "systemfunctions",   2000,   NULL,   0,      true,   0,      false,  0       
]
 
diff --git a/sql/test/BugTracker-2013/Tests/qualified_aggrname.Bug-3332.sql 
b/sql/test/BugTracker-2013/Tests/qualified_aggrname.Bug-3332.sql
--- a/sql/test/BugTracker-2013/Tests/qualified_aggrname.Bug-3332.sql
+++ b/sql/test/BugTracker-2013/Tests/qualified_aggrname.Bug-3332.sql
@@ -47,7 +47,7 @@ 5717  "queue" 2000    "create view sys.queue
 6368   "storage"       2000    "create view sys.storage as select * from 
sys.storage();"       1       true    0       false   0
 6380   "storagemodelinput"     2000    NULL    0       true    0       false   0
 6428   "storagemodel"  2000    "create view sys.storagemodel as select * from 
sys.storagemodel();"     1       true    0       false   0
-6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"   1       true    0       false   0
+6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum("imprints") as "imprints",\n\tsum(case when sorted = false then 
8 * count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"       1       true    0       false   0
 6453   "statistics"    2000    NULL    0       true    0       false   0
 6616   "systemfunctions"       2000    NULL    0       true    0       false   0
 
diff --git a/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql 
b/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql
--- a/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql
+++ b/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql
@@ -55,7 +55,7 @@ 6995  netcdf_attrs    2000            0       true    0       0
 7034   storage 2000    "create view sys.""storage"" as select * from 
sys.""storage""();"       1       true    0       0
 7046   storagemodelinput       2000            0       true    0       0
 7094   storagemodel    2000    "create view sys.storagemodel as select * from 
sys.storagemodel();"     1       true    0       0
-7104   tablestoragemodel       2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"   1       true    0       0
+7104   tablestoragemodel       2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum("imprints") as "imprints",\n\tsum(case when sorted = false then 
8 * count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"       1       true    0       0
 7117   statistics      2000            0       true    0       0
 7245   systemfunctions 2000            0       true    0       0
 
diff --git 
a/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out 
b/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out
--- a/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out
+++ b/sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out
@@ -59,12 +59,12 @@ Ready.
 % sys.tbls,    sys.tbls,       sys.tbls,       sys.tbls,       sys.tbls,       
sys.tbls,       sys.tbls,       sys.x # table_name
 % name,        schema_id,      query,  type,   system, commit_action,  access, 
s # name
 % varchar,     int,    varchar,        smallint,       boolean,        
smallint,       smallint,       clob # type
-% 17,  4,      522,    1,      5,      1,      1,      6 # length
+% 17,  4,      433,    1,      5,      1,      1,      6 # length
 [ "_tables",   2000,   "",     0,      true,   0,      0,      "%able%"        
]
 [ "_tables",   2106,   "",     0,      true,   2,      0,      "%able%"        
]
 [ "tables",    2000,   "SELECT * FROM (SELECT p.*, 0 AS \"temporary\", 
CAST(CASE WHEN system THEN type + 10 /* system table/view */ ELSE (CASE WHEN 
commit_action = 0 THEN type /* table/view */ ELSE type + 20 /* global temp 
table */ END) END AS SMALLINT) AS table_type FROM \"sys\".\"_tables\" AS p 
UNION ALL SELECT t.*, 1 AS \"temporary\", CAST(type + 30 /* local temp table */ 
AS SMALLINT) AS table_type FROM \"tmp\".\"_tables\" AS t) AS tables where 
tables.type <> 2;",        1,      true,   0,      0,      "%able%"        ]
 [ "table_types",       2000,   "",     0,      true,   0,      0,      
"%able%"        ]
-[ "tablestoragemodel", 2000,   "-- A summary of the table storage requirement 
is is available as a table view.\n-- The auxiliary column denotes the maximum 
space if all non-sorted columns\n-- would be augmented with a hash (rare 
situation)\ncreate view sys.tablestoragemodel\nas select 
\"schema\",\"table\",max(count) as \"count\",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
\"schema\",\"table\";",  1,      true,   0,      0,      "%able%"        ]
+[ "tablestoragemodel", 2000,   "-- A summary of the table storage requirement 
is is available as a table view.\n-- The auxiliary column denotes the maximum 
space if all non-sorted columns\n-- would be augmented with a hash (rare 
situation)\ncreate view sys.tablestoragemodel\nas select 
\"schema\",\"table\",max(count) as \"count\",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as hashes,\n\tsum(",   
     1,      true,   0,      0,      "%able%"        ]
 #drop table x;
 
 # 10:06:32 >  
diff --git a/sql/test/BugTracker-2014/Tests/select-having.Bug-3458.sql 
b/sql/test/BugTracker-2014/Tests/select-having.Bug-3458.sql
--- a/sql/test/BugTracker-2014/Tests/select-having.Bug-3458.sql
+++ b/sql/test/BugTracker-2014/Tests/select-having.Bug-3458.sql
@@ -47,7 +47,7 @@ 5717  "queue" 2000    "create view sys.queue
 6368   "storage"       2000    "create view sys.storage as select * from 
sys.storage();"       1       true    0       false   0
 6380   "storagemodelinput"     2000    NULL    0       true    0       false   0
 6428   "storagemodel"  2000    "create view sys.storagemodel as select * from 
sys.storagemodel();"     1       true    0       false   0
-6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"   1       true    0       false   0
+6438   "tablestoragemodel"     2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum("imprints") as "imprints",\n\tsum(case when sorted = false then 
8 * count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"       1       true    0       false   0
 6453   "statistics"    2000    NULL    0       true    0       false   0
 6616   "systemfunctions"       2000    NULL    0       true    0       false   0
 
diff --git a/sql/test/BugTracker-2015/Tests/cardinality.Bug-3761.sql 
b/sql/test/BugTracker-2015/Tests/cardinality.Bug-3761.sql
--- a/sql/test/BugTracker-2015/Tests/cardinality.Bug-3761.sql
+++ b/sql/test/BugTracker-2015/Tests/cardinality.Bug-3761.sql
@@ -56,7 +56,7 @@ 7007  netcdf_attrs    2000            10      true    0       
0       0
 7046   storage 2000    "create view sys.""storage"" as select * from 
sys.""storage""();"       11      true    0       0       0
 7058   storagemodelinput       2000            10      true    0       0       0
 7106   storagemodel    2000    create view sys.storagemodel as select * from 
sys.storagemodel();       11      true    0       0       0
-7116   tablestoragemodel       2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum(imprints) as imprints,\n\tsum(case when sorted = false then 8 * 
count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"   11      true    0       0       0
+7116   tablestoragemodel       2000    "-- A summary of the table storage 
requirement is is available as a table view.\n-- The auxiliary column denotes 
the maximum space if all non-sorted columns\n-- would be augmented with a hash 
(rare situation)\ncreate view sys.tablestoragemodel\nas select 
""schema"",""table"",max(count) as ""count"",\n\tsum(columnsize) as 
columnsize,\n\tsum(heapsize) as heapsize,\n\tsum(hashes) as 
hashes,\n\tsum("imprints") as "imprints",\n\tsum(case when sorted = false then 
8 * count else 0 end) as auxiliary\nfrom sys.storagemodel() group by 
""schema"",""table"";"       11      true    0       0       0
 7129   statistics      2000            10      true    0       0       0
 7227   files   7176            10      true    0       0       0
 7240   sq      7176            10      true    0       0       0
diff --git 
a/sql/test/BugTracker-2016/Tests/DISTINCT_with_correlated_scalar_subquery_crashes_mserver.Bug-3920.sql
 
b/sql/test/BugTracker-2016/Tests/DISTINCT_with_correlated_scalar_subquery_crashes_mserver.Bug-3920.sql
--- 
a/sql/test/BugTracker-2016/Tests/DISTINCT_with_correlated_scalar_subquery_crashes_mserver.Bug-3920.sql
+++ 
b/sql/test/BugTracker-2016/Tests/DISTINCT_with_correlated_scalar_subquery_crashes_mserver.Bug-3920.sql
@@ -1173,12 +1173,12 @@ 7730|"st_collect"|"create aggregate st_c
 7734|"st_delaunaytriangles"|"create function st_delaunaytriangles(geom 
geometry, tolerance double, flags integer) returns geometry external name 
geom.""DelaunayTriangles"";"|"geom"|1|1|false|false|false|2000
 7740|"st_dump"|"create function st_dump(geom geometry) returns table(id 
string, polygonwkb geometry) external name 
geom.""Dump"";"|"geom"|1|5|false|false|false|2000
 7745|"st_dumppoints"|"create function st_dumppoints(geom geometry) returns 
table(path string, pointg geometry) external name 
geom.""DumpPoints"";"|"geom"|1|5|false|false|false|2000
-7976|"storage"|"create function sys.""storage""()\nreturns table (\n 
""schema"" string,\n ""table"" string,\n ""column"" string,\n ""type"" 
string,\n ""mode"" string,\n location string,\n ""count"" bigint,\n typewidth 
int,\n columnsize bigint,\n heapsize bigint,\n hashes bigint,\n phash 
boolean,\n imprints bigint,\n sorted boolean\n)\nexternal name 
sql.""storage"";"|"sql"|1|5|false|false|false|2000
-8008|"storage"|"create function sys.""storage""( sname string)\nreturns table 
(\n ""schema"" string,\n ""table"" string,\n ""column"" string,\n ""type"" 
string,\n ""mode"" string,\n location string,\n ""count"" bigint,\n typewidth 
int,\n columnsize bigint,\n heapsize bigint,\n hashes bigint,\n phash 
boolean,\n imprints bigint,\n sorted boolean\n)\nexternal name 
sql.""storage"";"|"sql"|1|5|false|false|false|2000
-8025|"storage"|"create function sys.""storage""( sname string, tname 
string)\nreturns table (\n ""schema"" string,\n ""table"" string,\n ""column"" 
string,\n ""type"" string,\n ""mode"" string,\n location string,\n ""count"" 
bigint,\n typewidth int,\n columnsize bigint,\n heapsize bigint,\n hashes 
bigint,\n phash boolean,\n imprints bigint,\n sorted boolean\n)\nexternal name 
sql.""storage"";"|"sql"|1|5|false|false|false|2000
-8043|"storage"|"create function sys.""storage""( sname string, tname string, 
cname string)\nreturns table (\n ""schema"" string,\n ""table"" string,\n 
""column"" string,\n ""type"" string,\n ""mode"" string,\n location string,\n 
""count"" bigint,\n typewidth int,\n columnsize bigint,\n heapsize bigint,\n 
hashes bigint,\n phash boolean,\n imprints bigint,\n sorted 
boolean\n)\nexternal name sql.""storage"";"|"sql"|1|5|false|false|false|2000
+7976|"storage"|"create function sys.""storage""()\nreturns table (\n 
""schema"" string,\n ""table"" string,\n ""column"" string,\n ""type"" 
string,\n ""mode"" string,\n location string,\n ""count"" bigint,\n typewidth 
int,\n columnsize bigint,\n heapsize bigint,\n hashes bigint,\n phash 
boolean,\n ""imprints"" bigint,\n sorted boolean\n)\nexternal name 
sql.""storage"";"|"sql"|1|5|false|false|false|2000
+8008|"storage"|"create function sys.""storage""( sname string)\nreturns table 
(\n ""schema"" string,\n ""table"" string,\n ""column"" string,\n ""type"" 
string,\n ""mode"" string,\n location string,\n ""count"" bigint,\n typewidth 
int,\n columnsize bigint,\n heapsize bigint,\n hashes bigint,\n phash 
boolean,\n ""imprints"" bigint,\n sorted boolean\n)\nexternal name 
sql.""storage"";"|"sql"|1|5|false|false|false|2000
+8025|"storage"|"create function sys.""storage""( sname string, tname 
string)\nreturns table (\n ""schema"" string,\n ""table"" string,\n ""column"" 
string,\n ""type"" string,\n ""mode"" string,\n location string,\n ""count"" 
bigint,\n typewidth int,\n columnsize bigint,\n heapsize bigint,\n hashes 
bigint,\n phash boolean,\n ""imprints"" bigint,\n sorted boolean\n)\nexternal 
name sql.""storage"";"|"sql"|1|5|false|false|false|2000
+8043|"storage"|"create function sys.""storage""( sname string, tname string, 
cname string)\nreturns table (\n ""schema"" string,\n ""table"" string,\n 
""column"" string,\n ""type"" string,\n ""mode"" string,\n location string,\n 
""count"" bigint,\n typewidth int,\n columnsize bigint,\n heapsize bigint,\n 
hashes bigint,\n phash boolean,\n ""imprints"" bigint,\n sorted 
boolean\n)\nexternal name sql.""storage"";"|"sql"|1|5|false|false|false|2000
 8074|"storagemodelinit"|"create procedure sys.storagemodelinit()\nbegin\n 
delete from sys.storagemodelinput;\n insert into sys.storagemodelinput\n select 
x.""schema"", x.""table"", x.""column"", x.""type"", x.typewidth, x.count, 0, 
x.typewidth, false, x.sorted from sys.""storage""() x;\n update 
sys.storagemodelinput\n set reference = true\n where 
concat(concat(""schema"",""table""), ""column"") in (\n select concat( 
concat(""fkschema"".""name"", ""fktable"".""name""), ""fkkeycol"".""name"" )\n 
from ""sys"".""keys"" as ""fkkey"",\n ""sys"".""objects"" as ""fkkeycol"",\n 
""sys"".""tables"" as ""fktable"",\n ""sys"".""schemas"" as ""fkschema""\n 
where ""fktable"".""id"" = ""fkkey"".""table_id""\n and ""fkkey"".""id"" = 
""fkkeycol"".""id""\n and ""fkschema"".""id"" = ""fktable"".""schema_id""\n and 
""fkkey"".""rkey"" > -1);\n update sys.storagemodelinput\n set ""distinct"" = 
""count"" \n where ""type"" = 'varchar' or 
""type""='clob';\nend;"|"user"|2|2|true|false|false|2000
-8098|"storagemodel"|"create function sys.storagemodel()\nreturns table (\n 
""schema"" string,\n ""table"" string,\n ""column"" string,\n ""type"" 
string,\n ""count"" bigint,\n columnsize bigint,\n heapsize bigint,\n hashes 
bigint,\n imprints bigint,\n sorted boolean)\nbegin\n return select 
i.""schema"", i.""table"", i.""column"", i.""type"", i.""count"",\n 
columnsize(i.""type"", i.count, i.""distinct""),\n heapsize(i.""type"", 
i.""distinct"", i.""atomwidth""),\n hashsize(i.""reference"", i.""count""),\n 
imprintsize(i.""count"",i.""type""),\n i.sorted\n from sys.storagemodelinput 
i;\nend;"|"user"|2|5|false|false|false|2000
+8098|"storagemodel"|"create function sys.storagemodel()\nreturns table (\n 
""schema"" string,\n ""table"" string,\n ""column"" string,\n ""type"" 
string,\n ""count"" bigint,\n columnsize bigint,\n heapsize bigint,\n hashes 
bigint,\n ""imprints"" bigint,\n sorted boolean)\nbegin\n return select 
i.""schema"", i.""table"", i.""column"", i.""type"", i.""count"",\n 
columnsize(i.""type"", i.count, i.""distinct""),\n heapsize(i.""type"", 
i.""distinct"", i.""atomwidth""),\n hashsize(i.""reference"", i.""count""),\n 
imprintsize(i.""count"",i.""type""),\n i.sorted\n from sys.storagemodelinput 
i;\nend;"|"user"|2|5|false|false|false|2000
 CREATE TABLE "sys"."args_cpy" (
        "id"      INTEGER,
        "func_id" INTEGER,
diff --git a/sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.sql 
b/sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.sql
--- a/sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.sql
+++ b/sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.sql
@@ -2,7 +2,7 @@
 create table bug3923(i integer);
 
 -- skip columns location, count, columnsize.
-select "schema", "table", "column", "type", "mode", typewidth, heapsize, 
hashes, phash, imprints, sorted from storage() where "table"= '_tables';
+select "schema", "table", "column", "type", "mode", typewidth, heapsize, 
hashes, phash, "imprints", sorted from storage() where "table"= '_tables';
 
 call storagemodelinit();
 update storagemodelinput set "count" =10000 where "table" ='bug3923';
diff --git a/sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.stable.out 
b/sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.stable.out
--- a/sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.stable.out
+++ b/sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.stable.out
@@ -74,7 +74,7 @@ Ready.
 [ "sys",       "_tables",      "id",   "int",  "writable",     4,      0,      
0,      false,  0,      true    ]
 [ "sys",       "_tables",      "name", "varchar",      "writable",     8,      
9712,   0,      false,  0,      false   ]
 [ "sys",       "_tables",      "schema_id",    "int",  "writable",     4,      
0,      0,      false,  0,      false   ]
-[ "sys",       "_tables",      "query",        "varchar",      "writable",     
45,     11157,  0,      false,  0,      false   ]
+[ "sys",       "_tables",      "query",        "varchar",      "writable",     
45,     11161,  0,      false,  0,      false   ]
 [ "sys",       "_tables",      "type", "smallint",     "writable",     2,      
0,      0,      false,  0,      false   ]
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to