[postgis-tickets] [SCM] PostGIS branch stable-3.4 updated. 3.4.0-32-g2c36d0c61

git at osgeo.org git at osgeo.org
Tue Oct 17 09:16:39 PDT 2023


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  2c36d0c61d7a94a63d333090c397e6a64affb35a (commit)
      from  e28b82821484fe78af0ce2ba999bffaf5dcbd7bf (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 2c36d0c61d7a94a63d333090c397e6a64affb35a
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Oct 17 17:55:31 2023 +0200

    Handle deprecated functions in create_skip_signature
    
    Closes #5574 #5575 in stable-3.4 branch (3.4.1dev)

diff --git a/NEWS b/NEWS
index c4b60eb10..a3b875ddc 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
 * Bug Fixes *
 
 
+ - #5574, #5575, Fix restore of postgis dumps from 3.0 (Sandro Santilli)
  - #5568, Improve robustness of topology face split handling (Sandro Santilli)
  - #5548, Fix box-filtered validity check of topologies with edge-less faces
           (Sandro Santilli)
diff --git a/utils/create_skip_signatures.pl b/utils/create_skip_signatures.pl
index 81696964e..231ddae71 100644
--- a/utils/create_skip_signatures.pl
+++ b/utils/create_skip_signatures.pl
@@ -109,6 +109,39 @@ sub canonicalize_args {
 	return @out;
 }
 
+sub handle_function_signature {
+	my $line = shift;
+
+	$line = lc($line);
+	$line =~ s/topology\.//g;
+
+	$line =~ m/ *([^\( ]*) *\((.*)\)/ or die "Unexpected FUNCTION signature: $line";
+
+	my $name = $1;
+	my $args = $2;
+	$args =~ s/\s*$//; # trim trailing blanks
+	$args =~ s/^\s*//; # trim leading blanks
+
+	my @args = split('\s*,\s*', $args);
+	@args = canonicalize_args(@args);
+
+	print "COMMENT FUNCTION $name(" . join(', ', @args) .")\n";
+
+	# Example manifest line for comments on function with inout params:
+	# 4247; 0 0 COMMENT public FUNCTION testinoutmix(INOUT "inout" double precision, second integer, OUT thirdout integer, fourth integer) strk
+
+	# Example manifest line for function with inout params:
+	# 955; 1255 27730785 FUNCTION public testinoutmix(double precision, integer, integer) strk
+
+	# No inout indicator or out parameters for function signatures
+	my @inonly_args = clean_inout_arguments(@args);
+
+	# For *function* signature we are supposed to strip argument names
+	my @unnamed_args = strip_argument_names(@inonly_args);
+
+	print "FUNCTION $name(" . join(', ', @unnamed_args) . ")\n";
+}
+
 while (<>)
 {
 	#print "XXX 0 $_";
@@ -157,33 +190,31 @@ while (<>)
 		# at some point
 		$line =~ s/ *--.*//;
 
-		$line = lc($line);
-		$line =~ s/topology\.//g;
+		handle_function_signature($line);
+	}
 
-		$line =~ m/ *([^\( ]*) *\((.*)\)/ or die "Unexpected DROP FUNCTION syntax: $origline";
+	# Deprecated function signature
+	# EXAMPLE: ALTER FUNCTION _st_concavehull( geometry ) RENAME TO _st_concavehull_deprecated_by_postgis_303;
+	elsif ( /ALTER FUNCTION .* RENAME TO .*_deprecated_by_postgis_/ )
+	{
+		my $origline = $_;
+		my $line = $origline;
 
-		my $name = $1;
-		my $args = $2;
-		$args =~ s/\s*$//; # trim trailing blanks
-		$args =~ s/^\s*//; # trim leading blanks
+		$line =~ s/ *ALTER FUNCTION (.*) RENAME TO .*_deprecated_by_postgis_.*/\1/;
 
-		my @args = split('\s*,\s*', $args);
-		@args = canonicalize_args(@args);
+		handle_function_signature($line);
+	}
 
-		print "COMMENT FUNCTION $name(" . join(', ', @args) .")\n";
+	# Deprecated function signature using
+	# _postgis_drop_function_by_signature
+	# EXAMPLE: SELECT _postgis_drop_function_by_signature('pgis_geometry_union_finalfn(internal)');
+	elsif ( /SELECT _postgis_drop_function_by_signature\('[^']*'\);/ )
+	{
+		my $origline = $_;
+		my $line = $origline;
 
-		# Example manifest line for comments on function with inout params:
-		# 4247; 0 0 COMMENT public FUNCTION testinoutmix(INOUT "inout" double precision, second integer, OUT thirdout integer, fourth integer) strk
+		$line =~ s/SELECT _postgis_drop_function_by_signature\('([^']*)'\);/\1/;
 
-		# Example manifest line for function with inout params:
-		# 955; 1255 27730785 FUNCTION public testinoutmix(double precision, integer, integer) strk
-
-		# No inout indicator or out parameters for function signatures
-		my @inonly_args = clean_inout_arguments(@args);
-
-		# For *function* signature we are supposed to strip argument names
-		my @unnamed_args = strip_argument_names(@inonly_args);
-
-		print "FUNCTION $name(" . join(', ', @unnamed_args) . ")\n";
+		handle_function_signature($line);
 	}
 }

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

Summary of changes:
 NEWS                            |  1 +
 utils/create_skip_signatures.pl | 75 +++++++++++++++++++++++++++++------------
 2 files changed, 54 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list