]> git.openstreetmap.org Git - nominatim.git/blobdiff - utils/setup.php
Merge branch 'tetris' of https://github.com/roques/Nominatim into roques-tetris
[nominatim.git] / utils / setup.php
index c61c43e3c6bb062568056f6140bb297a328c6dd7..6a809c733f0cf729eb73efd1cecc01acc4687523 100755 (executable)
@@ -369,7 +369,9 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) {
         $sSQL = "INSERT INTO placex ($sColumns) SELECT $sColumns FROM place WHERE osm_id % $iLoadThreads = $i";
         $sSQL .= " and not (class='place' and type='houses' and osm_type='W' and ST_GeometryType(geometry) = 'ST_LineString')";
         if ($aCMDResult['verbose']) echo "$sSQL\n";
-        if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) fail(pg_last_error($oDB->connection));
+        if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) {
+            fail(pg_last_error($aDBInstances[$i]->connection));
+        }
     }
     // last thread for interpolation lines
     $aDBInstances[$iLoadThreads] =& getDB(true);
@@ -378,7 +380,9 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) {
     $sSQL .= ' SELECT osm_id, address, geometry from place where ';
     $sSQL .= "class='place' and type='houses' and osm_type='W' and ST_GeometryType(geometry) = 'ST_LineString'";
     if ($aCMDResult['verbose']) echo "$sSQL\n";
-    if (!pg_send_query($aDBInstances[$i]->connection, $sSQL)) fail(pg_last_error($oDB->connection));
+    if (!pg_send_query($aDBInstances[$iLoadThreads]->connection, $sSQL)) {
+        fail(pg_last_error($aDBInstances[$iLoadThreads]->connection));
+    }
 
     $bAnyBusy = true;
     while ($bAnyBusy) {