[SCM] PostGIS branch master updated. 3.4.0rc1-949-gf64b082ef

git at osgeo.org git at osgeo.org
Wed Feb 28 05:45:10 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, master has been updated
       via  f64b082efca3986205253ffee3fd0f1b421ee0db (commit)
      from  02580d807eb050424b2ee76eb17144a684a7a9a8 (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 f64b082efca3986205253ffee3fd0f1b421ee0db
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 master branch (3.5.0dev)
    
    Includes test

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:
 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 +-
 4 files changed, 51 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