Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2565 Returning empty results when vertex does not exist #2566

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Changes on the documentation to the following:

* using bootstrap_version 2 because 3+ does not do dropdowns

**Issue fixes**

* [#2565](https://github.com/pgRouting/pgrouting/issues/2565)
pgr_pgr_lengauerTarjanDominatorTree triggers an assertion

**SQL enhancements**

* [#2561](https://github.com/pgRouting/pgrouting/issues/2561) Not use
Expand Down
5 changes: 5 additions & 0 deletions doc/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ Changes on the documentation to the following:

* using bootstrap_version 2 because 3+ does not do dropdowns

.. rubric:: Issue fixes

* `#2565 <https://github.com/pgRouting/pgrouting/issues/2565>`__
pgr_pgr_lengauerTarjanDominatorTree triggers an assertion

.. rubric:: SQL enhancements

* `#2561 <https://github.com/pgRouting/pgrouting/issues/2561>`__ Not use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Pgr_LTDTree : public pgrouting::Pgr_messages {
int64_t root
){
std::vector<II_t_rt> results;
if (!graph.has_vertex(root)) return results;
std::vector<int64_t> idoms = std::vector<int64_t>(boost::num_vertices(graph.graph), -1);
auto dominatorTree =
make_iterator_property_map
Expand Down
14 changes: 10 additions & 4 deletions pgtap/dominator/lengauerTarjanDominatorTree/edge_cases.pg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
********************************************************************PGR-GNU*/
BEGIN;
UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT CASE WHEN NOT min_version('3.2.0') THEN plan(1) ELSE plan(11) END;
SELECT CASE WHEN NOT min_version('3.2.0') THEN plan(1) ELSE plan(12) END;

CREATE OR REPLACE FUNCTION edge_cases()
RETURNS SETOF TEXT AS
Expand Down Expand Up @@ -63,16 +63,22 @@ WHERE id = 1;
RETURN QUERY
SELECT set_eq('q2', $$VALUES (1, 5, 5, 1, 1)$$, 'graph2: u<->u');

/*
PERFORM todo('triggers an assertion when the vertex does not exist', 1);
IF min_version('3.5.1') THEN

PREPARE ltd_test2_1 AS
SELECT *
FROM pgr_lengauerTarjanDominatorTree(
'q2',6
);
RETURN QUERY
SELECT lives_ok('ltd_test2_1', 'test2: Triggers an assertion');
*/

ELSE

RETURN QUERY
SELECT skip(1, 'triggers an assertion when the vertex does not exist');

END IF;

PREPARE ltd_test2 AS
SELECT *
Expand Down
Loading