[SCM] PostGIS branch stable-3.4 updated. 3.4.2-6-gc3093e575

git at osgeo.org git at osgeo.org
Wed Feb 28 05:46:42 PST 2024


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, stable-3.4 has been updated
       via  c3093e5750d32aab72602a479c1c5502ef3c08ca (commit)
      from  a22f29c3c6520342bc79291bc0573df4b40ac343 (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 c3093e5750d32aab72602a479c1c5502ef3c08ca
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Feb 28 12:29:11 2024 +0100

    Fix populate_topology_layer with conforming strings off
    
    References #5680, #5678 in 3.4 branch (3.4.3dev)
    
    Includes test

diff --git a/NEWS b/NEWS
index 01d2bfa0a..000fc4dc0 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
  - #5677, ST_Union(geom[]) should unary union single entry arrays (Paul Ramsey)
  - #5679, Remove spurious COMMIT statements from sfcgal script
           (Sandro Santilli, Loïc Bartoletti)
+ - #5680, Fix populate_topology_layer with standard_conforming_strings
+          set to off (Sandro Santilli)
 
 
 PostGIS 3.4.2
diff --git a/topology/test/regress/populate_topology_layer.sql b/topology/test/regress/populate_topology_layer.sql
new file mode 100644
index 000000000..8801f7b3b
--- /dev/null
+++ b/topology/test/regress/populate_topology_layer.sql
@@ -0,0 +1,37 @@
+BEGIN;
+SELECT NULL FROM topology.CreateTopology('x');
+CREATE TABLE x.f(id int primary key);
+SELECT NULL FROM topology.AddTopoGeometryColumn('x', 'x', 'f', 'g0', 'POINT');
+SELECT NULL FROM topology.AddTopoGeometryColumn('x', 'x', 'f', 'g1', 'LINE');
+SELECT NULL FROM topology.AddTopoGeometryColumn('x', 'x', 'f', 'g2', 'POLYGON');
+SELECT NULL FROM topology.AddTopoGeometryColumn('x', 'x', 'f', 'g3', 'GEOMETRYCOLLECTION');
+
+CREATE TABLE layer_backup AS SELECT * FROM topology.layer;
+
+SELECT 'initial',
+ layer_id,
+ schema_name,
+ table_name,
+ feature_column,
+ feature_type,
+ level,
+ child_id
+FROM topology.layer ORDER BY schema_name, table_name, feature_column;
+
+
+TRUNCATE topology.layer;
+
+SELECT 'populate', * FROM topology.Populate_Topology_Layer();
+
+SELECT 'only-before', * FROM ( SELECT * FROM topology.layer EXCEPT SELECT * FROM layer_backup ) x;
+SELECT 'only-after', * FROM ( SELECT * FROM layer_backup EXCEPT SELECT * FROM topology.layer ) x;
+
+SELECT 'final',
+ layer_id,
+ schema_name,
+ table_name,
+ feature_column,
+ feature_type,
+ level,
+ child_id
+FROM topology.layer ORDER BY schema_name, table_name, feature_column;
diff --git a/topology/test/regress/populate_topology_layer_expected b/topology/test/regress/populate_topology_layer_expected
new file mode 100644
index 000000000..6acedee11
--- /dev/null
+++ b/topology/test/regress/populate_topology_layer_expected
@@ -0,0 +1,12 @@
+initial|1|x|f|g0|1|0|
+initial|2|x|f|g1|2|0|
+initial|3|x|f|g2|3|0|
+initial|4|x|f|g3|4|0|
+populate|x|f|g0
+populate|x|f|g1
+populate|x|f|g2
+populate|x|f|g3
+final|1|x|f|g0|1|0|
+final|2|x|f|g1|2|0|
+final|3|x|f|g2|3|0|
+final|4|x|f|g3|4|0|
diff --git a/topology/test/tests.mk b/topology/test/tests.mk
index cd0d26d32..716fe291a 100644
--- a/topology/test/tests.mk
+++ b/topology/test/tests.mk
@@ -46,6 +46,7 @@ TESTS += \
 	$(top_srcdir)/topology/test/regress/legacy_query.sql \
 	$(top_srcdir)/topology/test/regress/legacy_validate.sql \
 	$(top_srcdir)/topology/test/regress/polygonize.sql \
+	$(top_srcdir)/topology/test/regress/populate_topology_layer.sql \
 	$(top_srcdir)/topology/test/regress/removeunusedprimitives.sql \
 	$(top_srcdir)/topology/test/regress/renametopology.sql \
 	$(top_srcdir)/topology/test/regress/renametopogeometrycolumn.sql \
diff --git a/topology/topology.sql.in b/topology/topology.sql.in
index 97c0e3926..5746794c5 100644
--- a/topology/topology.sql.in
+++ b/topology/topology.sql.in
@@ -670,7 +670,7 @@ $$
     replace(c.conname, 'check_topogeom_', '') col,
     --c.consrc src,
     regexp_matches(c.consrc,
-      '\.topology_id = (\d+).*\.layer_id = (\d+).*\.type = (\d+)') inf
+      E'\\.topology_id = (\\d+).*\\.layer_id = (\\d+).*\\.type = (\\d+)') inf
   FROM (SELECT conname, connamespace, conrelid, conkey, pg_get_constraintdef(oid) As consrc
 		    FROM pg_constraint) AS c, pg_class r, pg_namespace n
   WHERE c.conname LIKE 'check_topogeom_%'

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

Summary of changes:
 NEWS                                               |  2 ++
 topology/test/regress/populate_topology_layer.sql  | 37 ++++++++++++++++++++++
 .../test/regress/populate_topology_layer_expected  | 12 +++++++
 topology/test/tests.mk                             |  1 +
 topology/topology.sql.in                           |  2 +-
 5 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 topology/test/regress/populate_topology_layer.sql
 create mode 100644 topology/test/regress/populate_topology_layer_expected


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list