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

Not using wildcard on sql dev #2557

Closed
Closed
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
14 changes: 5 additions & 9 deletions pgtap/ksp/withPointsKSP/inner_query.pg
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,12 @@ BEGIN
RETURN QUERY SELECT style_dijkstra('pgr_withPointsKSP(', ', $$SELECT * from pointsOfInterest$$, $$SELECT * FROM combinations_table$$, 2, $$r$$, true)');
RETURN QUERY SELECT innerquery_points('pgr_withPointsKSP($$SELECT * FROM edge_table$$,', ', $$SELECT * FROM combinations_table$$, 2, $$r$$, true)');
RETURN QUERY SELECT innerquery_combinations('pgr_withPointsKSP($$SELECT * FROM edge_table$$, $$SELECT * from pointsOfInterest$$,',', 2, $$r$$, true)');
/* TODO Remove on v4*/
-- ONE TO ONE
RETURN QUERY SELECT style_dijkstra('pgr_withPointsKSP(', ', $$SELECT * from pointsOfInterest$$, 2, 3, 2, true)');
RETURN QUERY SELECT innerquery_points('pgr_withPointsKSP($$SELECT * FROM edge_table$$,', ', 2, 3, 2, true)');
ELSE
/* TODO Remove on v4*/
-- ONE TO ONE
RETURN QUERY SELECT style_dijkstra('pgr_withPointsKSP(', ', $$SELECT * from pointsOfInterest$$, 2, 3, 2, true)');
RETURN QUERY SELECT innerquery_points('pgr_withPointsKSP($$SELECT * FROM edge_table$$,', ', 2, 3, 2, true)');
END IF;
/* TODO Remove on v4*/
SET client_min_messages TO ERROR;
-- ONE TO ONE
RETURN QUERY SELECT style_dijkstra('pgr_withPointsKSP(', ', $$SELECT * from pointsOfInterest$$, 2, 3, 2, true)');
RETURN QUERY SELECT innerquery_points('pgr_withPointsKSP($$SELECT * FROM edge_table$$,', ', 2, 3, 2, true)');
END
$BODY$
LANGUAGE plpgsql VOLATILE;
Expand Down
1 change: 1 addition & 0 deletions pgtap/ksp/withPointsKSP/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ IF min_version('3.6.0') THEN
END IF;

