[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-187-g8245dd1

git at osgeo.org git at osgeo.org
Thu May 13 19:12:04 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, master has been updated
       via  8245dd1d2202c933c20c7d78fa626f11394de31a (commit)
       via  13ea2201fa3d21532db3cd8c2e6784faaf56eb27 (commit)
       via  034717488e2bcf3738db3b91d5e9883f8e77b4ea (commit)
       via  b73546d16cfc3dbb1427c2f4def1c92e9099b420 (commit)
       via  b984995719470caa24402ebe992e6753126c23e0 (commit)
      from  5ab22a7dd6a4518a8ed3456d8cfcf09fa8ab9892 (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 8245dd1d2202c933c20c7d78fa626f11394de31a
Merge: 5ab22a7 13ea220
Author: Regina Obe <lr at pcorp.us>
Date:   Thu May 13 21:21:31 2021 -0400

    Properly test -Z switch. Closes #4905
    Closes https://github.com/postgis/postgis/pull/612


commit 13ea2201fa3d21532db3cd8c2e6784faaf56eb27
Author: Stefan Petrea <stefan.petrea at gmail.com>
Date:   Thu May 6 18:52:40 2021 +0300

    moved test table to public schema; added negative test
    
    - moved test table to default schema (removed pre/post sql)
    - added TestANALYZE as the negative test (TestSkipANALYZE is the positive one)

diff --git a/regress/loader/TestANALYZE.dbf b/regress/loader/TestANALYZE.dbf
new file mode 100644
index 0000000..13b4aee
Binary files /dev/null and b/regress/loader/TestANALYZE.dbf differ
diff --git a/regress/loader/TestANALYZE.opts b/regress/loader/TestANALYZE.opts
new file mode 100644
index 0000000..d82cb4c
--- /dev/null
+++ b/regress/loader/TestANALYZE.opts
@@ -0,0 +1,2 @@
+# Test with ANALYZE
+-g the_geom {regdir}/loader/TestSkipANALYZE loadedshp
diff --git a/regress/loader/TestANALYZE.select.expected b/regress/loader/TestANALYZE.select.expected
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/regress/loader/TestANALYZE.select.expected
@@ -0,0 +1 @@
+1
diff --git a/regress/loader/TestANALYZE.select.sql b/regress/loader/TestANALYZE.select.sql
new file mode 100644
index 0000000..de56987
--- /dev/null
+++ b/regress/loader/TestANALYZE.select.sql
@@ -0,0 +1,4 @@
+-- Expecting the table to have been analyzed
+SELECT COUNT(stanumbers1)
+FROM pg_statistic
+WHERE starelid = 'public.loadedshp'::regclass AND stanumbers1 IS NOT NULL;
diff --git a/regress/loader/TestANALYZE.shp b/regress/loader/TestANALYZE.shp
new file mode 100644
index 0000000..51d38e7
Binary files /dev/null and b/regress/loader/TestANALYZE.shp differ
diff --git a/regress/loader/TestANALYZE.shx b/regress/loader/TestANALYZE.shx
new file mode 100644
index 0000000..7db02af
Binary files /dev/null and b/regress/loader/TestANALYZE.shx differ
diff --git a/regress/loader/TestSkipANALYZE-post.sql b/regress/loader/TestSkipANALYZE-post.sql
deleted file mode 100644
index fd98c18..0000000
--- a/regress/loader/TestSkipANALYZE-post.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-DROP TABLE IF EXISTS pgreg.loadedshp;
---DELETE FROM geometry_columns WHERE f_table_schema='pgreg';
-DROP SCHEMA pgreg;
diff --git a/regress/loader/TestSkipANALYZE-pre.sql b/regress/loader/TestSkipANALYZE-pre.sql
deleted file mode 100644
index 6a860c3..0000000
--- a/regress/loader/TestSkipANALYZE-pre.sql
+++ /dev/null
@@ -1 +0,0 @@
-CREATE SCHEMA pgreg;
diff --git a/regress/loader/TestSkipANALYZE.opts b/regress/loader/TestSkipANALYZE.opts
index 0bce557..4ffc225 100644
--- a/regress/loader/TestSkipANALYZE.opts
+++ b/regress/loader/TestSkipANALYZE.opts
@@ -1,2 +1,2 @@
 # Test -Z skips ANALYZE
--Z -g the_geom {regdir}/loader/TestSkipANALYZE pgreg.loadedshp
+-Z -g the_geom {regdir}/loader/TestSkipANALYZE loadedshp
diff --git a/regress/loader/TestSkipANALYZE.select.sql b/regress/loader/TestSkipANALYZE.select.sql
index 19ec0aa..295f718 100644
--- a/regress/loader/TestSkipANALYZE.select.sql
+++ b/regress/loader/TestSkipANALYZE.select.sql
@@ -1,5 +1,5 @@
--- Checks if the table pgreg.loadedshp was analyzed by
--- querying the respective PostgreSQL system catalog
+-- Checks if the table was analyzed by looking at the table statistics
+-- in the pg system catalog
 SELECT COUNT(stanumbers1)
 FROM pg_statistic
-WHERE starelid = 'pgreg.loadedshp'::regclass AND stanumbers1 IS NOT NULL;
+WHERE starelid = 'loadedshp'::regclass AND stanumbers1 IS NOT NULL;
diff --git a/regress/loader/tests.mk b/regress/loader/tests.mk
index 757edc6..f6be1df 100644
--- a/regress/loader/tests.mk
+++ b/regress/loader/tests.mk
@@ -38,4 +38,5 @@ TESTS += \
 	$(topsrcdir)/regress/loader/Latin1 \
 	$(topsrcdir)/regress/loader/Latin1-implicit \
 	$(topsrcdir)/regress/loader/mfile \
-	$(topsrcdir)/regress/loader/TestSkipANALYZE
+	$(topsrcdir)/regress/loader/TestSkipANALYZE \
+	$(topsrcdir)/regress/loader/TestANALYZE

commit 034717488e2bcf3738db3b91d5e9883f8e77b4ea
Author: Stefan Petrea <stefan.petrea at gmail.com>
Date:   Thu May 6 02:05:11 2021 +0300

    added before-uninstall hook to make this condition true: COUNT(preinstall_objects) == COUNT(postinstall_objects)

diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in
index a9e7902..ddc2820 100644
--- a/regress/core/tests.mk.in
+++ b/regress/core/tests.mk.in
@@ -23,7 +23,8 @@ current_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
 RUNTESTFLAGS_INTERNAL += \
   --before-upgrade-script $(topsrcdir)/regress/hooks/hook-before-upgrade.sql \
   --after-upgrade-script  $(topsrcdir)/regress/hooks/hook-after-upgrade.sql \
-  --after-create-script   $(topsrcdir)/regress/hooks/hook-after-create.sql
+  --after-create-script   $(topsrcdir)/regress/hooks/hook-after-create.sql \
+  --before-uninstall-script $(topsrcdir)/regress/hooks/hook-before-uninstall.sql
 
 TESTS += \
 	$(topsrcdir)/regress/core/affine \
diff --git a/regress/hooks/hook-after-create.sql b/regress/hooks/hook-after-create.sql
index 6db3093..56492bb 100644
--- a/regress/hooks/hook-after-create.sql
+++ b/regress/hooks/hook-after-create.sql
@@ -24,7 +24,6 @@ BEGIN
 END;
 $$;
 
-DROP EVENT TRIGGER IF EXISTS trg_autovac_disable;
 CREATE EVENT TRIGGER trg_autovac_disable ON ddl_command_end
 WHEN TAG IN ('CREATE TABLE','CREATE TABLE AS')
 EXECUTE PROCEDURE trg_test_disable_table_autovacuum();
diff --git a/regress/hooks/hook-before-uninstall.sql b/regress/hooks/hook-before-uninstall.sql
new file mode 100644
index 0000000..63b939e
--- /dev/null
+++ b/regress/hooks/hook-before-uninstall.sql
@@ -0,0 +1,2 @@
+DROP EVENT TRIGGER IF EXISTS trg_autovac_disable;
+DROP FUNCTION IF EXISTS trg_test_disable_table_autovacuum();

commit b73546d16cfc3dbb1427c2f4def1c92e9099b420
Author: Stefan Petrea <stefan.petrea at gmail.com>
Date:   Thu May 6 01:45:16 2021 +0300

    moved the disable_autovacuum.sql under regress/hooks/hook-after-create.sql

diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in
index e8c8102..a9e7902 100644
--- a/regress/core/tests.mk.in
+++ b/regress/core/tests.mk.in
@@ -22,7 +22,8 @@ current_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
 
 RUNTESTFLAGS_INTERNAL += \
   --before-upgrade-script $(topsrcdir)/regress/hooks/hook-before-upgrade.sql \
-  --after-upgrade-script  $(topsrcdir)/regress/hooks/hook-after-upgrade.sql
+  --after-upgrade-script  $(topsrcdir)/regress/hooks/hook-after-upgrade.sql \
+  --after-create-script   $(topsrcdir)/regress/hooks/hook-after-create.sql
 
 TESTS += \
 	$(topsrcdir)/regress/core/affine \
diff --git a/regress/disable_autovacuum.sql b/regress/hooks/hook-after-create.sql
similarity index 100%
rename from regress/disable_autovacuum.sql
rename to regress/hooks/hook-after-create.sql
diff --git a/regress/run_test.pl b/regress/run_test.pl
index 1b23e12..938439c 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -1267,9 +1267,7 @@ sub count_postgis_objects
 sub create_db
 {
 	my $createcmd = "createdb --encoding=UTF-8 --template=template0 --lc-collate=C $DB > $REGRESS_LOG";
-    my $rv = system($createcmd);
-    system("psql -d $DB -f disable_autovacuum.sql ");
-	return $rv;
+	return system($createcmd);
 }
 
 sub create_spatial

commit b984995719470caa24402ebe992e6753126c23e0
Author: Stefan Petrea <stefan.petrea at gmail.com>
Date:   Wed May 5 22:09:07 2021 +0300

    test if -Z works properly by checking pg system catalogs

diff --git a/regress/disable_autovacuum.sql b/regress/disable_autovacuum.sql
new file mode 100644
index 0000000..6db3093
--- /dev/null
+++ b/regress/disable_autovacuum.sql
@@ -0,0 +1,30 @@
+--
+-- Disable autovacuum on the tables created as part of the test suite
+-- to make sure autovacuum does not run VACUUM or ANALYZE on the tables
+-- created by the test suite.
+--
+-- Some of the tests are designed with the assumption that ANALYZE will
+-- only be run explicitly, and not from an external source like autovacuum.
+--
+
+CREATE OR REPLACE FUNCTION trg_test_disable_table_autovacuum()
+RETURNS event_trigger
+LANGUAGE plpgsql
+AS $$
+DECLARE
+    obj record;
+BEGIN
+    FOR obj IN SELECT * FROM pg_event_trigger_ddl_commands() WHERE command_tag in ('CREATE TABLE','CREATE TABLE AS')
+    LOOP
+        IF obj.object_identity = 'public.spatial_ref_sys' THEN
+            CONTINUE;
+        END IF;
+        EXECUTE format('ALTER TABLE %s SET (autovacuum_enabled = false);',obj.object_identity);
+    END LOOP;
+END;
+$$;
+
+DROP EVENT TRIGGER IF EXISTS trg_autovac_disable;
+CREATE EVENT TRIGGER trg_autovac_disable ON ddl_command_end
+WHEN TAG IN ('CREATE TABLE','CREATE TABLE AS')
+EXECUTE PROCEDURE trg_test_disable_table_autovacuum();
diff --git a/regress/loader/TestSkipANALYZE-post.sql b/regress/loader/TestSkipANALYZE-post.sql
new file mode 100644
index 0000000..fd98c18
--- /dev/null
+++ b/regress/loader/TestSkipANALYZE-post.sql
@@ -0,0 +1,3 @@
+DROP TABLE IF EXISTS pgreg.loadedshp;
+--DELETE FROM geometry_columns WHERE f_table_schema='pgreg';
+DROP SCHEMA pgreg;
diff --git a/regress/loader/TestSkipANALYZE-pre.sql b/regress/loader/TestSkipANALYZE-pre.sql
new file mode 100644
index 0000000..6a860c3
--- /dev/null
+++ b/regress/loader/TestSkipANALYZE-pre.sql
@@ -0,0 +1 @@
+CREATE SCHEMA pgreg;
diff --git a/regress/loader/TestSkipANALYZE.dbf b/regress/loader/TestSkipANALYZE.dbf
new file mode 100644
index 0000000..13b4aee
Binary files /dev/null and b/regress/loader/TestSkipANALYZE.dbf differ
diff --git a/regress/loader/TestSkipANALYZE.opts b/regress/loader/TestSkipANALYZE.opts
new file mode 100644
index 0000000..0bce557
--- /dev/null
+++ b/regress/loader/TestSkipANALYZE.opts
@@ -0,0 +1,2 @@
+# Test -Z skips ANALYZE
+-Z -g the_geom {regdir}/loader/TestSkipANALYZE pgreg.loadedshp
diff --git a/regress/loader/TestSkipANALYZE.select.expected b/regress/loader/TestSkipANALYZE.select.expected
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/regress/loader/TestSkipANALYZE.select.expected
@@ -0,0 +1 @@
+0
diff --git a/regress/loader/TestSkipANALYZE.select.sql b/regress/loader/TestSkipANALYZE.select.sql
new file mode 100644
index 0000000..19ec0aa
--- /dev/null
+++ b/regress/loader/TestSkipANALYZE.select.sql
@@ -0,0 +1,5 @@
+-- Checks if the table pgreg.loadedshp was analyzed by
+-- querying the respective PostgreSQL system catalog
+SELECT COUNT(stanumbers1)
+FROM pg_statistic
+WHERE starelid = 'pgreg.loadedshp'::regclass AND stanumbers1 IS NOT NULL;
diff --git a/regress/loader/TestSkipANALYZE.shp b/regress/loader/TestSkipANALYZE.shp
new file mode 100644
index 0000000..51d38e7
Binary files /dev/null and b/regress/loader/TestSkipANALYZE.shp differ
diff --git a/regress/loader/TestSkipANALYZE.shx b/regress/loader/TestSkipANALYZE.shx
new file mode 100644
index 0000000..7db02af
Binary files /dev/null and b/regress/loader/TestSkipANALYZE.shx differ
diff --git a/regress/loader/tests.mk b/regress/loader/tests.mk
index 85031b7..757edc6 100644
--- a/regress/loader/tests.mk
+++ b/regress/loader/tests.mk
@@ -37,4 +37,5 @@ TESTS += \
 	$(topsrcdir)/regress/loader/ReprojectPtsGeogD \
 	$(topsrcdir)/regress/loader/Latin1 \
 	$(topsrcdir)/regress/loader/Latin1-implicit \
-	$(topsrcdir)/regress/loader/mfile
+	$(topsrcdir)/regress/loader/mfile \
+	$(topsrcdir)/regress/loader/TestSkipANALYZE
diff --git a/regress/run_test.pl b/regress/run_test.pl
index 938439c..1b23e12 100755
--- a/regress/run_test.pl
+++ b/regress/run_test.pl
@@ -1267,7 +1267,9 @@ sub count_postgis_objects
 sub create_db
 {
 	my $createcmd = "createdb --encoding=UTF-8 --template=template0 --lc-collate=C $DB > $REGRESS_LOG";
-	return system($createcmd);
+    my $rv = system($createcmd);
+    system("psql -d $DB -f disable_autovacuum.sql ");
+	return $rv;
 }
 
 sub create_spatial

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

Summary of changes:
 regress/core/tests.mk.in                           |   4 ++-
 regress/hooks/hook-after-create.sql                |  29 +++++++++++++++++++++
 regress/hooks/hook-before-uninstall.sql            |   2 ++
 regress/loader/{TSTPolygon.dbf => TestANALYZE.dbf} | Bin
 regress/loader/TestANALYZE.opts                    |   2 ++
 regress/loader/TestANALYZE.select.expected         |   1 +
 regress/loader/TestANALYZE.select.sql              |   4 +++
 .../{PointWithSchema.shp => TestANALYZE.shp}       | Bin
 .../{PointWithSchema.shx => TestANALYZE.shx}       | Bin
 .../loader/{TSTPolygon.dbf => TestSkipANALYZE.dbf} | Bin
 regress/loader/TestSkipANALYZE.opts                |   2 ++
 regress/loader/TestSkipANALYZE.select.expected     |   1 +
 regress/loader/TestSkipANALYZE.select.sql          |   5 ++++
 .../{PointWithSchema.shp => TestSkipANALYZE.shp}   | Bin
 .../{PointWithSchema.shx => TestSkipANALYZE.shx}   | Bin
 regress/loader/tests.mk                            |   4 ++-
 16 files changed, 52 insertions(+), 2 deletions(-)
 create mode 100644 regress/hooks/hook-after-create.sql
 create mode 100644 regress/hooks/hook-before-uninstall.sql
 copy regress/loader/{TSTPolygon.dbf => TestANALYZE.dbf} (100%)
 create mode 100644 regress/loader/TestANALYZE.opts
 create mode 100644 regress/loader/TestANALYZE.select.expected
 create mode 100644 regress/loader/TestANALYZE.select.sql
 copy regress/loader/{PointWithSchema.shp => TestANALYZE.shp} (100%)
 copy regress/loader/{PointWithSchema.shx => TestANALYZE.shx} (100%)
 copy regress/loader/{TSTPolygon.dbf => TestSkipANALYZE.dbf} (100%)
 create mode 100644 regress/loader/TestSkipANALYZE.opts
 create mode 100644 regress/loader/TestSkipANALYZE.select.expected
 create mode 100644 regress/loader/TestSkipANALYZE.select.sql
 copy regress/loader/{PointWithSchema.shp => TestSkipANALYZE.shp} (100%)
 copy regress/loader/{PointWithSchema.shx => TestSkipANALYZE.shx} (100%)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list