From 9af97f0ef602529e26795b299124e681ec9046cd Mon Sep 17 00:00:00 2001 From: cvvergara Date: Thu, 5 Feb 2026 10:03:34 -0600 Subject: [PATCH 1/8] (drivers) testing for empty edges SQL --- src/allpairs/allpairs_driver.cpp | 6 ++++-- src/dijkstra/shortestPath_driver.cpp | 6 ++++-- src/metrics/metrics_driver.cpp | 6 ++++-- src/ordering/ordering_driver.cpp | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/allpairs/allpairs_driver.cpp b/src/allpairs/allpairs_driver.cpp index abac0d364d..f5d8bac8d9 100644 --- a/src/allpairs/allpairs_driver.cpp +++ b/src/allpairs/allpairs_driver.cpp @@ -37,7 +37,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_types/iid_t_rt.h" #include "cpp_common/pgdata_getters.hpp" -#include "cpp_common/assert.hpp" #include "cpp_common/to_postgres.hpp" #include "allpairs/allpairs.hpp" @@ -72,7 +71,10 @@ do_allpairs( std::string hint = ""; try { - pgassert(!edges_sql.empty()); + if (edges_sql.empty()) { + err << "Empty edges SQL"; + return; + } using pgrouting::pgget::get_edges; using pgrouting::to_postgres::matrix_to_tuple; diff --git a/src/dijkstra/shortestPath_driver.cpp b/src/dijkstra/shortestPath_driver.cpp index 44421aa0aa..5a0a39b12f 100644 --- a/src/dijkstra/shortestPath_driver.cpp +++ b/src/dijkstra/shortestPath_driver.cpp @@ -49,7 +49,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/combinations.hpp" #include "cpp_common/utilities.hpp" #include "cpp_common/to_postgres.hpp" -#include "cpp_common/assert.hpp" #include "dijkstra/dijkstra.hpp" #include "withPoints/withPoints.hpp" @@ -138,7 +137,10 @@ do_shortestPath( std::string hint = ""; try { - pgassert(!edges_sql.empty()); + if (edges_sql.empty()) { + err << "Empty edges SQL"; + return; + } using pgrouting::pgget::get_edges; using pgrouting::pgget::get_points; diff --git a/src/metrics/metrics_driver.cpp b/src/metrics/metrics_driver.cpp index 4e8955e7b9..a754b39e06 100644 --- a/src/metrics/metrics_driver.cpp +++ b/src/metrics/metrics_driver.cpp @@ -36,7 +36,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "cpp_common/pgdata_getters.hpp" -#include "cpp_common/assert.hpp" #include "metrics/bandwidth.hpp" @@ -53,7 +52,10 @@ do_metrics( std::string hint; try { - pgassert(!edges_sql.empty()); + if (edges_sql.empty()) { + err << "Empty edges SQL"; + return 0; + } using pgrouting::pgget::get_edges; using pgrouting::UndirectedGraph; diff --git a/src/ordering/ordering_driver.cpp b/src/ordering/ordering_driver.cpp index 2b17738a98..c74c2896ff 100644 --- a/src/ordering/ordering_driver.cpp +++ b/src/ordering/ordering_driver.cpp @@ -41,7 +41,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "cpp_common/pgdata_getters.hpp" -#include "cpp_common/assert.hpp" #include "cpp_common/to_postgres.hpp" #include "ordering/sloanOrdering.hpp" @@ -81,7 +80,10 @@ do_ordering( std::string hint = ""; try { - pgassert(!edges_sql.empty()); + if (edges_sql.empty()) { + err << "Empty edges SQL"; + return; + } using pgrouting::pgget::get_edges; using pgrouting::UndirectedGraph; From 4e15d8b5dc1fecdd0c24e46e6bc667be9687d125 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Wed, 4 Feb 2026 23:03:31 -0600 Subject: [PATCH 2/8] (shortestPath_driver.cpp) lint --- src/dijkstra/shortestPath_driver.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dijkstra/shortestPath_driver.cpp b/src/dijkstra/shortestPath_driver.cpp index 5a0a39b12f..57a62216f2 100644 --- a/src/dijkstra/shortestPath_driver.cpp +++ b/src/dijkstra/shortestPath_driver.cpp @@ -120,6 +120,7 @@ do_shortestPath( bool directed, bool only_cost, bool normal, + int64_t n_goals, bool global, char driving_side, @@ -132,7 +133,6 @@ do_shortestPath( std::ostringstream ¬ice, std::ostringstream &err) { using pgrouting::Path; - using pgrouting::to_pg_msg; std::string hint = ""; @@ -216,16 +216,16 @@ do_shortestPath( size_t n = n_goals <= 0? (std::numeric_limits::max)() : static_cast(n_goals); + DirectedGraph digraph; + UndirectedGraph undigraph; + std::deque paths; if (directed) { - DirectedGraph graph; graph.insert_edges(edges); - - paths = dijkstra(graph, combinations, only_cost, n); + paths = dijkstra(digraph, combinations, only_cost, n); } else { - UndirectedGraph graph; graph.insert_edges(edges); - paths = dijkstra(graph, combinations, only_cost, n); + paths = dijkstra(undigraph, combinations, only_cost, n); } post_process(paths, only_cost, normal, n, global); From 37628762f9958dd6a78c87fe24781e0b4274b4c3 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Thu, 5 Feb 2026 09:59:41 -0600 Subject: [PATCH 3/8] (get_combinations) imporved code --- src/cpp_common/combinations.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cpp_common/combinations.cpp b/src/cpp_common/combinations.cpp index 729ac442ed..0a5c4d9cda 100644 --- a/src/cpp_common/combinations.cpp +++ b/src/cpp_common/combinations.cpp @@ -165,11 +165,10 @@ get_combinations( /* queries are stored in vectors */ auto combinations = !combinations_sql.empty()? get_combinations(combinations_sql) : std::vector(); + ends = (!starts.empty() && ends.empty()) ? starts : ends; + /* data comes from CostMatrix */ - if (combinations.empty() && !starts.empty() && ends.empty()) { - is_matrix = true; - ends = starts; - } + is_matrix = combinations.empty() && starts == ends; /* data comes from a combinations */ for (const auto &row : combinations) { From 8418228a1b539be42e16382476798f2c9ae49443 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Thu, 5 Feb 2026 10:39:15 -0600 Subject: [PATCH 4/8] (pgtap) testing for empty edges sql - Only applies for C++ drivers --- pgtap/allpairs/floydWarshall/no_crash_test.pg | 3 ++- pgtap/allpairs/johnson/no_crash_test.pg | 3 ++- pgtap/dijkstra/dijkstra/no_crash_test.pg | 4 +++- pgtap/dijkstra/dijkstraCost/no_crash_test.pg | 5 +++-- .../dijkstraCostMatrix/no_crash_test.pg | 3 ++- pgtap/dijkstra/dijkstraNear/no_crash_test.pg | 3 ++- .../dijkstraNearCost/no_crash_test.pg | 4 +++- pgtap/metrics/bandwidth/no_crash_test.pg | 3 ++- .../cuthillMckeeOrdering/no_crash_test.pg | 3 ++- pgtap/ordering/kingOrdering/no_crash_test.pg | 3 ++- pgtap/ordering/sloan/no_crash_test.pg | 5 +++-- .../ordering/topologicalSort/no_crash_test.pg | 3 ++- pgtap/withPoints/withPoints/no_crash_test.pg | 4 +++- .../withPointsCost/no_crash_test.pg | 4 +++- .../withPointsCostMatrix/no_crash_test.pg | 5 ++++- tools/testers/no_crash_test.pg | 20 +++++++++++++++++++ 16 files changed, 58 insertions(+), 17 deletions(-) diff --git a/pgtap/allpairs/floydWarshall/no_crash_test.pg b/pgtap/allpairs/floydWarshall/no_crash_test.pg index a87ba843c1..0255f94846 100644 --- a/pgtap/allpairs/floydWarshall/no_crash_test.pg +++ b/pgtap/allpairs/floydWarshall/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT plan(5); +SELECT plan(6); PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -32,6 +32,7 @@ LANGUAGE plpgsql VOLATILE; SELECT * FROM test_function(); +SELECT throw_on_empty_edges_sql('pgr_floydWarshall', ''); SELECT finish(); ROLLBACK; diff --git a/pgtap/allpairs/johnson/no_crash_test.pg b/pgtap/allpairs/johnson/no_crash_test.pg index 546926d269..980be540cf 100644 --- a/pgtap/allpairs/johnson/no_crash_test.pg +++ b/pgtap/allpairs/johnson/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT plan(5); +SELECT plan(6); PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -33,6 +33,7 @@ LANGUAGE plpgsql VOLATILE; SELECT * FROM test_function(); +SELECT throw_on_empty_edges_sql('pgr_floydWarshall', ''); SELECT finish(); ROLLBACK; diff --git a/pgtap/dijkstra/dijkstra/no_crash_test.pg b/pgtap/dijkstra/dijkstra/no_crash_test.pg index 7d909cf378..37cd298ee6 100644 --- a/pgtap/dijkstra/dijkstra/no_crash_test.pg +++ b/pgtap/dijkstra/dijkstra/no_crash_test.pg @@ -7,9 +7,11 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('3.1.0') THEN plan(81) ELSE plan(68) END; +SELECT CASE WHEN min_version('3.1.0') THEN plan(82) ELSE plan(69) END; SELECT no_crash_dijkstra('pgr_dijkstra'); +SELECT throw_on_empty_edges_sql('pgr_dijkstra', ',1,2'); + SELECT finish(); ROLLBACK; diff --git a/pgtap/dijkstra/dijkstraCost/no_crash_test.pg b/pgtap/dijkstra/dijkstraCost/no_crash_test.pg index 42189998a5..b27b0967ea 100644 --- a/pgtap/dijkstra/dijkstraCost/no_crash_test.pg +++ b/pgtap/dijkstra/dijkstraCost/no_crash_test.pg @@ -7,9 +7,10 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('3.1.0') THEN plan(81) ELSE plan(68) END; +SELECT CASE WHEN min_version('3.1.0') THEN plan(82) ELSE plan(69) END; SELECT no_crash_dijkstra('pgr_dijkstraCost'); -SELECT finish(); +SELECT throw_on_empty_edges_sql('pgr_dijkstraCost', ',1,2'); +SELECT finish(); ROLLBACK; diff --git a/pgtap/dijkstra/dijkstraCostMatrix/no_crash_test.pg b/pgtap/dijkstra/dijkstraCostMatrix/no_crash_test.pg index 611fc1ffe5..ca543b7da0 100644 --- a/pgtap/dijkstra/dijkstraCostMatrix/no_crash_test.pg +++ b/pgtap/dijkstra/dijkstraCostMatrix/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT plan(14); +SELECT plan(15); PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -45,6 +45,7 @@ LANGUAGE plpgsql VOLATILE; SELECT * FROM test_function(); +SELECT throw_on_empty_edges_sql('pgr_dijkstraCostMatrix', ',ARRAY[1,2]'); SELECT finish(); ROLLBACK; diff --git a/pgtap/dijkstra/dijkstraNear/no_crash_test.pg b/pgtap/dijkstra/dijkstraNear/no_crash_test.pg index 2425efd0c8..7fffc2d3db 100644 --- a/pgtap/dijkstra/dijkstraNear/no_crash_test.pg +++ b/pgtap/dijkstra/dijkstraNear/no_crash_test.pg @@ -5,7 +5,7 @@ BEGIN; -SELECT CASE WHEN NOT min_version('3.2.0') THEN plan(1) ELSE plan(126) END; +SELECT CASE WHEN min_version('3.2.0') THEN plan(127) ELSE plan(1) END; SET client_min_messages TO WARNING; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); @@ -136,6 +136,7 @@ BEGIN RETURN query SELECT * FROM no_crash_test('pgr_dijkstraNear', params1, subs2); RETURN query SELECT * FROM no_crash_test('pgr_dijkstranear', params2, subs1); RETURN query SELECT * FROM no_crash_test('pgr_dijkstraNear', params2, subs2); + RETURN query SELECT throw_on_empty_edges_sql('pgr_dijkstranear', ',1,ARRAY[5,6]'); END $BODY$ LANGUAGE plpgsql VOLATILE; diff --git a/pgtap/dijkstra/dijkstraNearCost/no_crash_test.pg b/pgtap/dijkstra/dijkstraNearCost/no_crash_test.pg index 6d09df2a07..d4c90f454a 100644 --- a/pgtap/dijkstra/dijkstraNearCost/no_crash_test.pg +++ b/pgtap/dijkstra/dijkstraNearCost/no_crash_test.pg @@ -5,7 +5,7 @@ BEGIN; -SELECT CASE WHEN NOT min_version('3.2.0') THEN plan(1) ELSE plan(126) END; +SELECT CASE WHEN min_version('3.2.0') THEN plan(127) ELSE plan(1) END; SET client_min_messages TO WARNING; UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; @@ -142,11 +142,13 @@ SELECT is_empty('null_comb', 'Should be empty to tests be meaningful'); RETURN query SELECT * FROM no_crash_test('pgr_dijkstranearcost', params1, subs2); RETURN query SELECT * FROM no_crash_test('pgr_dijkstranearcost', params2, subs1); RETURN query SELECT * FROM no_crash_test('pgr_dijkstranearcost', params2, subs2); + RETURN query SELECT throw_on_empty_edges_sql('pgr_dijkstranearcost', ',1,ARRAY[5,6]'); END $BODY$ LANGUAGE plpgsql VOLATILE; SELECT * FROM no_crash(); + SELECT finish(); ROLLBACK; diff --git a/pgtap/metrics/bandwidth/no_crash_test.pg b/pgtap/metrics/bandwidth/no_crash_test.pg index 316d1b805b..77201bbca4 100644 --- a/pgtap/metrics/bandwidth/no_crash_test.pg +++ b/pgtap/metrics/bandwidth/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('4.0.0') THEN plan(4) ELSE plan(1) END; +SELECT CASE WHEN min_version('4.0.0') THEN plan(5) ELSE plan(1) END; PREPARE edges_q AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -38,6 +38,7 @@ BEGIN ]::TEXT[]; RETURN query SELECT * FROM no_crash_test('pgr_bandwidth', params, subs); + RETURN query SELECT throw_on_empty_edges_sql('pgr_bandwidth', ''); END $BODY$ diff --git a/pgtap/ordering/cuthillMckeeOrdering/no_crash_test.pg b/pgtap/ordering/cuthillMckeeOrdering/no_crash_test.pg index 50e9e7a1ee..ba29231ae4 100644 --- a/pgtap/ordering/cuthillMckeeOrdering/no_crash_test.pg +++ b/pgtap/ordering/cuthillMckeeOrdering/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN NOT min_version('3.4.0') THEN plan(1) ELSE plan(7) END; +SELECT CASE WHEN min_version('3.4.0') THEN plan(8) ELSE plan(1) END; PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -48,6 +48,7 @@ BEGIN ]::TEXT[]; RETURN query SELECT * FROM no_crash_test('pgr_cuthillMckeeOrdering', params, subs); + RETURN query SELECT throw_on_empty_edges_sql('pgr_cuthillMckeeOrdering', ''); END $BODY$ diff --git a/pgtap/ordering/kingOrdering/no_crash_test.pg b/pgtap/ordering/kingOrdering/no_crash_test.pg index 67652b8c6c..18b468f83f 100644 --- a/pgtap/ordering/kingOrdering/no_crash_test.pg +++ b/pgtap/ordering/kingOrdering/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN NOT min_version('4.0.0') THEN plan(1) ELSE plan(4) END; +SELECT CASE WHEN min_version('4.0.0') THEN plan(5) ELSE plan(1) END; PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -41,6 +41,7 @@ BEGIN ]::TEXT[]; RETURN query SELECT * FROM no_crash_test('pgr_kingOrdering', params, subs); + RETURN query SELECT throw_on_empty_edges_sql('pgr_kingOrdering', ''); END $BODY$ diff --git a/pgtap/ordering/sloan/no_crash_test.pg b/pgtap/ordering/sloan/no_crash_test.pg index 63ea9a9ad8..0264cf75bd 100644 --- a/pgtap/ordering/sloan/no_crash_test.pg +++ b/pgtap/ordering/sloan/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN NOT min_version('4.0.0') THEN plan(1) ELSE plan(4) END; +SELECT CASE WHEN min_version('4.0.0') THEN plan(5) ELSE plan(1) END; PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -35,7 +35,8 @@ BEGIN params = ARRAY['$$SELECT id, source, target, cost, reverse_cost FROM edges$$']::TEXT[]; subs = ARRAY[ 'NULL' ]::TEXT[]; - RETURN query SELECT * FROM no_crash_test('pgr_sloanOrdering', params, subs); + RETURN query SELECT * FROM no_crash_test('pgr_sloanOrdering', params, subs); + RETURN query SELECT throw_on_empty_edges_sql('pgr_sloanOrdering', ''); END $BODY$ diff --git a/pgtap/ordering/topologicalSort/no_crash_test.pg b/pgtap/ordering/topologicalSort/no_crash_test.pg index bb7fb97771..f63a183aa5 100644 --- a/pgtap/ordering/topologicalSort/no_crash_test.pg +++ b/pgtap/ordering/topologicalSort/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT plan(4); +SELECT plan(5); SELECT has_function('pgr_topologicalsort'); SELECT function_returns('pgr_topologicalsort', ARRAY['text'], 'setof record'); @@ -27,6 +27,7 @@ SELECT lives_ok( )', '4: Documentation says works with no flags'); +SELECT throw_on_empty_edges_sql('pgr_topologicalsort', ''); SELECT * FROM finish(); ROLLBACK; diff --git a/pgtap/withPoints/withPoints/no_crash_test.pg b/pgtap/withPoints/withPoints/no_crash_test.pg index c8e2443766..01e99e0916 100644 --- a/pgtap/withPoints/withPoints/no_crash_test.pg +++ b/pgtap/withPoints/withPoints/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('4.0.0') THEN plan(116) ELSE plan(1) END; +SELECT CASE WHEN min_version('4.0.0') THEN plan(117) ELSE plan(2) END; PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -162,5 +162,7 @@ $BODY$ LANGUAGE plpgsql VOLATILE; SELECT test_function(); +SELECT throw_on_empty_edges_sql('pgr_withPoints', ',$$SELECT pid, edge_id, fraction from pointsOfInterest$$,1,2'); + SELECT finish(); ROLLBACK; diff --git a/pgtap/withPoints/withPointsCost/no_crash_test.pg b/pgtap/withPoints/withPointsCost/no_crash_test.pg index 280af71fc9..c728463ade 100644 --- a/pgtap/withPoints/withPointsCost/no_crash_test.pg +++ b/pgtap/withPoints/withPointsCost/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('4.0.0') THEN plan(122) ELSE plan(1) END; +SELECT CASE WHEN min_version('4.0.0') THEN plan(123) ELSE plan(2) END; PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -175,6 +175,8 @@ END $BODY$ LANGUAGE plpgsql VOLATILE; +SELECT throw_on_empty_edges_sql('pgr_withPointsCost', + ',$$SELECT pid, edge_id, fraction from pointsOfInterest$$,1,2'); SELECT test_function(); SELECT finish(); diff --git a/pgtap/withPoints/withPointsCostMatrix/no_crash_test.pg b/pgtap/withPoints/withPointsCostMatrix/no_crash_test.pg index 16a5864313..5464965e67 100644 --- a/pgtap/withPoints/withPointsCostMatrix/no_crash_test.pg +++ b/pgtap/withPoints/withPointsCostMatrix/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('4.0.0') THEN plan(20) ELSE plan(1) END; +SELECT CASE WHEN min_version('4.0.0') THEN plan(21) ELSE plan(2) END; PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -57,5 +57,8 @@ LANGUAGE plpgsql VOLATILE; SELECT * FROM test_function(); +SELECT throw_on_empty_edges_sql('pgr_withPointsCostMatrix', + ',$$SELECT pid, edge_id, fraction from pointsOfInterest$$,ARRAY[1,2]'); + SELECT finish(); ROLLBACK; diff --git a/tools/testers/no_crash_test.pg b/tools/testers/no_crash_test.pg index b5fe11314d..5d8125174e 100644 --- a/tools/testers/no_crash_test.pg +++ b/tools/testers/no_crash_test.pg @@ -48,3 +48,23 @@ BEGIN END $BODY$ LANGUAGE plpgsql VOLATILE; + +CREATE OR REPLACE FUNCTION throw_on_empty_edges_sql(func TEXT, params TEXT) +RETURNS SETOF TEXT AS +$BODY$ +DECLARE +tquery TEXT; +BEGIN + + tquery := $$SELECT * FROM $$ || $1 || $$ ('' $$ || $2 || ')'; + IF (min_lib_version('4.1.0')) THEN + RETURN query + SELECT * FROM throws_ok( tquery, 'XX000', 'Empty edges SQL', 'throws_ok: ' || tquery); + ELSE + RETURN query + SELECT * FROM skip(1, 'Throw implemented on 4.1.0' || tquery); + END IF; + +END +$BODY$ +LANGUAGE plpgsql VOLATILE; From 2353b3781de55705b641f8af2302b4e469416686 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Tue, 3 Feb 2026 17:24:31 -0600 Subject: [PATCH 5/8] (bdDijkstra) :broom: Remove unused code --- .../drivers/bdDijkstra/bdDijkstra_driver.h | 76 -------- src/bdDijkstra/bdDijkstra_driver.cpp | 180 ------------------ 2 files changed, 256 deletions(-) delete mode 100644 include/drivers/bdDijkstra/bdDijkstra_driver.h delete mode 100644 src/bdDijkstra/bdDijkstra_driver.cpp diff --git a/include/drivers/bdDijkstra/bdDijkstra_driver.h b/include/drivers/bdDijkstra/bdDijkstra_driver.h deleted file mode 100644 index 990cb09587..0000000000 --- a/include/drivers/bdDijkstra/bdDijkstra_driver.h +++ /dev/null @@ -1,76 +0,0 @@ -/*PGR-GNU***************************************************************** -File: bdDijkstra_driver.h - -Generated with Template by: -Copyright (c) 2007-2026 pgRouting developers -Mail: project@pgrouting.org - -Function's developer: -Copyright (c) 2015 Celia Virginia Vergara Castillo -Mail: vicky at erosion.dev - ------- - -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*/ - -#ifndef INCLUDE_DRIVERS_BDDIJKSTRA_BDDIJKSTRA_DRIVER_H_ -#define INCLUDE_DRIVERS_BDDIJKSTRA_BDDIJKSTRA_DRIVER_H_ -#pragma once - - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#ifdef __cplusplus -} -#endif - -#include "cpp_common/undefPostgresDefine.hpp" - -#ifdef __cplusplus -# include -# include -using Path_rt = struct Path_rt; -#else -# include -# include -typedef struct Path_rt Path_rt; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -void pgr_do_bdDijkstra( - const char*, - const char*, - ArrayType*, ArrayType*, - - bool, bool, - - Path_rt**, size_t*, - char**, char**, char**); - -#ifdef __cplusplus -} -#endif - -#endif // INCLUDE_DRIVERS_BDDIJKSTRA_BDDIJKSTRA_DRIVER_H_ diff --git a/src/bdDijkstra/bdDijkstra_driver.cpp b/src/bdDijkstra/bdDijkstra_driver.cpp deleted file mode 100644 index 8b86910469..0000000000 --- a/src/bdDijkstra/bdDijkstra_driver.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/*PGR-GNU***************************************************************** -File: bdDijkstra_driver.cpp - -Generated with Template by: -Copyright (c) 2015-2026 pgRouting developers -Mail: project@pgrouting.org - -Function's developer: -Copyright (c) 2016 Celia Virginia Vergara Castillo -Mail: vicky at erosion.dev - ------- - -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*/ - -#include "drivers/bdDijkstra/bdDijkstra_driver.h" - -#include -#include -#include -#include -#include -#include -#include - - -#include "cpp_common/combinations.hpp" -#include "cpp_common/pgdata_getters.hpp" -#include "cpp_common/to_postgres.hpp" -#include "cpp_common/assert.hpp" -#include "cpp_common/base_graph.hpp" -#include "bdDijkstra/bdDijkstra.hpp" - -#include "c_types/ii_t_rt.h" - - - -namespace { - -template < class G > -std::deque -pgr_bdDijkstra( - G &graph, - const std::map> &combinations, - bool only_cost) { - using pgrouting::Path; - - pgrouting::bidirectional::Pgr_bdDijkstra fn_bdDijkstra(graph); - std::deque paths; - - for (const auto &comb : combinations) { - auto source = comb.first; - if (!graph.has_vertex(source)) continue; - - for (const auto &target : comb.second) { - if (!graph.has_vertex(target)) continue; - fn_bdDijkstra.clear(); - - paths.push_back(fn_bdDijkstra.pgr_bdDijkstra(graph.get_V(source), graph.get_V(target), only_cost)); - } - } - return paths; -} - -} // namespace - -void -pgr_do_bdDijkstra( - const char *edges_sql, - const char *combinations_sql, - ArrayType *starts, - ArrayType *ends, - - bool directed, - bool only_cost, - - Path_rt **return_tuples, - size_t *return_count, - char **log_msg, - char **notice_msg, - char **err_msg) { - using pgrouting::Path; - using pgrouting::to_pg_msg; - using pgrouting::pgr_free; - using pgrouting::utilities::get_combinations; - - std::ostringstream log; - std::ostringstream err; - std::ostringstream notice; - const char *hint = nullptr; - - try { - pgassert(!(*log_msg)); - pgassert(!(*notice_msg)); - pgassert(!(*err_msg)); - pgassert(!(*return_tuples)); - pgassert(*return_count == 0); - - using pgrouting::to_postgres::get_tuples; - - hint = combinations_sql; - auto combinations = get_combinations(combinations_sql, starts, ends, true); - hint = nullptr; - - if (combinations.empty() && combinations_sql) { - *notice_msg = to_pg_msg("No (source, target) pairs found"); - *log_msg = to_pg_msg(combinations_sql); - return; - } - - - - hint = edges_sql; - auto edges = pgrouting::pgget::get_edges(std::string(edges_sql), true, false); - - if (edges.empty()) { - *notice_msg = to_pg_msg("No edges found"); - *log_msg = hint? to_pg_msg(hint) : to_pg_msg(log); - return; - } - hint = nullptr; - - std::deque paths; - - if (directed) { - pgrouting::DirectedGraph graph; - graph.insert_edges(edges); - paths = pgr_bdDijkstra(graph, combinations, only_cost); - } else { - pgrouting::UndirectedGraph graph; - graph.insert_edges(edges); - paths = pgr_bdDijkstra(graph, combinations, only_cost); - } - - (*return_count) = get_tuples(paths, (*return_tuples)); - - if (*return_count == 0) { - *log_msg = to_pg_msg("No paths found"); - return; - } - - *log_msg = to_pg_msg(log); - *notice_msg = to_pg_msg(notice); - } catch (AssertFailedException &except) { - (*return_tuples) = pgr_free(*return_tuples); - (*return_count) = 0; - err << except.what(); - *err_msg = to_pg_msg(err); - *log_msg = to_pg_msg(log); - } catch (const std::string &ex) { - *err_msg = to_pg_msg(ex); - *log_msg = hint? to_pg_msg(hint) : to_pg_msg(log); - } catch (std::exception &except) { - (*return_tuples) = pgr_free(*return_tuples); - (*return_count) = 0; - err << except.what(); - *err_msg = to_pg_msg(err); - *log_msg = to_pg_msg(log); - } catch(...) { - (*return_tuples) = pgr_free(*return_tuples); - (*return_count) = 0; - err << "Caught unknown exception!"; - *err_msg = to_pg_msg(err); - *log_msg = to_pg_msg(log); - } -} From b9ea2c2f7110bf0121720669a6cf0f80bcceebe3 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Tue, 3 Feb 2026 16:58:22 -0600 Subject: [PATCH 6/8] (bdDijkstra) using the shortestPath process & driver --- include/bdDijkstra/bdDijkstra.hpp | 32 ++++++++ include/c_common/enums.h | 2 +- pgtap/bdDijkstra/bdDijkstra/no_crash_test.pg | 4 +- .../bdDijkstraCost/no_crash_test.pg | 4 +- .../bdDijkstraCostMatrix/no_crash_test.pg | 3 +- src/bdDijkstra/CMakeLists.txt | 3 +- src/bdDijkstra/bdDijkstra.c | 77 +++++++------------ src/cpp_common/utilities.cpp | 7 ++ src/dijkstra/shortestPath_driver.cpp | 38 +++++++-- src/dijkstra/shortestPath_process.cpp | 17 +++- 10 files changed, 121 insertions(+), 66 deletions(-) diff --git a/include/bdDijkstra/bdDijkstra.hpp b/include/bdDijkstra/bdDijkstra.hpp index 817f0ba69c..96e975c090 100644 --- a/include/bdDijkstra/bdDijkstra.hpp +++ b/include/bdDijkstra/bdDijkstra.hpp @@ -35,6 +35,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include +#include +#include +#include #include "cpp_common/bidirectional.hpp" @@ -141,6 +144,35 @@ class Pgr_bdDijkstra : public Pgr_bidirectional { }; } // namespace bidirectional + +namespace algorithms { + +template +std::deque +bdDijkstra( + G &graph, + const std::map> &combinations, + bool only_cost) { + using pgrouting::Path; + + pgrouting::bidirectional::Pgr_bdDijkstra fn_bdDijkstra(graph); + std::deque paths; + + for (const auto &comb : combinations) { + auto source = comb.first; + if (!graph.has_vertex(source)) continue; + + for (const auto &target : comb.second) { + if (!graph.has_vertex(target)) continue; + fn_bdDijkstra.clear(); + + paths.push_back(fn_bdDijkstra.pgr_bdDijkstra(graph.get_V(source), graph.get_V(target), only_cost)); + } + } + return paths; +} + +} // namespace algorithms } // namespace pgrouting #endif // INCLUDE_BDDIJKSTRA_BDDIJKSTRA_HPP_ diff --git a/include/c_common/enums.h b/include/c_common/enums.h index fcc3ac0579..f67da0a884 100644 --- a/include/c_common/enums.h +++ b/include/c_common/enums.h @@ -31,7 +31,7 @@ enum Which { /** directed graph + results: vertex id */ TOPOSORT = 11, /** shortest_paths */ - DIJKSTRA = 21, WITHPOINTS, OLD_WITHPOINTS, + DIJKSTRA = 21, WITHPOINTS, OLD_WITHPOINTS, BDDIJKSTRA, /** allpairs **/ FLOYD = 31, JOHNSON, /** metrics **/ diff --git a/pgtap/bdDijkstra/bdDijkstra/no_crash_test.pg b/pgtap/bdDijkstra/bdDijkstra/no_crash_test.pg index 7f1a79e73c..985d40d333 100644 --- a/pgtap/bdDijkstra/bdDijkstra/no_crash_test.pg +++ b/pgtap/bdDijkstra/bdDijkstra/no_crash_test.pg @@ -7,9 +7,11 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('3.2.0') THEN plan(97) ELSE plan(84) END; +SELECT CASE WHEN min_version('3.2.0') THEN plan(98) ELSE plan(85) END; SELECT general_no_crash('pgr_bdDijkstra'); +SELECT throw_on_empty_edges_sql('pgr_bdDijkstra', ',1,2'); + SELECT finish(); ROLLBACK; diff --git a/pgtap/bdDijkstra/bdDijkstraCost/no_crash_test.pg b/pgtap/bdDijkstra/bdDijkstraCost/no_crash_test.pg index ae791f8189..8e6c728fc7 100644 --- a/pgtap/bdDijkstra/bdDijkstraCost/no_crash_test.pg +++ b/pgtap/bdDijkstra/bdDijkstraCost/no_crash_test.pg @@ -7,10 +7,12 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('3.2.0') THEN plan(97) ELSE plan(84) END; +SELECT CASE WHEN min_version('3.2.0') THEN plan(98) ELSE plan(85) END; SELECT general_no_crash('pgr_bdDijkstraCost'); +SELECT throw_on_empty_edges_sql('pgr_bdDijkstraCost', ',1,2'); + SELECT finish(); ROLLBACK; diff --git a/pgtap/bdDijkstra/bdDijkstraCostMatrix/no_crash_test.pg b/pgtap/bdDijkstra/bdDijkstraCostMatrix/no_crash_test.pg index 5bbe590fff..8be85d012a 100644 --- a/pgtap/bdDijkstra/bdDijkstraCostMatrix/no_crash_test.pg +++ b/pgtap/bdDijkstra/bdDijkstraCostMatrix/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT plan(14); +SELECT plan(15); PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -45,6 +45,7 @@ LANGUAGE plpgsql VOLATILE; SELECT * FROM test_function(); +SELECT throw_on_empty_edges_sql('pgr_bdDijkstraCostMatrix', ',ARRAY[1,2]'); SELECT finish(); ROLLBACK; diff --git a/src/bdDijkstra/CMakeLists.txt b/src/bdDijkstra/CMakeLists.txt index 0725541719..9b5bb57a47 100644 --- a/src/bdDijkstra/CMakeLists.txt +++ b/src/bdDijkstra/CMakeLists.txt @@ -3,5 +3,4 @@ # License: GPL-2 See https://github.com/pgRouting/pgrouting/blob/main/LICENSE ADD_LIBRARY(bdDijkstra OBJECT bdDijkstra.c - bdDijkstra_driver.cpp - ) +) diff --git a/src/bdDijkstra/bdDijkstra.c b/src/bdDijkstra/bdDijkstra.c index 678e9a7c4f..459208af87 100644 --- a/src/bdDijkstra/bdDijkstra.c +++ b/src/bdDijkstra/bdDijkstra.c @@ -35,55 +35,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_common/debug_macro.h" #include "c_common/e_report.h" #include "c_common/time_msg.h" -#include "drivers/bdDijkstra/bdDijkstra_driver.h" +#include "process/shortestPath_process.h" PGDLLEXPORT Datum _pgr_bddijkstra(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(_pgr_bddijkstra); -static void -process( - char *edges_sql, - char *combinations_sql, - ArrayType *starts, - ArrayType *ends, - - bool directed, - bool only_cost, - Path_rt **result_tuples, - size_t *result_count) { - pgr_SPI_connect(); - char* log_msg = NULL; - char* notice_msg = NULL; - char* err_msg = NULL; - - clock_t start_t = clock(); - pgr_do_bdDijkstra( - edges_sql, - combinations_sql, - starts, ends, - - directed, - only_cost, - - result_tuples, - result_count, - &log_msg, - ¬ice_msg, - &err_msg); - time_msg(" processing pgr_bdDijkstra", start_t, clock()); - - - if (err_msg && (*result_tuples)) { - pfree(*result_tuples); - (*result_tuples) = NULL; - (*result_count) = 0; - } - - pgr_global_report(&log_msg, ¬ice_msg, &err_msg); - - pgr_SPI_finish(); -} - PGDLLEXPORT Datum _pgr_bddijkstra(PG_FUNCTION_ARGS) { FuncCallContext *funcctx; @@ -100,27 +56,48 @@ PGDLLEXPORT Datum _pgr_bddijkstra(PG_FUNCTION_ARGS) { /* * many to many */ - process( + pgr_process_shortestPath( text_to_cstring(PG_GETARG_TEXT_P(0)), NULL, + NULL, + PG_GETARG_ARRAYTYPE_P(1), PG_GETARG_ARRAYTYPE_P(2), + PG_GETARG_BOOL(3), PG_GETARG_BOOL(4), + true, + + 0, + true, + ' ', + true, + + BDDIJKSTRA, &result_tuples, &result_count); } else if (PG_NARGS() == 4) { /* - * combinations + * Combinations */ - process( + pgr_process_shortestPath( text_to_cstring(PG_GETARG_TEXT_P(0)), - text_to_cstring(PG_GETARG_TEXT_P(1)), - NULL, NULL, + text_to_cstring(PG_GETARG_TEXT_P(1)), + + NULL, NULL, + PG_GETARG_BOOL(2), PG_GETARG_BOOL(3), + true, + + 0, + true, + ' ', + true, + + BDDIJKSTRA, &result_tuples, &result_count); } diff --git a/src/cpp_common/utilities.cpp b/src/cpp_common/utilities.cpp index 5916455e02..d9122d9cb0 100644 --- a/src/cpp_common/utilities.cpp +++ b/src/cpp_common/utilities.cpp @@ -73,6 +73,12 @@ get_name(Which which, bool is_only_cost, bool is_near, bool is_matrix) { suffix = std::string(is_near? "Near" : "") + (is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); break; } + case BDDIJKSTRA : + { + base = "pgr_bdDijkstra"; + suffix = std::string(is_near? "Near" : "") + (is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); + break; + } case OLD_WITHPOINTS: case WITHPOINTS: { @@ -93,6 +99,7 @@ estimate_drivingSide(char driving_side, Which which) { d_side = ' '; } switch (which) { + case BDDIJKSTRA: case DIJKSTRA: { return ' '; diff --git a/src/dijkstra/shortestPath_driver.cpp b/src/dijkstra/shortestPath_driver.cpp index 57a62216f2..e46dad8d8b 100644 --- a/src/dijkstra/shortestPath_driver.cpp +++ b/src/dijkstra/shortestPath_driver.cpp @@ -51,11 +51,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/to_postgres.hpp" #include "dijkstra/dijkstra.hpp" +#include "bdDijkstra/bdDijkstra.hpp" #include "withPoints/withPoints.hpp" namespace { - void post_process(std::deque &paths, bool only_cost, bool normal, size_t n_goals, bool global) { using pgrouting::Path; @@ -150,6 +150,7 @@ do_shortestPath( using pgrouting::DirectedGraph; using pgrouting::algorithms::dijkstra; + using pgrouting::algorithms::bdDijkstra; hint = combinations_sql; auto combinations = get_combinations(combinations_sql, starts, ends, normal, is_matrix); @@ -221,14 +222,39 @@ do_shortestPath( std::deque paths; if (directed) { - graph.insert_edges(edges); - paths = dijkstra(digraph, combinations, only_cost, n); + digraph.insert_edges(edges); + switch (which) { + case WITHPOINTS: + case OLD_WITHPOINTS: + case DIJKSTRA: + paths = dijkstra(digraph, combinations, only_cost, n); + post_process(paths, only_cost, normal, n, global); + break; + case BDDIJKSTRA: + paths = bdDijkstra(digraph, combinations, only_cost); + break; + default: + err << "INTERNAL: wrong function call: " << which; + return; + } } else { - graph.insert_edges(edges); - paths = dijkstra(undigraph, combinations, only_cost, n); + undigraph.insert_edges(edges); + switch (which) { + case WITHPOINTS: + case OLD_WITHPOINTS: + case DIJKSTRA: + paths = dijkstra(undigraph, combinations, only_cost, n); + post_process(paths, only_cost, normal, n, global); + break; + case BDDIJKSTRA: + paths = bdDijkstra(undigraph, combinations, only_cost); + break; + default: + err << "INTERNAL: wrong function call: " << which; + return; + } } - post_process(paths, only_cost, normal, n, global); if (!details) { for (auto &path : paths) path = pg_graph.eliminate_details(path); diff --git a/src/dijkstra/shortestPath_process.cpp b/src/dijkstra/shortestPath_process.cpp index 10e9814cba..56f22da79f 100644 --- a/src/dijkstra/shortestPath_process.cpp +++ b/src/dijkstra/shortestPath_process.cpp @@ -53,11 +53,20 @@ extern "C" { void pgr_process_shortestPath( - const char *edges_sql, const char *points_sql, const char *combinations_sql, + const char *edges_sql, + const char *points_sql, + const char *combinations_sql, + ArrayType *starts, ArrayType *ends, - bool directed, bool only_cost, bool normal, - int64_t n_goals, bool global, - char driving_side, bool details, + + bool directed, + bool only_cost, + bool normal, + + int64_t n_goals, + bool global, + char driving_side, + bool details, enum Which which, Path_rt **result_tuples, size_t *result_count) { pgassert(edges_sql); From db58b853ef4e837a85fe1da44c3902a059117e7d Mon Sep 17 00:00:00 2001 From: cvvergara Date: Thu, 5 Feb 2026 12:10:45 -0600 Subject: [PATCH 7/8] Updating news and release notes --- NEWS.md | 2 ++ doc/src/release_notes.rst | 2 ++ locale/en/LC_MESSAGES/pgrouting_doc_strings.po | 12 +++++++++++- locale/pot/pgrouting_doc_strings.pot | 8 +++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 83c5d3688b..f83a9d0acb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,6 +15,8 @@ To see all issues & pull requests closed by this release see the **Code enhancements** * [#3049](https://github.com/pgRouting/pgrouting/issues/3049): Use enumeration on drivers and process. +* [#3054](https://github.com/pgRouting/pgrouting/issues/3054): Change error message when edges_sql is empty +* [#3055](https://github.com/pgRouting/pgrouting/issues/3055): bdDijkstra: use the shortest_path process and driver ## pgRouting 4.0 diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index 55d6068e9c..b7b7e69c18 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -40,6 +40,8 @@ To see all issues & pull requests closed by this release see the .. rubric:: Code enhancements * :issue:`3049`: Use enumeration on drivers and process. +* :issue:`3054`: Change error message when edges_sql is empty +* :issue:`3055`: bdDijkstra: use the shortest_path process and driver pgRouting 4.0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po index 8da0ce13aa..6ebbf3bb27 100644 --- a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po +++ b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v4.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-01 00:30+0000\n" +"POT-Creation-Date: 2026-02-05 18:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3931,6 +3931,16 @@ msgid "" "enumeration on drivers and process." msgstr "" +msgid "" +"`#3054 `__: Change error " +"message when edges_sql is empty" +msgstr "" + +msgid "" +"`#3055 `__: bdDijkstra: " +"use the shortest_path process and driver" +msgstr "" + msgid "All releases" msgstr "" diff --git a/locale/pot/pgrouting_doc_strings.pot b/locale/pot/pgrouting_doc_strings.pot index c87ed6f9b5..17df7879e9 100644 --- a/locale/pot/pgrouting_doc_strings.pot +++ b/locale/pot/pgrouting_doc_strings.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v4.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-01 00:30+0000\n" +"POT-Creation-Date: 2026-02-05 18:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3532,6 +3532,12 @@ msgstr "" msgid "`#3049 `__: Use enumeration on drivers and process." msgstr "" +msgid "`#3054 `__: Change error message when edges_sql is empty" +msgstr "" + +msgid "`#3055 `__: bdDijkstra: use the shortest_path process and driver" +msgstr "" + msgid "All releases" msgstr "" From c240deb3b9f444e7d69670ae8483cc54a983a13e Mon Sep 17 00:00:00 2001 From: cvvergara Date: Thu, 5 Feb 2026 15:12:39 -0600 Subject: [PATCH 8/8] Fixing pgtap test for johnson --- pgtap/allpairs/johnson/no_crash_test.pg | 2 +- src/cpp_common/utilities.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pgtap/allpairs/johnson/no_crash_test.pg b/pgtap/allpairs/johnson/no_crash_test.pg index 980be540cf..8a03382a8f 100644 --- a/pgtap/allpairs/johnson/no_crash_test.pg +++ b/pgtap/allpairs/johnson/no_crash_test.pg @@ -33,7 +33,7 @@ LANGUAGE plpgsql VOLATILE; SELECT * FROM test_function(); -SELECT throw_on_empty_edges_sql('pgr_floydWarshall', ''); +SELECT throw_on_empty_edges_sql('pgr_johnson', ''); SELECT finish(); ROLLBACK; diff --git a/src/cpp_common/utilities.cpp b/src/cpp_common/utilities.cpp index d9122d9cb0..03ec8c608c 100644 --- a/src/cpp_common/utilities.cpp +++ b/src/cpp_common/utilities.cpp @@ -74,11 +74,9 @@ get_name(Which which, bool is_only_cost, bool is_near, bool is_matrix) { break; } case BDDIJKSTRA : - { - base = "pgr_bdDijkstra"; - suffix = std::string(is_near? "Near" : "") + (is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); - break; - } + base = "pgr_bdDijkstra"; + suffix = std::string(is_near? "Near" : "") + (is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); + break; case OLD_WITHPOINTS: case WITHPOINTS: {