diff --git a/NEWS b/NEWS index f616fd10299..16df6170286 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,8 @@ pgRouting 3.6.0 Release Notes **Official functions changes** -* aStar +* `2516 ` Standarize output + pgr_aStar * Standarizing output columns to |short-generic-result| @@ -11,6 +12,16 @@ pgRouting 3.6.0 Release Notes * ``pgr_aStar`` (`One to Many`) added ``end_vid`` column. * ``pgr_aStar`` (`Many to One`) added ``start_vid`` column. +* `2523 ` Standarize output + pgr_bdAstar + + * Standarizing output columns to |short-generic-result| + + * ``pgr_bdAstar`` (`One to One`) added ``start_vid`` and ``end_vid`` columns. + * ``pgr_bdAstar`` (`One to Many`) added ``end_vid`` column. + * ``pgr_bdAstar`` (`Many to One`) added ``start_vid`` column. + + **C/C++ code enhancements** * `2504 ` To C++ pg data get, diff --git a/doc/astar/pgr_aStar.rst b/doc/astar/pgr_aStar.rst index 7fcfb6a2c96..6f1b31ee650 100644 --- a/doc/astar/pgr_aStar.rst +++ b/doc/astar/pgr_aStar.rst @@ -22,7 +22,7 @@ .. rubric:: Availability -* Version 3.5.0 +* Version 3.6.0 * Standarizing output columns to |short-generic-result| @@ -73,9 +73,7 @@ Description * `pgr_aStar(` `One to Many`_ `)` * `pgr_aStar(` `Many to One`_ `)` * `pgr_aStar(` `Many to Many`_ `)` - -* ``start_vid`` and ``end_vid`` in the result is used to distinguish to which - path it belongs. + * `pgr_aStar(` `Combinations`_ `)` Signatures ------------------------------------------------------------------------------- diff --git a/doc/bdAstar/pgr_bdAstar.rst b/doc/bdAstar/pgr_bdAstar.rst index 1856ef39ede..c090648ad60 100644 --- a/doc/bdAstar/pgr_bdAstar.rst +++ b/doc/bdAstar/pgr_bdAstar.rst @@ -22,6 +22,14 @@ .. rubric:: Availability +* Version 3.6.0 + + * Standarizing output columns to |short-generic-result| + + * ``pgr_bdAstar`` (`One to One`_) added ``start_vid`` and ``end_vid`` columns. + * ``pgr_bdAstar`` (`One to Many`_) added ``end_vid`` column. + * ``pgr_bdAstar`` (`Many to One`_) added ``start_vid`` column. + * Version 3.2.0 * New **proposed** signature: @@ -48,7 +56,6 @@ * **Official** ``pgr_bdAstar`` (`One to One`_) - Description ------------------------------------------------------------------------------- @@ -64,9 +71,7 @@ Description * `pgr_bdAstar(` `One to Many`_ `)` * `pgr_bdAstar(` `Many to One`_ `)` * `pgr_bdAstar(` `Many to Many`_ `)` - -* ``start_vid`` and ``end_vid`` in the result is used to distinguish to which - path it belongs. + * `pgr_bdAstar(` `Combinations`_ `)` Signatures ------------------------------------------------------------------------------- @@ -83,7 +88,7 @@ Signatures | pgr_bdAstar(`Edges SQL`_, `Combinations SQL`_, [**options**]) | **options:** ``[directed, heuristic, factor, epsilon]`` - | RETURNS SET OF |old-generic-result| + | RETURNS SET OF |short-generic-result| | OR EMPTY SET Optional parameters are `named parameters` and have a default value. @@ -100,7 +105,7 @@ One to One | pgr_bdAstar(`Edges SQL`_, **start vid**, **end vid**, [**options**]) | **options:** ``[directed, heuristic, factor, epsilon]`` - | RETURNS SET OF |result-1-1| + | RETURNS SET OF |short-generic-result| | OR EMPTY SET :Example: From vertex :math:`6` to vertex :math:`12` on a **directed** graph @@ -122,7 +127,7 @@ One to Many | pgr_bdAstar(`Edges SQL`_, **start vid**, **end vids**, [**options**]) | **options:** ``[directed, heuristic, factor, epsilon]`` - | RETURNS SET OF |result-1-m| + | RETURNS SET OF |short-generic-result| | OR EMPTY SET :Example: From vertex :math:`6` to vertices :math:`\{10, 12\}` on a **directed** @@ -144,7 +149,7 @@ Many to One | pgr_bdAstar(`Edges SQL`_, **start vids**, **end vid**, [**options**]) | **options:** ``[directed, heuristic, factor, epsilon]`` - | RETURNS SET OF |result-m-1| + | RETURNS SET OF |short-generic-result| | OR EMPTY SET :Example: From vertices :math:`\{6, 8\}` to vertex :math:`10` on an diff --git a/doc/src/migration.rst b/doc/src/migration.rst index 5ef17ce1257..1ba2b5ba613 100644 --- a/doc/src/migration.rst +++ b/doc/src/migration.rst @@ -105,6 +105,73 @@ Signatures to be migrated: the function ``my_dijkstra`` returns the new additional columns of ``pgr_dijkstra``. +Migration of ``pgr_bdAstar`` +------------------------------------------------------------------------------- + +Starting from `v3.6.0 `__ + +Signatures to be migrated: + +* ``pgr_bdAstar`` (`One to One`) +* ``pgr_bdAstar`` (`One to Many`) +* ``pgr_bdAstar`` (`Many to One`) + +:Before Migration: + +* Output columns were |old-generic-result| + + * Depending on the overload used, the columns ``start_vid`` and ``end_vid`` + might be missing: + + * ``pgr_bdAstar`` (`One to One`) does not have ``start_vid`` and ``end_vid``. + * ``pgr_bdAstar`` (`One to Many`) does not have ``start_vid``. + * ``pgr_bdAstar`` (`Many to One`) does not have ``end_vid``. + +:Migration: + +* Be aware of the existance of the additional columns. + +* In ``pgr_bdAstar`` (`One to One`) + + * ``start_vid`` contains the **start vid** parameter value. + * ``end_vid`` contains the **end vid** parameter value. + +.. literalinclude:: migration.queries + :start-after: --bdastar1 + :end-before: --bdastar2 + +* In ``pgr_bdAstar`` (`One to Many`) + + * ``start_vid`` contains the **start vid** parameter value. + +.. literalinclude:: migration.queries + :start-after: --bdastar2 + :end-before: --bdastar3 + +* In ``pgr_bdAstar`` (`Many to One`) + + * ``end_vid`` contains the **end vid** parameter value. + +.. literalinclude:: migration.queries + :start-after: --bdastar3 + :end-before: --bdastar4 + +* If needed filter out the added columns, for example: + +.. literalinclude:: migration.queries + :start-after: --bdastar4 + :end-before: --bdastar5 + +* If needed add the new columns, similar to the following example where + ``pgr_dijkstra`` is used, and the function had to be modified to be able to + return the new columns: + + * In `v3.0 `__ + the function ``my_dijkstra`` uses ``pgr_dijkstra``. + * Starting from `v3.5 `__ + the function ``my_dijkstra`` returns the new additional columns of + ``pgr_dijkstra``. + Migration of ``pgr_dijkstra`` ------------------------------------------------------------------------------- diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index c0b151c588c..674a1dd8476 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -24,7 +24,8 @@ pgRouting 3.6.0 Release Notes .. rubric:: Official functions changes -* aStar +* `2516 ` Standarize output + pgr_aStar * Standarizing output columns to |short-generic-result| @@ -32,6 +33,16 @@ pgRouting 3.6.0 Release Notes * ``pgr_aStar`` (`One to Many`) added ``end_vid`` column. * ``pgr_aStar`` (`Many to One`) added ``start_vid`` column. +* `2523 ` Standarize output + pgr_bdAstar + + * Standarizing output columns to |short-generic-result| + + * ``pgr_bdAstar`` (`One to One`) added ``start_vid`` and ``end_vid`` columns. + * ``pgr_bdAstar`` (`One to Many`) added ``end_vid`` column. + * ``pgr_bdAstar`` (`Many to One`) added ``start_vid`` column. + + .. rubric:: C/C++ code enhancements * `2504 ` To C++ pg data get, diff --git a/docqueries/bdAstar/doc-pgr_bdAstar.result b/docqueries/bdAstar/doc-pgr_bdAstar.result index 70c393c2565..17c6ca9fb24 100644 --- a/docqueries/bdAstar/doc-pgr_bdAstar.result +++ b/docqueries/bdAstar/doc-pgr_bdAstar.result @@ -9,12 +9,12 @@ SELECT * FROM pgr_bdAstar( 6, 12, directed => true, heuristic => 2 ); - seq | path_seq | node | edge | cost | agg_cost ------+----------+------+------+------+---------- - 1 | 1 | 6 | 4 | 1 | 0 - 2 | 2 | 7 | 10 | 1 | 1 - 3 | 3 | 8 | 12 | 1 | 2 - 4 | 4 | 12 | -1 | 0 | 3 + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+------+------+------+---------- + 1 | 1 | 6 | 12 | 6 | 4 | 1 | 0 + 2 | 2 | 6 | 12 | 7 | 10 | 1 | 1 + 3 | 3 | 6 | 12 | 8 | 12 | 1 | 2 + 4 | 4 | 6 | 12 | 12 | -1 | 0 | 3 (4 rows) /* -- q3 */ @@ -24,18 +24,18 @@ SELECT * FROM pgr_bdAstar( 6, ARRAY[10, 12], heuristic => 3, factor := 3.5 ); - seq | path_seq | end_vid | node | edge | cost | agg_cost ------+----------+---------+------+------+------+---------- - 1 | 1 | 10 | 6 | 4 | 1 | 0 - 2 | 2 | 10 | 7 | 8 | 1 | 1 - 3 | 3 | 10 | 11 | 9 | 1 | 2 - 4 | 4 | 10 | 16 | 16 | 1 | 3 - 5 | 5 | 10 | 15 | 3 | 1 | 4 - 6 | 6 | 10 | 10 | -1 | 0 | 5 - 7 | 1 | 12 | 6 | 4 | 1 | 0 - 8 | 2 | 12 | 7 | 8 | 1 | 1 - 9 | 3 | 12 | 11 | 11 | 1 | 2 - 10 | 4 | 12 | 12 | -1 | 0 | 3 + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+------+------+------+---------- + 1 | 1 | 6 | 10 | 6 | 4 | 1 | 0 + 2 | 2 | 6 | 10 | 7 | 8 | 1 | 1 + 3 | 3 | 6 | 10 | 11 | 9 | 1 | 2 + 4 | 4 | 6 | 10 | 16 | 16 | 1 | 3 + 5 | 5 | 6 | 10 | 15 | 3 | 1 | 4 + 6 | 6 | 6 | 10 | 10 | -1 | 0 | 5 + 7 | 1 | 6 | 12 | 6 | 4 | 1 | 0 + 8 | 2 | 6 | 12 | 7 | 8 | 1 | 1 + 9 | 3 | 6 | 12 | 11 | 11 | 1 | 2 + 10 | 4 | 6 | 12 | 12 | -1 | 0 | 3 (10 rows) /* -- q4 */ @@ -45,14 +45,14 @@ SELECT * FROM pgr_bdAstar( ARRAY[6, 8], 10, false, heuristic => 4 ); - seq | path_seq | start_vid | node | edge | cost | agg_cost ------+----------+-----------+------+------+------+---------- - 1 | 1 | 6 | 6 | 2 | 1 | 0 - 2 | 2 | 6 | 10 | -1 | 0 | 1 - 3 | 1 | 8 | 8 | 10 | 1 | 0 - 4 | 2 | 8 | 7 | 4 | 1 | 1 - 5 | 3 | 8 | 6 | 2 | 1 | 2 - 6 | 4 | 8 | 10 | -1 | 0 | 3 + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+------+------+------+---------- + 1 | 1 | 6 | 10 | 6 | 2 | 1 | 0 + 2 | 2 | 6 | 10 | 10 | -1 | 0 | 1 + 3 | 1 | 8 | 10 | 8 | 10 | 1 | 0 + 4 | 2 | 8 | 10 | 7 | 4 | 1 | 1 + 5 | 3 | 8 | 10 | 6 | 2 | 1 | 2 + 6 | 4 | 8 | 10 | 10 | -1 | 0 | 3 (6 rows) /* -- q5 */ diff --git a/docqueries/src/migration.result b/docqueries/src/migration.result index 391f7f70954..f8936394cdd 100644 --- a/docqueries/src/migration.result +++ b/docqueries/src/migration.result @@ -719,5 +719,71 @@ SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_aStar( (6 rows) /* --astar5 */ +/* --bdastar1 */ +SELECT * FROM pgr_aStar( + $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, + 6, 10); + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+------+------+------+---------- + 1 | 1 | 6 | 10 | 6 | 4 | 1 | 0 + 2 | 2 | 6 | 10 | 7 | 8 | 1 | 1 + 3 | 3 | 6 | 10 | 11 | 9 | 1 | 2 + 4 | 4 | 6 | 10 | 16 | 16 | 1 | 3 + 5 | 5 | 6 | 10 | 15 | 3 | 1 | 4 + 6 | 6 | 6 | 10 | 10 | -1 | 0 | 5 +(6 rows) + +/* --bdastar2 */ +SELECT * FROM pgr_aStar( + $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, + 6, ARRAY[3, 10]); + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+------+------+------+---------- + 1 | 1 | 6 | 3 | 6 | 4 | 1 | 0 + 2 | 2 | 6 | 3 | 7 | 7 | 1 | 1 + 3 | 3 | 6 | 3 | 3 | -1 | 0 | 2 + 4 | 1 | 6 | 10 | 6 | 4 | 1 | 0 + 5 | 2 | 6 | 10 | 7 | 8 | 1 | 1 + 6 | 3 | 6 | 10 | 11 | 9 | 1 | 2 + 7 | 4 | 6 | 10 | 16 | 16 | 1 | 3 + 8 | 5 | 6 | 10 | 15 | 3 | 1 | 4 + 9 | 6 | 6 | 10 | 10 | -1 | 0 | 5 +(9 rows) + +/* --bdastar3 */ +SELECT * FROM pgr_aStar( + $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, + ARRAY[3, 6], 10); + seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost +-----+----------+-----------+---------+------+------+------+---------- + 1 | 1 | 3 | 10 | 3 | 7 | 1 | 0 + 2 | 2 | 3 | 10 | 7 | 8 | 1 | 1 + 3 | 3 | 3 | 10 | 11 | 9 | 1 | 2 + 4 | 4 | 3 | 10 | 16 | 16 | 1 | 3 + 5 | 5 | 3 | 10 | 15 | 3 | 1 | 4 + 6 | 6 | 3 | 10 | 10 | -1 | 0 | 5 + 7 | 1 | 6 | 10 | 6 | 4 | 1 | 0 + 8 | 2 | 6 | 10 | 7 | 8 | 1 | 1 + 9 | 3 | 6 | 10 | 11 | 9 | 1 | 2 + 10 | 4 | 6 | 10 | 16 | 16 | 1 | 3 + 11 | 5 | 6 | 10 | 15 | 3 | 1 | 4 + 12 | 6 | 6 | 10 | 10 | -1 | 0 | 5 +(12 rows) + +/* --bdastar4 */ +SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_aStar( + $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, + 6, 10); + seq | path_seq | node | edge | cost | agg_cost +-----+----------+------+------+------+---------- + 1 | 1 | 6 | 4 | 1 | 0 + 2 | 2 | 7 | 8 | 1 | 1 + 3 | 3 | 11 | 9 | 1 | 2 + 4 | 4 | 16 | 16 | 1 | 3 + 5 | 5 | 15 | 3 | 1 | 4 + 6 | 6 | 10 | -1 | 0 | 5 +(6 rows) + +/* --bdastar5 */ ROLLBACK; ROLLBACK diff --git a/docqueries/src/migration.test.sql b/docqueries/src/migration.test.sql index 4dbe034314d..1462156d9c0 100644 --- a/docqueries/src/migration.test.sql +++ b/docqueries/src/migration.test.sql @@ -244,3 +244,20 @@ SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_aStar( $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, 6, 10); /* --astar5 */ +/* --bdastar1 */ +SELECT * FROM pgr_aStar( + $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, + 6, 10); +/* --bdastar2 */ +SELECT * FROM pgr_aStar( + $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, + 6, ARRAY[3, 10]); +/* --bdastar3 */ +SELECT * FROM pgr_aStar( + $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, + ARRAY[3, 6], 10); +/* --bdastar4 */ +SELECT seq, path_seq, node, edge, cost, agg_cost FROM pgr_aStar( + $$SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges$$, + 6, 10); +/* --bdastar5 */ diff --git a/pgtap/bdAstar/bdAstar/return_types_check.pg b/pgtap/bdAstar/bdAstar/return_types_check.pg deleted file mode 100644 index a82452a1a47..00000000000 --- a/pgtap/bdAstar/bdAstar/return_types_check.pg +++ /dev/null @@ -1,74 +0,0 @@ - -/*PGR-GNU***************************************************************** - -Copyright (c) 2018 pgRouting developers -Mail: project@pgrouting.org - ------- -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - ********************************************************************PGR-GNU*/ -BEGIN; - - -UPDATE edge_table SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT plan(6); - -SELECT can(ARRAY['pgr_bdastar']); - - ---V2.4+ -SELECT has_function('pgr_bdastar', - ARRAY['text','bigint','bigint','boolean', 'integer', 'numeric', 'numeric']); -SELECT function_returns('pgr_bdastar', - ARRAY['text','bigint','bigint','boolean', 'integer', 'numeric', 'numeric'], - 'setof record'); - --- testing for the signature that they return the correct names & columns - -PREPARE v21q00 AS -SELECT pg_typeof(seq)::text AS t1, pg_typeof(path_seq)::text AS t2, - pg_typeof(node)::text AS t5, pg_typeof(edge)::text AS t6, - pg_typeof(cost)::text AS t7, pg_typeof(agg_cost)::TEXT AS t8 - FROM ( - SELECT * FROM pgr_bdastar( - 'SELECT id, source, target, cost, reverse_cost, x1,y1,x2,y2 FROM edge_table', - 2, 3, true) ) AS a - limit 1 -; - -PREPARE v21q01 AS -SELECT 'integer'::text AS t1,'integer'::text AS t2, - 'bigint'::text AS t5, 'bigint'::text AS t6, - 'double precision'::text AS t7, 'double precision'::text AS t8; - -SELECT set_eq('v21q00', 'v21q01','Expected columns names & types in version 2.5'); - - --- CHECKING WORKS WITH & WITOUT REVERSE COST - -PREPARE v20q1 AS -SELECT * FROM pgr_bdastar( - 'SELECT id, source, target, cost, reverse_cost, x1,y1,x2,y2 FROM edge_table', - 2, 3, true); - -PREPARE v20q3 AS -SELECT * FROM pgr_bdastar( - 'SELECT id, source, target, cost, x1,y1,x2,y2 FROM edge_table', - 2, 3, false); - -SELECT lives_ok('v20q1','with reverse cost'); -SELECT lives_ok('v20q3','with NO reverse cost'); - - -SELECT finish(); -ROLLBACK; diff --git a/sql/bdAstar/bdAstar.sql b/sql/bdAstar/bdAstar.sql index da494e0b16d..a059d6a7ca4 100644 --- a/sql/bdAstar/bdAstar.sql +++ b/sql/bdAstar/bdAstar.sql @@ -42,14 +42,17 @@ CREATE FUNCTION pgr_bdAstar( OUT seq INTEGER, OUT path_seq INTEGER, + OUT start_vid BIGINT, + OUT end_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost FLOAT, OUT agg_cost FLOAT) RETURNS SETOF RECORD AS $BODY$ - SELECT a.seq, a.path_seq, a.node, a.edge, a.cost, a.agg_cost - FROM _pgr_bdAstar(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], ARRAY[$3]::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, false) AS a; + SELECT * + FROM _pgr_bdAstar(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], ARRAY[$3]::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, + false); $BODY$ LANGUAGE sql VOLATILE STRICT COST 100 @@ -69,6 +72,7 @@ CREATE FUNCTION pgr_bdAstar( OUT seq INTEGER, OUT path_seq INTEGER, + OUT start_vid BIGINT, OUT end_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, @@ -76,8 +80,8 @@ CREATE FUNCTION pgr_bdAstar( OUT agg_cost FLOAT) RETURNS SETOF RECORD AS $BODY$ - SELECT a.seq, a.path_seq, a.end_vid, a.node, a.edge, a.cost, a.agg_cost - FROM _pgr_bdAstar(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], $3::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, false) AS a; + SELECT * + FROM _pgr_bdAstar(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], $3::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, false); $BODY$ LANGUAGE sql VOLATILE STRICT COST 100 @@ -98,14 +102,15 @@ CREATE FUNCTION pgr_bdAstar( OUT seq INTEGER, OUT path_seq INTEGER, OUT start_vid BIGINT, + OUT end_vid BIGINT, OUT node BIGINT, OUT edge BIGINT, OUT cost FLOAT, OUT agg_cost FLOAT) RETURNS SETOF RECORD AS $BODY$ - SELECT a.seq, a.path_seq, a.start_vid, a.node, a.edge, a.cost, a.agg_cost - FROM _pgr_bdAstar(_pgr_get_statement($1), $2::BIGINT[], ARRAY[$3]::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, false) AS a; + SELECT * + FROM _pgr_bdAstar(_pgr_get_statement($1), $2::BIGINT[], ARRAY[$3]::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, false); $BODY$ LANGUAGE sql VOLATILE STRICT COST 100 diff --git a/tools/testers/astar_pgtap_tests.sql b/tools/testers/astar_pgtap_tests.sql index c2b0aa9db4a..9b9670c95c7 100644 --- a/tools/testers/astar_pgtap_tests.sql +++ b/tools/testers/astar_pgtap_tests.sql @@ -30,7 +30,7 @@ BEGIN RETURN QUERY SELECT skip(2, 'Combinations signature added on 3.2.0'); END IF; - IF min_version('3.6.0') AND fn = 'pgr_astar' THEN + IF min_version('3.6.0') AND fn IN('pgr_astar', 'pgr_bdastar') THEN RETURN QUERY SELECT set_eq( format($$SELECT proargnames FROM pg_proc WHERE proname = %1$L$$,fn), $$VALUES @@ -39,7 +39,7 @@ BEGIN ('{"","","","directed","heuristic","factor","epsilon","seq","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[]), ('{"","","","directed","heuristic","factor","epsilon","seq","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[]), ('{"","","directed","heuristic","factor","epsilon","seq","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[]) - $$); + $$, 'Column names'); RETURN QUERY SELECT set_eq( format($$SELECT proallargtypes FROM pg_proc WHERE proname = %1$L$$,fn), @@ -49,7 +49,7 @@ BEGIN ('{25,2277,20,16,23,%1$s,%1$s, 23,23,20,20,20,20,701,701}'::OID[]), ('{25,2277,2277,16,23,%1$s,%1$s,23,23,20,20,20,20,701,701}'::OID[]), ('{25,25,16,23,%1$s,%1$s, 23,23,20,20,20,20,701,701}'::OID[]) - $$,the_type_numb)); + $$,the_type_numb), 'Column types'); ELSIF min_version('3.2.0') THEN RETURN QUERY SELECT set_eq( @@ -60,7 +60,7 @@ BEGIN ('{"","","","directed","heuristic","factor","epsilon","seq","path_seq","start_vid","node","edge","cost","agg_cost"}'::TEXT[]), ('{"","","","directed","heuristic","factor","epsilon","seq","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[]), ('{"","","directed","heuristic","factor","epsilon","seq","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[]) - $$); + $$, 'Old column names'); RETURN QUERY SELECT set_eq( format($$SELECT proallargtypes FROM pg_proc WHERE proname = %1$L$$,fn), @@ -70,7 +70,7 @@ BEGIN ('{25,2277,20,16,23,%1$s,%1$s,23,23,20,20,20,701,701}'::OID[]), ('{25,2277,2277,16,23,%1$s,%1$s,23,23,20,20,20,20,701,701}'::OID[]), ('{25,25,16,23,%1$s,%1$s,23,23,20,20,20,20,701,701}'::OID[]) - $$,the_type_numb)); + $$,the_type_numb), 'Old column types'); ELSE RETURN QUERY SELECT set_eq( format($$SELECT proargnames FROM pg_proc WHERE proname = %1$L$$,fn), @@ -79,7 +79,7 @@ BEGIN ('{"","","","directed","heuristic","factor","epsilon","seq","path_seq","end_vid","node","edge","cost","agg_cost"}'::TEXT[]), ('{"","","","directed","heuristic","factor","epsilon","seq","path_seq","start_vid","node","edge","cost","agg_cost"}'::TEXT[]), ('{"","","","directed","heuristic","factor","epsilon","seq","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[]) - $$); + $$, 'Before combinations column names'); RETURN QUERY SELECT set_eq( format($$SELECT proallargtypes FROM pg_proc WHERE proname = %1$L$$,fn), @@ -88,7 +88,7 @@ BEGIN ('{25,20,2277,16,23,%1$s,%1$s,23,23,20,20,20,701,701}'::OID[]), ('{25,2277,20,16,23,%1$s,%1$s,23,23,20,20,20,701,701}'::OID[]), ('{25,2277,2277,16,23,%1$s,%1$s,23,23,20,20,20,20,701,701}'::OID[]) - $$,the_type_numb)); + $$,the_type_numb), 'Before combinations column types'); END IF; END;