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

pgr_bdAstar fails when source or target vertex does not exist in the graph #1733

Closed
krashish8 opened this issue Nov 16, 2020 · 0 comments · Fixed by #1734
Closed

pgr_bdAstar fails when source or target vertex does not exist in the graph #1733

krashish8 opened this issue Nov 16, 2020 · 0 comments · Fixed by #1734
Assignees
Milestone

Comments

@krashish8
Copy link
Member

Describe the bug
The pgr_bdAstar function fails (AssertFailedException) when either the source vertex, or the target vertex, or both do not exist in the graph.

To Reproduce
Steps to reproduce the behavior:

Execute the following query:

SELECT * FROM pgr_bdAstar(
    'SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2
    FROM edge_table',
    2, 100
);

Here vertex with id 100 does not exist in the graph. This query gives the error:

ERROR:  AssertFailedException: has_vertex(vid) at ... include/cpp_common/pgr_base_graph.hpp:527

Expected behavior
This query is expected to return an empty set of rows:

SELECT * FROM pgr_bdAstar(
    'SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2
    FROM edge_table',
    2, 100
);
 seq | path_seq | node | edge | cost | agg_cost 
-----+----------+------+------+------+----------
(0 rows)

Specifications (please complete the following information):
Use the commands:

sampledata=# SELECT version();
                                                            version                                                            
-------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 12.4 (Ubuntu 12.4-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0, 64-bit
(1 row)

sampledata=# SELECT postgis_full_version();
                                                                        postgis_full_version                                                                        
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
 POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="120" GEOS="3.8.0-CAPI-1.13.1 " PROJ="6.3.1" LIBXML="2.9.4" LIBJSON="0.13.1" LIBPROTOBUF="1.3.3" WAGYU="0.4.3 (Internal)"
(1 row)

sampledata=# SELECT pgr_version();
 pgr_version 
-------------
3.2.0-dev
(1 row)

@krashish8 krashish8 added this to the Release 3.2.0 milestone Nov 16, 2020
@krashish8 krashish8 self-assigned this Nov 16, 2020
@krashish8 krashish8 linked a pull request Nov 17, 2020 that will close this issue
2 tasks
krashish8 added a commit to krashish8/pgrouting that referenced this issue Nov 19, 2020
krashish8 added a commit to krashish8/pgrouting that referenced this issue Nov 19, 2020
krashish8 added a commit to krashish8/pgrouting that referenced this issue Nov 19, 2020
krashish8 added a commit that referenced this issue Nov 19, 2020
krashish8 added a commit that referenced this issue Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant