[SCM] PostGIS branch stable-3.3 updated. 3.3.6-6-g71afa3e0e

git at osgeo.org git at osgeo.org
Wed Feb 28 05:47:33 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.3 has been updated
       via  71afa3e0e349f7d6f4df741d803d03bc01b10200 (commit)
      from  29037e7e37ede5dfa12bd6a5bcc42e0632e4a550 (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 71afa3e0e349f7d6f4df741d803d03bc01b10200
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Feb 28 12:29:11 2024 +0100

    Fix populate_topology_layer with conforming strings off
    
    Closes #5680, #5678 in 3.3 branch (3.3.7dev)
    
    Includes test

diff --git a/NEWS b/NEWS
index 601eb12c5..9a9c8c3ff 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ xxxx/xx/xx
  - #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.3.6
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 af09adccd..b472a5675 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/sqlmm.sql \
 	$(top_srcdir)/topology/test/regress/st_addedgemodface.sql \
diff --git a/topology/topology.sql.in b/topology/topology.sql.in
index 3a97859f0..b5faca198 100644
--- a/topology/topology.sql.in
+++ b/topology/topology.sql.in
@@ -667,7 +667,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