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

Sandro Santilli strk at kbt.io
Wed Oct 16 10:29:36 PDT 2019


Author: strk
Date: 2019-10-16 22:29:35 -0700 (Wed, 16 Oct 2019)
New Revision: 17923

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

Works around bug #4547 for 3.0 branch

Closes #4530 in 3.0 branch

Modified: branches/3.0/regress/run_test.pl
===================================================================
--- branches/3.0/regress/run_test.pl	2019-10-17 05:28:41 UTC (rev 17922)
+++ branches/3.0/regress/run_test.pl	2019-10-17 05:29:35 UTC (rev 17923)
@@ -320,10 +320,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