Skip to content

Commit 09663cd

Browse files
committed
(_pgr_drivingDistance) Removing deprecated internal function
1 parent 0242240 commit 09663cd

File tree

5 files changed

+20
-122
lines changed

5 files changed

+20
-122
lines changed

Diff for: doc/src/release_notes.rst

+19-4
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,30 @@ milestone for 4.0.0
7878

7979
* pgr_dijkstra
8080

81-
.. rubric:: Removal of SQL deprecated functions and signatures
81+
.. rubric:: Removal of SQL deprecated functions
8282

83-
* pgr_trspviaedges(text,integer[],double precision[],boolean,boolean,text)
84-
* pgr_trspviavertices(text,anyarray,boolean,boolean,text)
85-
* pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text)
83+
* pgr_trsp(text,integer,double
8684
* pgr_trsp(text,integer,integer,boolean,boolean,text)
85+
* pgr_trspviaedges(text,integer[],double
86+
* pgr_trspviavertices(text,anyarray,boolean,boolean,text)
87+
88+
.. rubric:: Removal of SQL deprecated internal functions
89+
8790
* _pgr_dijkstranear(text,anyarray,anyarray,bigint,boolean)
8891
* _pgr_dijkstranear(text,anyarray,bigint,bigint,boolean)
8992
* _pgr_dijkstranear(text,bigint,anyarray,bigint,boolean)
9093
* _pgr_dijkstra(text,anyarray,anyarray,boolean,boolean,boolean,bigint)
94+
* _pgr_dijkstra(text,anyarray,anyarray,boolean,boolean,boolean,bigint,boolean)
95+
* _pgr_dijkstra(text,text,boolean,boolean,bigint,boolean)
9196
* _pgr_dijkstra(text,text,boolean,boolean,boolean)
97+
* _pgr_dijkstrav4(text,text,anyarray,anyarray,boolean,boolean,boolean,bigint,boolean)
98+
* _pgr_drivingdistance(text,anyarray,double
99+
* _pgr_trsp(text,integer,double
100+
* _pgr_trsp(text,text,anyarray,anyarray,boolean)
101+
* _pgr_trsp(text,text,anyarray,bigint,boolean)
102+
* _pgr_trsp(text,text,bigint,anyarray,boolean)
103+
* _pgr_trsp(text,text,bigint,bigint,boolean)
104+
* _pgr_trspviavertices(text,integer[],boolean,boolean,text)
92105

93106
.. rubric:: Deprecation of internal C/C++ functions
94107

@@ -99,10 +112,12 @@ milestone for 4.0.0
99112

100113
.. rubric:: Internal C/C++ functions in legacy
101114

115+
* _pgr_drivingdistance(text,anyarray,double precision,boolean,boolean)
102116
* _trsp(text,text,anyarray,anyarray,boolean)``
103117
* _v4trsp(text,text,anyarray,anyarray,boolean)``
104118
* _v4trsp(text,text,text,boolean)``
105119

120+
106121
pgRouting 3
107122
*******************************************************************************
108123

Diff for: sql/driving_distance/_drivingDistance.sql

-30
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2525
2626
********************************************************************PGR-GNU*/
2727

28-
----------------------
29-
-- pgr_drivingDistance
30-
----------------------
31-
3228
--v3.6
3329
CREATE FUNCTION _pgr_drivingDistancev4(
3430
TEXT, -- edges_sql
@@ -48,31 +44,5 @@ RETURNS SETOF RECORD AS
4844
'MODULE_PATHNAME'
4945
LANGUAGE c VOLATILE STRICT;
5046

51-
-- COMMENTS
52-
5347
COMMENT ON FUNCTION _pgr_drivingDistancev4(TEXT, ANYARRAY, FLOAT, BOOLEAN, BOOLEAN)
5448
IS 'pgRouting internal function';
55-
56-
/* Below functions are for backward compatibility to be removed on v4*/
57-
58-
--v3.0
59-
CREATE FUNCTION _pgr_drivingDistance(
60-
edges_sql TEXT,
61-
start_vids ANYARRAY,
62-
distance FLOAT,
63-
directed BOOLEAN DEFAULT TRUE,
64-
equicost BOOLEAN DEFAULT FALSE,
65-
OUT seq INTEGER,
66-
OUT from_v BIGINT,
67-
OUT node BIGINT,
68-
OUT edge BIGINT,
69-
OUT cost FLOAT,
70-
OUT agg_cost FLOAT)
71-
RETURNS SETOF RECORD AS
72-
'MODULE_PATHNAME'
73-
LANGUAGE c VOLATILE STRICT;
74-
75-
-- COMMENTS
76-
77-
COMMENT ON FUNCTION _pgr_drivingDistance(TEXT, ANYARRAY, FLOAT, BOOLEAN, BOOLEAN)
78-
IS 'pgRouting internal function deprecated on v3.6.0';

Diff for: sql/sigs/pgrouting--4.0.sig

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ pgr_dijkstra(text,text,boolean)
127127
_pgr_dijkstrav4(text,text,anyarray,anyarray,boolean,boolean,boolean,bigint,boolean)
128128
_pgr_dijkstravia(text,anyarray,boolean,boolean,boolean)
129129
pgr_dijkstravia(text,anyarray,boolean,boolean,boolean)
130-
_pgr_drivingdistance(text,anyarray,double precision,boolean,boolean)
131130
pgr_drivingdistance(text,anyarray,double precision,boolean,boolean)
132131
pgr_drivingdistance(text,bigint,double precision,boolean)
133132
_pgr_drivingdistancev4(text,anyarray,double precision,boolean,boolean)

Diff for: src/driving_distance/driving_distance.c

-87
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3737

3838
#include "drivers/driving_distance/driving_distance_driver.h"
3939

40-
41-
PGDLLEXPORT Datum _pgr_drivingdistance(PG_FUNCTION_ARGS);
42-
PG_FUNCTION_INFO_V1(_pgr_drivingdistance);
43-
4440
PGDLLEXPORT Datum _pgr_drivingdistancev4(PG_FUNCTION_ARGS);
4541
PG_FUNCTION_INFO_V1(_pgr_drivingdistancev4);
4642

@@ -162,86 +158,3 @@ _pgr_drivingdistancev4(PG_FUNCTION_ARGS) {
162158
SRF_RETURN_DONE(funcctx);
163159
}
164160
}
165-
166-
167-
/* Old code starts here
168-
* TODO(v4) remove old code
169-
* its code that is used when there is an old version of SQL 3.5 and under
170-
*/
171-
PGDLLEXPORT Datum
172-
_pgr_drivingdistance(PG_FUNCTION_ARGS) {
173-
FuncCallContext *funcctx;
174-
TupleDesc tuple_desc;
175-
176-
MST_rt *result_tuples = 0;
177-
size_t result_count = 0;
178-
179-
if (SRF_IS_FIRSTCALL()) {
180-
MemoryContext oldcontext;
181-
182-
funcctx = SRF_FIRSTCALL_INIT();
183-
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
184-
185-
186-
PGR_DBG("Calling driving_many_to_dist_driver");
187-
process(
188-
text_to_cstring(PG_GETARG_TEXT_P(0)),
189-
PG_GETARG_ARRAYTYPE_P(1),
190-
PG_GETARG_FLOAT8(2),
191-
PG_GETARG_BOOL(3),
192-
PG_GETARG_BOOL(4),
193-
&result_tuples, &result_count);
194-
195-
196-
funcctx->max_calls = result_count;
197-
198-
funcctx->user_fctx = result_tuples;
199-
if (get_call_result_type(fcinfo, NULL, &tuple_desc)
200-
!= TYPEFUNC_COMPOSITE)
201-
ereport(ERROR,
202-
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
203-
errmsg("function returning record called in context "
204-
"that cannot accept type record")));
205-
206-
funcctx->tuple_desc = tuple_desc;
207-
208-
MemoryContextSwitchTo(oldcontext);
209-
}
210-
211-
funcctx = SRF_PERCALL_SETUP();
212-
213-
tuple_desc = funcctx->tuple_desc;
214-
result_tuples = (MST_rt*) funcctx->user_fctx;
215-
216-
if (funcctx->call_cntr < funcctx->max_calls) {
217-
HeapTuple tuple;
218-
Datum result;
219-
Datum *values;
220-
bool* nulls;
221-
222-
size_t numb = 6;
223-
values = palloc(numb * sizeof(Datum));
224-
nulls = palloc(numb * sizeof(bool));
225-
226-
size_t i;
227-
for (i = 0; i < numb; ++i) {
228-
nulls[i] = false;
229-
}
230-
values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1);
231-
values[1] = Int64GetDatum(result_tuples[funcctx->call_cntr].from_v);
232-
values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].node);
233-
values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].edge);
234-
values[4] = Float8GetDatum(result_tuples[funcctx->call_cntr].cost);
235-
values[5] = Float8GetDatum(result_tuples[funcctx->call_cntr].agg_cost);
236-
237-
tuple = heap_form_tuple(tuple_desc, values, nulls);
238-
result = HeapTupleGetDatum(tuple);
239-
240-
pfree(values);
241-
pfree(nulls);
242-
243-
SRF_RETURN_NEXT(funcctx, result);
244-
} else {
245-
SRF_RETURN_DONE(funcctx);
246-
}
247-
}

Diff for: src/legacy/legacy.c

+1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
5454
PGROUTING_DEPRECATE("4.0.0", _pgr_trsp)
5555
PGROUTING_DEPRECATE("4.0.0", _v4trsp)
5656
PGROUTING_DEPRECATE("4.0.0", _trsp)
57+
PGROUTING_DEPRECATE("4.0.0", _pgr_drivingdistance)
5758

0 commit comments

Comments
 (0)