[postgis-tickets] r17930 - Avoid use of bogus AddRasterConstraint when running upgrade tests

Sandro Santilli strk at kbt.io
Thu Oct 17 04:23:06 PDT 2019


Author: strk
Date: 2019-10-17 04:23:06 -0700 (Thu, 17 Oct 2019)
New Revision: 17930

Modified:
   branches/2.5/regress/run_test.pl
Log:
Avoid use of bogus AddRasterConstraint when running upgrade tests

Works around bug #4547 for 2.5 branch

Closes #4530 in 2.5 branch

Modified: branches/2.5/regress/run_test.pl
===================================================================
--- branches/2.5/regress/run_test.pl	2019-10-17 11:11:14 UTC (rev 17929)
+++ branches/2.5/regress/run_test.pl	2019-10-17 11:23:06 UTC (rev 17930)
@@ -294,10 +294,17 @@
 
   if ( $OPT_WITH_RASTER )
   {
-    $query = "insert into upgrade_test(r) ";
-    $query .= "select ST_AddBand(ST_MakeEmptyRaster(10, 10, 1, 1, 2, 2, 0, 0,4326), 1, '8BSI'::text, -129, NULL);";
-    $query .= "set client_min_messages to error; select AddRasterConstraints('upgrade_test', 'r')";
+    $query = "UPDATE upgrade_test SET r = ";
+    $query .= " ST_AddBand(ST_MakeEmptyRaster(10, 10, 1, 1, 2, 2, 0, 0,4326), 1, '8BSI'::text, -129, NULL);";
     $ret = sql($query);
+    unless ( $ret =~ /^UPDATE/ ) {
+      `dropdb $DB`;
+      print "\nSomething went wrong setting raster into upgrade_test table: $ret.\n";
+      exit(1);
+    }
+
+    $query = "set client_min_messages to error; select AddRasterConstraints('upgrade_test', 'r')";
+    $ret = sql($query);
     unless ( $ret =~ /^t$/ ) {
       `dropdb $DB`;
       print "\nSomething went wrong adding raster constraints to upgrade_test: " . $ret . "\n";



More information about the postgis-tickets mailing list