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

Sandro Santilli strk at kbt.io
Thu Oct 17 04:24:57 PDT 2019


Author: strk
Date: 2019-10-17 04:24:57 -0700 (Thu, 17 Oct 2019)
New Revision: 17933

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

Works around bug #4547 for 2.4 branch

Closes #4530 in 2.4 branch

Modified: branches/2.4/regress/run_test.pl
===================================================================
--- branches/2.4/regress/run_test.pl	2019-10-17 11:24:47 UTC (rev 17932)
+++ branches/2.4/regress/run_test.pl	2019-10-17 11:24:57 UTC (rev 17933)
@@ -293,10 +293,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