Changeset: 15e5c4ebc838 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=15e5c4ebc838 Modified Files: clients/Tests/SQL-dump.SQL.py clients/Tests/SQL-dump.stable.out clients/Tests/SQL-dump.stable.out.int128 sql/test/emptydb-upgrade-chain-hge/Tests/check.SQL.py sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128 sql/test/emptydb-upgrade-chain/Tests/check.SQL.py sql/test/emptydb-upgrade-chain/Tests/check.stable.out sql/test/emptydb-upgrade-chain/Tests/check.stable.out.int128 sql/test/emptydb-upgrade-hge/Tests/check.SQL.py sql/test/emptydb-upgrade-hge/Tests/check.stable.out sql/test/emptydb-upgrade-hge/Tests/check.stable.out.int128 sql/test/emptydb-upgrade/Tests/check.SQL.py sql/test/emptydb-upgrade/Tests/check.stable.out sql/test/emptydb-upgrade/Tests/check.stable.out.int128 sql/test/emptydb/Tests/check.SQL.py sql/test/emptydb/Tests/check.stable.out sql/test/emptydb/Tests/check.stable.out.int128 Branch: Jul2015 Log Message:
Normalization of output: remove comments and empty lines. diffs (truncated from 7556 to 300 lines): diff --git a/clients/Tests/SQL-dump.SQL.py b/clients/Tests/SQL-dump.SQL.py --- a/clients/Tests/SQL-dump.SQL.py +++ b/clients/Tests/SQL-dump.SQL.py @@ -85,8 +85,9 @@ out, err = clt.communicate(out) # do some normalization of the output: # remove SQL comments, collapse multiple white space into a single space -import re +out = re.sub('^[ \t]*(?:--.*)?\n', '', out, flags = re.M) out = re.sub(r'(?:\\n|\\t| )+', ' ', re.sub(r'--.*?(?:\\n)+', '', out)) +out = re.sub('[\t ]*--.*', '', out) sys.stdout.write(out) sys.stderr.write(err) 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 @@ -881,7 +881,6 @@ SELECT * FROM (SELECT p.* FROM "sys"."_c create view sys.environment as select * from sys.environment(); create view sys.optimizers as select * from sys.optimizers(); create view sys.querylog_calls as select * from sys.querylog_calls(); --- create table views for convenience create view sys.querylog_catalog as select * from sys.querylog_catalog(); create view sys.querylog_history as select qd.*, ql."start",ql."stop", ql.arguments, ql.tuples, ql.run, ql.ship, ql.cpu, ql.io @@ -893,9 +892,6 @@ 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 /* 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"; --- A summary of the table storage requirement is is available as a table view. --- The auxiliary column denotes the maximum space if all non-sorted columns --- would be augmented with a hash (rare situation) create view sys.tablestoragemodel as select "schema","table",max(count) as "count", sum(columnsize) as columnsize, @@ -920,11 +916,8 @@ create procedure sys.analyze(minmax int, external name sql.analyze; create procedure sys.analyze(minmax int, "sample" bigint, sch string, tbl string, col string) external name sql.analyze; --- ogc Spatial Analysis methods - create function area(g geometry) returns float external name geom."Area"; create function astext(g geometry) returns string external name geom."AsText"; --- The BAT buffer pool overview create function sys.bbp () returns table (id int, name string, htype string, ttype string, count bigint, refcnt int, lrefcnt int, @@ -935,25 +928,10 @@ create function boundary(g geometry) ret create function "broadcast" (p inet) returns inet external name inet."broadcast"; create function buffer(a geometry, distance float) returns geometry external name geom."Buffer"; --- This Source Code Form is subject to the terms of the Mozilla Public --- License, v. 2.0. If a copy of the MPL was not distributed with this --- file, You can obtain one at http://mozilla.org/MPL/2.0/. --- --- Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - --- (co) Arjen de Rijke, Bart Scheers --- Use statistical functions from gsl library - --- Calculate Chi squared probability create function sys.chi2prob(chi2 double, datapoints double) returns double external name gsl."chi2prob"; create procedure sys.clearrejects() external name sql.copy_rejects_clear; --- The predicted storage footprint of the complete database --- determines the amount of diskspace needed for persistent storage --- and the upperbound when all possible index structures are created. --- The storage requirement for foreign key joins is split amongst the participants. - create function sys.columnsize(nme string, i bigint, d bigint) returns bigint begin @@ -996,114 +974,69 @@ create function crosses(a geometry, b ge create function date_to_str(d date, format string) returns string external name mtime."date_to_str"; CREATE FUNCTION db_users () RETURNS TABLE( name varchar(2048)) EXTERNAL NAME sql.db_users; --- This Source Code Form is subject to the terms of the Mozilla Public --- License, v. 2.0. If a copy of the MPL was not distributed with this --- file, You can obtain one at http://mozilla.org/MPL/2.0/. --- --- Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - create function degrees(r double) returns double return r*180/pi(); ---Column c has a dependency on function f create function dependencies_columns_on_functions() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select c.name, f.name, 'DEP_FUNC' from functions as f, columns as c, dependencies as dep where c.id = dep.id and f.id = dep.depend_id and dep.depend_type = 7); ---Column c has a dependency on index i create function dependencies_columns_on_indexes() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select c.name, i.name, 'DEP_INDEX' from columns as c, objects as kc, idxs as i where kc."name" = c.name and kc.id = i.id and c.table_id = i.table_id and i.name not in (select name from keys)); ---Column c has a dependency on key k create function dependencies_columns_on_keys() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select c.name, k.name, 'DEP_KEY' from columns as c, objects as kc, keys as k where kc."name" = c.name and kc.id = k.id and k.table_id = c.table_id and k.rkey = -1); ---Column c has a dependency on trigger tri create function dependencies_columns_on_triggers() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select c.name, tri.name, 'DEP_TRIGGER' from columns as c, triggers as tri, dependencies as dep where dep.id = c.id and dep.depend_id =tri.id and dep.depend_type = 8); ---Column c has a dependency on view v create function dependencies_columns_on_views() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select c.name, v.name, 'DEP_VIEW' from columns as c, tables as v, dependencies as dep where c.id = dep.id and v.id = dep.depend_id and dep.depend_type = 5 and v.type = 1); ---Function f1 has a dependency on function f2 create function dependencies_functions_on_functions() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select f1.name, f2.name, 'DEP_FUNC' from functions as f1, functions as f2, dependencies as dep where f1.id = dep.id and f2.id = dep.depend_id and dep.depend_type = 7); ---Function f1 has a dependency on trigger tri create function dependencies_functions_os_triggers() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select f.name, tri.name, 'DEP_TRIGGER' from functions as f, triggers as tri, dependencies as dep where dep.id = f.id and dep.depend_id =tri.id and dep.depend_type = 8); ---Key k has a dependency on foreign key fk create function dependencies_keys_on_foreignkeys() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select k.name, fk.name, 'DEP_FKEY' from keys as k, keys as fk where fk.rkey = k.id); ---User (owner) has a dependency in schema s create function dependencies_owners_on_schemas() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select a.name, s.name, 'DEP_SCHEMA' from schemas as s, auths a where s.owner = a.id); --- This Source Code Form is subject to the terms of the Mozilla Public --- License, v. 2.0. If a copy of the MPL was not distributed with this --- file, You can obtain one at http://mozilla.org/MPL/2.0/. --- --- Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - ---Schema s has a dependency on user u create function dependencies_schemas_on_users() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select s.name, u.name, 'DEP_USER' from schemas as s, users u where u.default_schema = s.id); ---Table t has a dependency on foreign key k create function dependencies_tables_on_foreignkeys() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select t.name, fk.name, 'DEP_FKEY' from tables as t, keys as k, keys as fk where fk.rkey = k.id and k.table_id = t.id); ---Table t has a dependency on function f create function dependencies_tables_on_functions() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select t.name, f.name, 'DEP_FUNC' from functions as f, tables as t, dependencies as dep where t.id = dep.id and f.id = dep.depend_id and dep.depend_type = 7 and t.type = 0); ---Table t has a dependency on index i create function dependencies_tables_on_indexes() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select t.name, i.name, 'DEP_INDEX' from tables as t, idxs as i where i.table_id = t.id and i.name not in (select name from keys) and t.type = 0); ---Table t has a dependency on trigger tri - create function dependencies_tables_on_triggers() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table ((select t.name, tri.name, 'DEP_TRIGGER' from tables as t, triggers as tri where tri.table_id = t.id) union (select t.name, tri.name, 'DEP_TRIGGER' from triggers tri, tables t, dependencies dep where dep.id = t.id and dep.depend_id =tri.id and dep.depend_type = 8)); ---Table t has a dependency on view v create function dependencies_tables_on_views() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select t.name, v.name, 'DEP_VIEW' from tables as t, tables as v, dependencies as dep where t.id = dep.id and v.id = dep.depend_id and dep.depend_type = 5 and v.type = 1); ---View v has a dependency on function f create function dependencies_views_on_functions() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select v.name, f.name, 'DEP_FUNC' from functions as f, tables as v, dependencies as dep where v.id = dep.id and f.id = dep.depend_id and dep.depend_type = 7 and v.type = 1); ---View v has a dependency on trigger tri create function dependencies_views_on_triggers() returns table (sch varchar(100), usr varchar(100), dep_type varchar(32)) return table (select v.name, tri.name, 'DEP_TRIGGER' from tables as v, triggers as tri, dependencies as dep where dep.id = v.id and dep.depend_id =tri.id and dep.depend_type = 8 and v.type = 1); create function difference(a geometry, b geometry) returns geometry external name geom."Difference"; --- CREATE FUNCTION Point(g Geometry) RETURNS Point external name geom.point; --- CREATE FUNCTION Curve(g Geometry) RETURNS Curve external name geom.curve; --- CREATE FUNCTION LineString(g Geometry) RETURNS LineString external name geom.linestring; --- CREATE FUNCTION Surface(g Geometry) RETURNS Surface external name geom.surface; --- CREATE FUNCTION Polygon(g Geometry) RETURNS Polygon external name geom.polygon; - --- ogc basic methods create function dimension(g geometry) returns integer external name geom."Dimension"; create function disjoint(a geometry, b geometry) returns boolean external name geom."Disjoint"; create function distance(a geometry, b geometry) returns float external name geom."Distance"; CREATE FUNCTION env () RETURNS TABLE( name varchar(1024), value varchar(2048)) EXTERNAL NAME sql.sql_environment; create function envelope(g geometry) returns geometry external name geom."Envelope"; --- The environment table create function sys.environment() returns table ("name" string, value string) external name sql.sql_environment; --- This Source Code Form is subject to the terms of the Mozilla Public --- License, v. 2.0. If a copy of the MPL was not distributed with this --- file, You can obtain one at http://mozilla.org/MPL/2.0/. --- --- Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - --- assume milliseconds when converted to TIMESTAMP create function sys."epoch"(sec bigint) returns timestamp external name timestamp."epoch"; create function sys."epoch"(sec int) returns timestamp @@ -1112,29 +1045,17 @@ create function sys."epoch"(ts timestamp external name timestamp."epoch"; create function sys."epoch"(ts timestamp with time zone) returns int external name timestamp."epoch"; --- ogc spatial relation methods create function equals(a geometry, b geometry) returns boolean external name geom."Equals"; create procedure sys.evalalgebra( ra_stmt string, opt bool) external name sql."evalAlgebra"; create procedure fitsattach(fname string) external name fits.attach; create procedure fitsload(tname string) external name fits.load; --- fuse two (1-byte) tinyint values into one (2-byte) smallint value create function fuse(one tinyint, two tinyint) returns smallint external name udf.fuse; --- fuse two (2-byte) smallint values into one (4-byte) integer value create function fuse(one smallint, two smallint) returns integer external name udf.fuse; --- fuse two (4-byte) integer values into one (8-byte) bigint value create function fuse(one integer, two integer) returns bigint external name udf.fuse; --- This Source Code Form is subject to the terms of the Mozilla Public --- License, v. 2.0. If a copy of the MPL was not distributed with this --- file, You can obtain one at http://mozilla.org/MPL/2.0/. --- --- Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - --- (c) Author M.Kersten - create function sys.generate_series(first tinyint, last tinyint) returns table (value tinyint) external name generator.series; @@ -1173,7 +1094,6 @@ returns table (value timestamp) external name generator.series; create function geomcollectionfromtext(wkt string, srid smallint) returns multipolygon external name geom."GeomCollectionFromText"; create function geometrytypeid(g geometry) returns integer external name geom."GeometryTypeId"; --- The srid in the *FromText Functions is currently not used create function geomfromtext(wkt string, srid smallint) returns geometry external name geom."GeomFromText"; create function getanchor( theurl url ) returns string external name url."getAnchor"; @@ -1204,7 +1124,6 @@ create function getuser(theurl url) retu create function sys.hashsize(b boolean, i bigint) returns bigint begin - -- assume non-compound keys if b = true then return 8 * i; @@ -1259,12 +1178,6 @@ create function "left_shift"(i1 inet, i2 create function "left_shift_assign"(i1 inet, i2 inet) returns boolean external name inet."<<="; create function length(g geometry) returns float external name geom."Length"; --- This Source Code Form is subject to the terms of the Mozilla Public --- License, v. 2.0. If a copy of the MPL was not distributed with this --- file, You can obtain one at http://mozilla.org/MPL/2.0/. --- --- Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - create filter function "like"(val string, pat string, esc string) external name algebra."like"; create filter function "like"(val string, pat string) external name algebra."like"; create function linefromtext(wkt string, srid smallint) returns linestring external name geom."LineFromText"; @@ -1274,20 +1187,8 @@ create procedure listdir(dirname string) create procedure listdirpat(dirname string,pat string) external name fits.listdirpattern; create function "masklen" (p inet) returns int external name inet."masklen"; --- currently we only use mbr instead of --- Envelope():Geometry --- as that returns Geometry objects, and we prefer the explicit mbr's --- minimum bounding rectangle (mbr) create function mbr (g geometry) returns mbr external name geom.mbr; create function mbroverlaps(a mbr, b mbr) returns boolean external name geom."mbroverlaps"; --- This Source Code Form is subject to the terms of the Mozilla Public --- License, v. 2.0. If a copy of the MPL was not distributed with this --- file, You can obtain one at http://mozilla.org/MPL/2.0/. --- --- Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - --- (co) Arjen de Rijke - create function sys.md5(v string) returns string external name clients.md5sum; create aggregate median(val tinyint) returns tinyint @@ -1328,12 +1229,6 @@ returns string begin return cast(num as string); end; --- This Source Code Form is subject to the terms of the Mozilla Public --- License, v. 2.0. If a copy of the MPL was not distributed with this --- file, You can obtain one at http://mozilla.org/MPL/2.0/. --- --- Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - create function ms_stuff( s1 varchar(32), st int, len int, s3 varchar(32)) returns varchar(32) begin @@ -1355,13 +1250,6 @@ end; create function ms_trunc(num double, prc int) returns double external name sql.ms_trunc; --- gr_name is "GLOBAL" or "ROOT" for classic NetCDF files --- used for groups in HDF5 files --- global attributes have obj_name="" - --- create function netcdfvar (fname varchar(256)) --- returns int external name netcdf.test; - create procedure netcdf_attach(fname varchar(256)) external name netcdf.attach; create procedure netcdf_importvar(fid integer, varnname varchar(256)) @@ -1376,32 +1264,16 @@ create function newurl(protocol string, create function newurl(protocol string, hostname string, file string) returns url external name url."new"; --- This Source Code Form is subject to the terms of the Mozilla Public _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list