From 49bcf31832d2b29fb150fdc5deedd06062bd36e6 Mon Sep 17 00:00:00 2001 From: antoniocarlon Date: Mon, 10 Sep 2018 14:26:53 +0200 Subject: [PATCH] Removed appname parameter --- server/extension/sql/85_isodistance.sql | 8 ++++---- server/extension/sql/90_isochrone.sql | 8 ++++---- .../test/expected/60_postalcodes_test.out | 2 +- .../extension/test/sql/50_namedplaces_test.sql | 16 ++++++++-------- .../extension/test/sql/60_postalcodes_test.sql | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/server/extension/sql/85_isodistance.sql b/server/extension/sql/85_isodistance.sql index eadd0b8..fbe192e 100644 --- a/server/extension/sql/85_isodistance.sql +++ b/server/extension/sql/85_isodistance.sql @@ -18,16 +18,16 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ with metrics('cdb_isodistance', user_isolines_config, logger, params): if user_isolines_config.heremaps_provider: - here_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_here_isodistance($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) + here_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_here_isodistance($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) return plpy.execute(here_plan, [username, orgname, source, mode, range, options]) elif user_isolines_config.mapzen_provider: - mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_mapzen_isodistance($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) + mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_mapzen_isodistance($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) elif user_isolines_config.mapbox_provider: - mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_mapbox_isodistance($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) + mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_mapbox_isodistance($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) elif user_isolines_config.tomtom_provider: - tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_tomtom_isodistance($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) + tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_tomtom_isodistance($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') diff --git a/server/extension/sql/90_isochrone.sql b/server/extension/sql/90_isochrone.sql index 26d73d7..731a27e 100644 --- a/server/extension/sql/90_isochrone.sql +++ b/server/extension/sql/90_isochrone.sql @@ -18,16 +18,16 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$ with metrics('cdb_isochrone', user_isolines_config, logger, params): if user_isolines_config.heremaps_provider: - here_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_here_isochrone($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) + here_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_here_isochrone($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) return plpy.execute(here_plan, [username, orgname, source, mode, range, options]) elif user_isolines_config.mapzen_provider: - mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_mapzen_isochrone($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) + mapzen_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_mapzen_isochrone($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) return plpy.execute(mapzen_plan, [username, orgname, source, mode, range, options]) elif user_isolines_config.mapbox_provider: - mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_mapbox_isochrone($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) + mapbox_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_mapbox_isochrone($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) return plpy.execute(mapbox_plan, [username, orgname, source, mode, range, options]) elif user_isolines_config.tomtom_provider: - tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_tomtom_isochrone($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) + tomtom_plan = plpy.prepare("SELECT * FROM cdb_dataservices_server.cdb_tomtom_isochrone($1, $2, $3, $4, $5, $6) as isoline; ", ["text", "text", "geometry(geometry, 4326)", "text", "integer[]", "text[]"]) return plpy.execute(tomtom_plan, [username, orgname, source, mode, range, options]) else: raise Exception('Requested isolines provider is not available') diff --git a/server/extension/test/expected/60_postalcodes_test.out b/server/extension/test/expected/60_postalcodes_test.out index bc7ac56..b2a5c91 100644 --- a/server/extension/test/expected/60_postalcodes_test.out +++ b/server/extension/test/expected/60_postalcodes_test.out @@ -6,7 +6,7 @@ DELETE FROM available_services; DELETE FROM admin0_synonyms; -- Check that the public function is callable, even with no data -- It should return NULL -SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', 'test_app', '03204'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', '03204'); cdb_geocode_postalcode_point ------------------------------ diff --git a/server/extension/test/sql/50_namedplaces_test.sql b/server/extension/test/sql/50_namedplaces_test.sql index ca601b0..0fde77f 100644 --- a/server/extension/test/sql/50_namedplaces_test.sql +++ b/server/extension/test/sql/50_namedplaces_test.sql @@ -29,6 +29,13 @@ SELECT cdb_dataservices_server.cdb_geocode_namedplace_point('test_user', 'test_o SELECT cdb_dataservices_server.cdb_geocode_namedplace_point('test_user', 'test_orgname', 'Elche', 'valencia', 'Spain'); -- Check for namedplaces signatures +SELECT exists(SELECT * + FROM pg_proc p + INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) + WHERE ns.nspname = 'cdb_dataservices_server' + AND proname = 'cdb_geocode_namedplace_point' + AND oidvectortypes(p.proargtypes) = 'text, text, text'); + SELECT exists(SELECT * FROM pg_proc p INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) @@ -41,14 +48,7 @@ SELECT exists(SELECT * INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) WHERE ns.nspname = 'cdb_dataservices_server' AND proname = 'cdb_geocode_namedplace_point' - AND oidvectortypes(p.proargtypes) = 'text, text, text, text, text'); - -SELECT exists(SELECT * - FROM pg_proc p - INNER JOIN pg_namespace ns ON (p.pronamespace = ns.oid) - WHERE ns.nspname = 'cdb_dataservices_server' - AND proname = 'cdb_geocode_namedplace_point' - AND oidvectortypes(p.proargtypes) = 'text, text, text, text, text'); + AND oidvectortypes(p.proargtypes) = 'text, text, text, text'); SELECT exists(SELECT * FROM pg_proc p diff --git a/server/extension/test/sql/60_postalcodes_test.sql b/server/extension/test/sql/60_postalcodes_test.sql index 180def8..55d1c85 100644 --- a/server/extension/test/sql/60_postalcodes_test.sql +++ b/server/extension/test/sql/60_postalcodes_test.sql @@ -7,7 +7,7 @@ DELETE FROM admin0_synonyms; -- Check that the public function is callable, even with no data -- It should return NULL -SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', 'test_app', '03204'); +SELECT cdb_dataservices_server.cdb_geocode_postalcode_point('test_user', 'test_org', '03204'); -- Insert dummy data into ip_address_locations INSERT INTO global_postal_code_points (the_geom, iso3, postal_code, postal_code_num) VALUES (