[postgis-tickets] [SCM] PostGIS branch main updated. 3.1.0rc1-280-gd71411c

git at osgeo.org git at osgeo.org
Wed Jul 7 03:57:41 PDT 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, main has been updated
       via  d71411caf5b122fc3595c6af3b925a17fc4de129 (commit)
      from  18dac3acf7cd78509ef5229f9018225519f2d73c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d71411caf5b122fc3595c6af3b925a17fc4de129
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Jul 7 12:23:32 2021 +0200

    Restore support for PostgreSQL-9.6, broke by edge-linking commit

diff --git a/topology/sql/manage/ValidateTopology.sql.in b/topology/sql/manage/ValidateTopology.sql.in
index 43ca7e3..ceca303 100644
--- a/topology/sql/manage/ValidateTopology.sql.in
+++ b/topology/sql/manage/ValidateTopology.sql.in
@@ -23,36 +23,36 @@ CREATE TYPE topology.ValidateTopology_ReturnType AS (
   id2 integer
 );
 
-CREATE OR REPLACE FUNCTION topology._CheckEdgeLinking(curedge ANYELEMENT, prevedge ANYELEMENT)
+CREATE OR REPLACE FUNCTION topology._CheckEdgeLinking(curedge_edge_id INT, prevedge_edge_id INT, prevedge_next_left_edge INT, prevedge_next_right_edge INT)
 RETURNS topology.ValidateTopology_ReturnType
 AS
 $BODY$
 DECLARE
   retrec topology.ValidateTopology_ReturnType;
 BEGIN
-  IF prevedge.edge_id > 0
+  IF prevedge_edge_id > 0
   THEN -- previous was outgoing, this one should be next-right
-    IF prevedge.next_right_edge != curedge.edge_id THEN
+    IF prevedge_next_right_edge != curedge_edge_id THEN
       RAISE DEBUG 'Edge % should be next-right of edge %, is % instead',
-        curedge.edge_id,
-        abs(prevedge.edge_id),
-        prevedge.next_right_edge
+        curedge_edge_id,
+        abs(prevedge_edge_id),
+        prevedge_next_right_edge
       ;
       retrec.error = 'invalid next_right_edge';
-      retrec.id1 = abs(prevedge.edge_id);
-      retrec.id2 = curedge.edge_id; -- we put the expected one here, for convenience
+      retrec.id1 = abs(prevedge_edge_id);
+      retrec.id2 = curedge_edge_id; -- we put the expected one here, for convenience
       RETURN retrec;
     END IF;
   ELSE -- previous was incoming, this one should be next-left
-    IF prevedge.next_left_edge != curedge.edge_id THEN
+    IF prevedge_next_left_edge != curedge_edge_id THEN
       RAISE DEBUG 'Edge % should be next-left of edge %, is % instead',
-        curedge.edge_id,
-        abs(prevedge.edge_id),
-        prevedge.next_left_edge
+        curedge_edge_id,
+        abs(prevedge_edge_id),
+        prevedge_next_left_edge
       ;
       retrec.error = 'invalid next_left_edge';
-      retrec.id1 = abs(prevedge.edge_id);
-      retrec.id2 = curedge.edge_id; -- we put the expected one here, for convenience
+      retrec.id1 = abs(prevedge_edge_id);
+      retrec.id2 = curedge_edge_id; -- we put the expected one here, for convenience
       RETURN retrec;
     END IF;
   END IF;
@@ -421,7 +421,12 @@ BEGIN
       IF last_node_id IS NOT NULL
       THEN
         -- Check that last edge (CW from prev one) is correctly linked
-        retrec := topology._CheckEdgeLinking(last_node_first_edge, last_node_prev_edge);
+        retrec := topology._CheckEdgeLinking(
+          last_node_first_edge.edge_id,
+          last_node_prev_edge.edge_id,
+          last_node_prev_edge.next_left_edge,
+          last_node_prev_edge.next_right_edge
+        );
         IF retrec IS NOT NULL
         THEN
           RETURN NEXT retrec;
@@ -433,7 +438,12 @@ BEGIN
       last_node_first_edge = rec;
     ELSE --{
       -- Check that this edge (CW from last one) is correctly linked
-      retrec := topology._CheckEdgeLinking(rec, last_node_prev_edge);
+      retrec := topology._CheckEdgeLinking(
+        rec.edge_id,
+        last_node_prev_edge.edge_id,
+        last_node_prev_edge.next_left_edge,
+        last_node_prev_edge.next_right_edge
+      );
       IF retrec IS NOT NULL
       THEN
         RETURN NEXT retrec;
@@ -447,7 +457,12 @@ BEGIN
     --RAISE DEBUG 'Out of loop: last_node_prev_edge edge_id:% next_left_edge:%', last_node_prev_edge.edge_id, last_node_prev_edge.next_left_edge;
     --RAISE DEBUG 'Out of loop: last_node_first_edge: %', last_node_first_edge;
     -- Check that last edge (CW from prev one) is correctly linked
-    retrec := topology._CheckEdgeLinking(last_node_first_edge, last_node_prev_edge);
+    retrec := topology._CheckEdgeLinking(
+      last_node_first_edge.edge_id,
+      last_node_prev_edge.edge_id,
+      last_node_prev_edge.next_left_edge,
+      last_node_prev_edge.next_right_edge
+      );
     IF retrec IS NOT NULL
     THEN
       RETURN NEXT retrec;

-----------------------------------------------------------------------

Summary of changes:
 topology/sql/manage/ValidateTopology.sql.in | 49 +++++++++++++++++++----------
 1 file changed, 32 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list