-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Remove deprecated functions #2732
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
BEGIN; | ||
|
||
UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); | ||
SELECT plan(34); | ||
SELECT CASE WHEN NOT min_version('3.6.0') AND min_lib_version('5.0.0') THEN plan(1) ELSE plan(34) END; | ||
|
||
PREPARE edges AS | ||
SELECT id, source, target, cost, reverse_cost FROM edges; | ||
|
@@ -39,6 +39,11 @@ DECLARE | |
params TEXT[]; | ||
subs TEXT[]; | ||
BEGIN | ||
IF NOT min_version('3.6.0') AND min_lib_version('5.0.0') THEN | ||
RETURN NEXT skip(1, 'Internal function deprecated on 3.6.0 and removed on 5.0.0'); | ||
RETURN; | ||
END IF; | ||
Comment on lines
+42
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Use an ELSIF block for more direct readability. |
||
|
||
-- 1 to distance | ||
params = ARRAY['$$SELECT id, source, target, cost, reverse_cost FROM edges$$','1', '1.3::FLOAT']::TEXT[]; | ||
subs = ARRAY[ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,49 +29,38 @@ SELECT has_function('pgr_drivingdistance', ARRAY['text','anyarray','double preci | |
SELECT function_returns('pgr_drivingdistance', ARRAY['text','bigint','double precision','boolean'],'setof record'); | ||
SELECT function_returns('pgr_drivingdistance', ARRAY['text','anyarray','double precision','boolean','boolean'],'setof record'); | ||
|
||
CREATE OR REPLACE FUNCTION types_check() | ||
RETURNS SETOF TEXT AS | ||
$BODY$ | ||
BEGIN | ||
SELECT CASE | ||
WHEN (min_version('3.6.0')) THEN | ||
collect_tap( | ||
set_eq( | ||
$$SELECT proargnames from pg_proc where proname = 'pgr_drivingdistance'$$, | ||
$$VALUES | ||
('{"","","","directed","seq","depth","start_vid","pred","node","edge","cost","agg_cost"}'::TEXT[]), | ||
('{"","","","directed","equicost","seq","depth","start_vid","pred","node","edge","cost","agg_cost"}'::TEXT[]) | ||
$$), | ||
|
||
IF (min_version('3.6.0')) THEN | ||
RETURN QUERY | ||
SELECT set_eq( | ||
$$SELECT proargnames from pg_proc where proname = 'pgr_drivingdistance'$$, | ||
$$VALUES | ||
('{"","","","directed","seq","depth","start_vid","pred","node","edge","cost","agg_cost"}'::TEXT[]), | ||
('{"","","","directed","equicost","seq","depth","start_vid","pred","node","edge","cost","agg_cost"}'::TEXT[]) | ||
$$); | ||
set_eq( | ||
$$SELECT proallargtypes from pg_proc where proname = 'pgr_drivingdistance'$$, | ||
$$VALUES | ||
('{25,20,701,16,20,20,20,20,20,20,701,701}'::OID[]), | ||
('{25,2277,701,16,16,20,20,20,20,20,20,701,701}'::OID[]) | ||
$$)) | ||
ELSE | ||
collect_tap( | ||
set_eq( | ||
$$SELECT proargnames from pg_proc where proname = 'pgr_drivingdistance'$$, | ||
$$VALUES | ||
('{"","","","directed","seq","node","edge","cost","agg_cost"}'::TEXT[]), | ||
('{"","","","directed","equicost","seq","from_v","node","edge","cost","agg_cost"}'::TEXT[]) | ||
$$), | ||
|
||
RETURN QUERY | ||
SELECT set_eq( | ||
$$SELECT proallargtypes from pg_proc where proname = 'pgr_drivingdistance'$$, | ||
$$VALUES | ||
('{25,20,701,16,20,20,20,20,20,20,701,701}'::OID[]), | ||
('{25,2277,701,16,16,20,20,20,20,20,20,701,701}'::OID[]) | ||
$$); | ||
ELSE | ||
-- old signatures | ||
RETURN QUERY | ||
SELECT set_eq( | ||
$$SELECT proargnames from pg_proc where proname = 'pgr_drivingdistance'$$, | ||
$$VALUES | ||
('{"","","","directed","seq","node","edge","cost","agg_cost"}'::TEXT[]), | ||
('{"","","","directed","equicost","seq","from_v","node","edge","cost","agg_cost"}'::TEXT[]) | ||
$$); | ||
|
||
RETURN QUERY | ||
SELECT set_eq( | ||
$$SELECT proallargtypes from pg_proc where proname = 'pgr_drivingdistance'$$, | ||
$$VALUES | ||
('{25,20,701,16,23,20,20,701,701}'::OID[]), | ||
('{25,2277,701,16,16,23,20,20,20,701,701}'::OID[]) | ||
$$); | ||
END IF; | ||
set_eq( | ||
$$SELECT proallargtypes from pg_proc where proname = 'pgr_drivingdistance'$$, | ||
$$VALUES | ||
('{25,20,701,16,23,20,20,701,701}'::OID[]), | ||
('{25,2277,701,16,16,23,20,20,20,701,701}'::OID[]) | ||
$$)) | ||
Comment on lines
+32
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Unify version checks with other files for consistency. |
||
END; | ||
$BODY$ | ||
LANGUAGE plpgsql; | ||
|
||
SELECT * FROM types_check(); | ||
SELECT finish(); | ||
ROLLBACK; |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Consider refactoring the conditional logic for clarity.
The nested usage of
NOT min_version('3.6.0') AND min_lib_version('5.0.0')
can be a bit confusing. You might consider inverting or rewording the condition (e.g.,ELSIF
structure) for better readability.