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

Sandro Santilli strk at kbt.io
Thu Oct 17 04:46:34 PDT 2019


Author: strk
Date: 2019-10-17 04:46:34 -0700 (Thu, 17 Oct 2019)
New Revision: 17935

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

Works around bug #4547 for 2.3 branch

Closes #4530 in 2.3 branch

Modified: branches/2.3/regress/run_test.pl
===================================================================
--- branches/2.3/regress/run_test.pl	2019-10-17 11:46:23 UTC (rev 17934)
+++ branches/2.3/regress/run_test.pl	2019-10-17 11:46:34 UTC (rev 17935)
@@ -290,10 +290,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