/* TODO remove tests on v4*/
SET client_min_messages TO ERROR;
-- 1 to distance
params = ARRAY[
'$$SELECT id, source, target, cost, reverse_cost FROM edge_table$$',
Expand Down
2 changes: 1 addition & 1 deletion sql/allpairs/floydWarshall.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CREATE FUNCTION pgr_floydWarshall(
RETURNS SETOF RECORD AS
$BODY$

SELECT *
SELECT start_vid, end_vid, agg_cost
FROM _pgr_floydWarshall(_pgr_get_statement($1), $2);

$BODY$
Expand Down
2 changes: 1 addition & 1 deletion sql/allpairs/johnson.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CREATE FUNCTION pgr_johnson(
RETURNS SETOF RECORD AS
$BODY$

SELECT *
SELECT start_vid, end_vid, agg_cost
FROM _pgr_johnson(_pgr_get_statement($1), $2);

$BODY$
Expand Down
10 changes: 5 additions & 5 deletions sql/astar/astar.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ CREATE FUNCTION pgr_aStar(

RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_aStar(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], ARRAY[$3]::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT);
$BODY$
LANGUAGE sql VOLATILE STRICT
Expand Down Expand Up @@ -85,7 +85,7 @@ CREATE FUNCTION pgr_aStar(

RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_aStar(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], $3::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT);
$BODY$
LANGUAGE sql VOLATILE STRICT
Expand Down Expand Up @@ -115,7 +115,7 @@ CREATE FUNCTION pgr_aStar(

RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_aStar(_pgr_get_statement($1), $2::BIGINT[], ARRAY[$3]::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, normal:=false);
$BODY$
LANGUAGE sql VOLATILE STRICT
Expand Down Expand Up @@ -145,7 +145,7 @@ CREATE FUNCTION pgr_aStar(

RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_aStar(_pgr_get_statement($1), $2::BIGINT[], $3::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT);
$BODY$
LANGUAGE sql VOLATILE STRICT
Expand Down Expand Up @@ -174,7 +174,7 @@ CREATE FUNCTION pgr_aStar(

RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_aStar(_pgr_get_statement($1), _pgr_get_statement($2), $3, $4, $5::FLOAT, $6::FLOAT);
$BODY$
LANGUAGE sql VOLATILE STRICT
Expand Down
10 changes: 5 additions & 5 deletions sql/bdAstar/bdAstar.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ CREATE FUNCTION pgr_bdAstar(
OUT agg_cost FLOAT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_bdAstar(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], ARRAY[$3]::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT,
false);
$BODY$
Expand Down Expand Up @@ -80,7 +80,7 @@ CREATE FUNCTION pgr_bdAstar(
OUT agg_cost FLOAT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_bdAstar(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], $3::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, false);
$BODY$
LANGUAGE sql VOLATILE STRICT
Expand Down Expand Up @@ -109,7 +109,7 @@ CREATE FUNCTION pgr_bdAstar(
OUT agg_cost FLOAT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_bdAstar(_pgr_get_statement($1), $2::BIGINT[], ARRAY[$3]::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, false);
$BODY$
LANGUAGE sql VOLATILE STRICT
Expand Down Expand Up @@ -138,7 +138,7 @@ CREATE FUNCTION pgr_bdAstar(
OUT agg_cost FLOAT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_bdAstar(_pgr_get_statement($1), $2::BIGINT[], $3::BIGINT[], $4, $5, $6::FLOAT, $7::FLOAT, false);
$BODY$
LANGUAGE sql VOLATILE STRICT
Expand Down Expand Up @@ -166,7 +166,7 @@ CREATE FUNCTION pgr_bdAstar(
OUT agg_cost FLOAT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_bdAstar(_pgr_get_statement($1), _pgr_get_statement($2), $3, $4, $5::FLOAT, $6::FLOAT, false);
$BODY$
LANGUAGE sql VOLATILE STRICT
Expand Down
20 changes: 10 additions & 10 deletions sql/bdDijkstra/bdDijkstra.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ CREATE FUNCTION pgr_bdDijkstra(
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_bdDijkstra(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], ARRAY[$3]::BIGINT[], $4, false) AS a;
SELECT seq, path_seq, node, edge, cost, agg_cost
FROM _pgr_bdDijkstra(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], ARRAY[$3]::BIGINT[], $4, false);
$BODY$
LANGUAGE sql VOLATILE STRICT
COST 100
Expand All @@ -73,8 +73,8 @@ CREATE FUNCTION pgr_bdDijkstra(
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_bdDijkstra(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], $3::BIGINT[], $4, false) as a;
SELECT seq, path_seq, end_vid, node, edge, cost, agg_cost
FROM _pgr_bdDijkstra(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], $3::BIGINT[], $4, false);
$BODY$
LANGUAGE sql VOLATILE STRICT
COST 100
Expand All @@ -99,8 +99,8 @@ CREATE FUNCTION pgr_bdDijkstra(
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_bdDijkstra(_pgr_get_statement($1), $2::BIGINT[], ARRAY[$3]::BIGINT[], $4, false) as a;
SELECT seq, path_seq, start_vid, node, edge, cost, agg_cost
FROM _pgr_bdDijkstra(_pgr_get_statement($1), $2::BIGINT[], ARRAY[$3]::BIGINT[], $4, false);
$BODY$
LANGUAGE sql VOLATILE STRICT
COST 100
Expand All @@ -127,8 +127,8 @@ CREATE FUNCTION pgr_bdDijkstra(
OUT agg_cost FLOAT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
FROM _pgr_bdDijkstra(_pgr_get_statement($1), $2::BIGINT[], $3::BIGINT[], directed, false) as a;
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_bdDijkstra(_pgr_get_statement($1), $2::BIGINT[], $3::BIGINT[], directed, false);
$BODY$
LANGUAGE SQL VOLATILE STRICT
COST 100
Expand All @@ -153,8 +153,8 @@ CREATE FUNCTION pgr_bdDijkstra(
OUT agg_cost FLOAT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
FROM _pgr_bdDijkstra(_pgr_get_statement($1), _pgr_get_statement($2), directed, false) as a;
SELECT seq, path_seq, start_vid, end_vid, node, edge, cost, agg_cost
FROM _pgr_bdDijkstra(_pgr_get_statement($1), _pgr_get_statement($2), directed, false);
$BODY$
LANGUAGE SQL VOLATILE STRICT
COST 100
Expand Down
8 changes: 4 additions & 4 deletions sql/breadthFirstSearch/breadthFirstSearch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ BEGIN


RETURN QUERY
SELECT *
SELECT a.seq, a.depth, a.start_vid, a.node, a.edge, a.cost, a.agg_cost
FROM _pgr_breadthFirstSearch(_pgr_get_statement($1), ARRAY[$2]::BIGINT[], max_depth, directed) AS a;
END;
$BODY$
Expand Down Expand Up @@ -92,7 +92,7 @@ BEGIN


RETURN QUERY
SELECT *
SELECT a.seq, a.depth, a.start_vid, a.node, a.edge, a.cost, a.agg_cost
FROM _pgr_breadthFirstSearch(_pgr_get_statement($1), $2::BIGINT[], max_depth, directed) AS a;
END;
$BODY$
Expand All @@ -107,7 +107,7 @@ IS 'pgr_breadthFirstSearch(One to Depth)
- Parameters:
- edges SQL with columns: id, source, target, cost [,reverse_cost]
- From vertex identifier
- Optional Parameters:
- Optional Parameters:
- Maximum Depth := 9223372036854775807
- directed := true
- Documentation:
Expand All @@ -125,4 +125,4 @@ IS 'pgr_breadthFirstSearch(Many to Depth)
- directed := true
- Documentation:
- ${PROJECT_DOC_LINK}/pgr_breadthFirstSearch.html
';
';
2 changes: 1 addition & 1 deletion sql/chinese/pgr_chinesePostman.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CREATE FUNCTION pgr_chinesePostman(

RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, node, edge, cost, agg_cost
FROM _pgr_chinesePostman(_pgr_get_statement($1), only_cost := false);
$BODY$
LANGUAGE SQL VOLATILE STRICT;
Expand Down
4 changes: 2 additions & 2 deletions sql/circuits/hawickCircuits.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ RETURNS SETOF RECORD AS
$BODY$
BEGIN
RETURN QUERY
SELECT *
FROM _pgr_hawickCircuits(_pgr_get_statement($1));
SELECT a.seq, a.path_id, a.path_seq, a.start_vid, a.end_vid, a.node, a.edge, a.cost, a.agg_cost
FROM _pgr_hawickCircuits(_pgr_get_statement($1)) AS a;
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT;
Expand Down
2 changes: 1 addition & 1 deletion sql/coloring/bipartite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RETURNS SETOF RECORD AS
$BODY$
BEGIN
RETURN QUERY
SELECT *
SELECT node, color
FROM _pgr_bipartite(_pgr_get_statement($1));
END;
$BODY$
Expand Down
4 changes: 2 additions & 2 deletions sql/coloring/edgeColoring.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ RETURNS SETOF RECORD AS
$BODY$
BEGIN
RETURN QUERY
SELECT *
FROM _pgr_edgeColoring(_pgr_get_statement($1));
SELECT a.edge_id, a.color_id
FROM _pgr_edgeColoring(_pgr_get_statement($1)) AS a;
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT;
Expand Down
4 changes: 2 additions & 2 deletions sql/coloring/sequentialVertexColoring.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ RETURNS SETOF RECORD AS
$BODY$
BEGIN
RETURN QUERY
SELECT *
FROM _pgr_sequentialVertexColoring(_pgr_get_statement($1));
SELECT a.vertex_id, a.color_id
FROM _pgr_sequentialVertexColoring(_pgr_get_statement($1)) AS a;
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT;
Expand Down
2 changes: 1 addition & 1 deletion sql/common/_checkcolumn.sql
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ LANGUAGE plpgsql VOLATILE STRICT;

-- COMMENTS
COMMENT ON FUNCTION _pgr_checkColumn(TEXT, TEXT, TEXT, BOOLEAN, BOOLEAN)
IS '_pgr_checkColumn is an internal function';
IS 'pgRouting internal function';
2 changes: 1 addition & 1 deletion sql/common/_checkquery.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ LANGUAGE plpgsql VOLATILE STRICT;

-- COMMENTS
COMMENT ON FUNCTION _pgr_checkquery(TEXT)
IS '_pgr_checkquery is an internal function';
IS 'pgRouting internal function';
12 changes: 6 additions & 6 deletions sql/common/pgrouting_utilities.sql
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ DECLARE
naming record;
err boolean;
BEGIN
select * into naming from _pgr_getTableName(tab,reportErrs, fnName) ;
select a.sname, a.tname into naming from _pgr_getTableName(tab,reportErrs, fnName) AS a;
sname=naming.sname;
tname=naming.tname;

select * into cname from _pgr_getColumnName(sname,tname,col,reportErrs, fnName);
select _pgr_getColumnName into cname from _pgr_getColumnName(sname,tname,col,reportErrs, fnName);
RETURN cname;
END;

Expand Down Expand Up @@ -239,7 +239,7 @@ $BODY$
DECLARE
cname text;
BEGIN
select * from _pgr_getColumnName(tab,col,0, '_pgr_isColumnInTable') into cname;
select _pgr_getColumnName from _pgr_getColumnName(tab,col,0, '_pgr_isColumnInTable') into cname;
return cname is not null;
END;
$BODY$
Expand Down Expand Up @@ -342,17 +342,17 @@ DECLARE
pkey text;
value boolean;
BEGIN
SELECT * into naming FROM _pgr_getTableName(tab, 0, fnName);
SELECT a.sname, a.tname into naming FROM _pgr_getTableName(tab, 0, fnName) AS a;
sname=naming.sname;
tname=naming.tname;
IF sname IS NULL OR tname IS NULL THEN
RETURN FALSE;
END IF;
SELECT * into cname from _pgr_getColumnName(sname, tname, col, 0, fnName) ;
SELECT _pgr_getColumnName into cname from _pgr_getColumnName(sname, tname, col, 0, fnName) ;
IF cname IS NULL THEN
RETURN FALSE;
END IF;
select * into value from _pgr_isColumnIndexed(sname, tname, cname, reportErrs, fnName);
select _pgr_isColumnIndexed into value from _pgr_isColumnIndexed(sname, tname, cname, reportErrs, fnName);
return value;
END
$BODY$
Expand Down
4 changes: 2 additions & 2 deletions sql/common/utilities_pgr.sql
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ BEGIN
select * into naming from _pgr_getTableName(tab,reportErrs, fnName) ;
sname=naming.sname;
tname=naming.tname;
select * into cname from _pgr_getColumnName(tab,col,reportErrs, fnName) ;
select * into ctype from _pgr_getColumnType(sname,tname,cname,reportErrs, fnName);
select _pgr_getColumnName into cname from _pgr_getColumnName(tab,col,reportErrs, fnName) ;
select _pgr_getColumnType into ctype from _pgr_getColumnType(sname,tname,cname,reportErrs, fnName);
RETURN ctype;
END;

Expand Down
4 changes: 2 additions & 2 deletions sql/components/biconnectedComponents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ CREATE FUNCTION pgr_biconnectedComponents(
OUT edge BIGINT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
FROM _pgr_biconnectedComponents(_pgr_get_statement($1));
SELECT seq, component, edge
FROM _pgr_biconnectedComponents(_pgr_get_statement($1)) ;
$BODY$
LANGUAGE SQL VOLATILE STRICT;

Expand Down
2 changes: 1 addition & 1 deletion sql/components/connectedComponents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CREATE FUNCTION pgr_connectedComponents(
OUT node BIGINT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, component, node
FROM _pgr_connectedComponents(_pgr_get_statement($1));
$BODY$
LANGUAGE SQL VOLATILE STRICT;
Expand Down
4 changes: 2 additions & 2 deletions sql/components/makeConnected.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ CREATE FUNCTION pgr_makeConnected(

RETURNS SETOF RECORD AS
$BODY$
SELECT *
FROM _pgr_makeConnected(_pgr_get_statement($1)) AS a;
SELECT seq, start_vid, end_vid
FROM _pgr_makeConnected(_pgr_get_statement($1));
$BODY$
LANGUAGE SQL VOLATILE STRICT;

Expand Down
2 changes: 1 addition & 1 deletion sql/components/strongComponents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CREATE FUNCTION pgr_strongComponents(
OUT node BIGINT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT seq, component, node
FROM _pgr_strongComponents(_pgr_get_statement($1));
$BODY$
LANGUAGE SQL VOLATILE STRICT;
Expand Down
2 changes: 1 addition & 1 deletion sql/contraction/contraction.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ CREATE FUNCTION pgr_contraction(
OUT cost FLOAT)
RETURNS SETOF RECORD AS
$BODY$
SELECT *
SELECT type, id, contracted_vertices, source, target, cost
FROM _pgr_contraction(_pgr_get_statement($1), $2::BIGINT[], $3, $4, $5);
$BODY$
LANGUAGE SQL VOLATILE STRICT;
Expand Down
Loading