]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge branch 'tetris' of https://github.com/roques/Nominatim into roques-tetris
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 20 Apr 2017 18:56:44 +0000 (20:56 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 20 Apr 2017 18:56:44 +0000 (20:56 +0200)
1  2 
utils/setup.php

diff --cc utils/setup.php
index fae200cc71fa92f2659c1ee01822bba8673f800d,c61c43e3c6bb062568056f6140bb297a328c6dd7..6a809c733f0cf729eb73efd1cecc01acc4687523
@@@ -364,14 -366,10 +366,12 @@@ if ($aCMDResult['load-data'] || $aCMDRe
      $iLoadThreads = max(1, $iInstances - 1);
      for ($i = 0; $i < $iLoadThreads; $i++) {
          $aDBInstances[$i] =& getDB(true);
-         $sSQL = 'insert into placex (osm_type, osm_id, class, type, name, admin_level, ';
-         $sSQL .= '                   address, extratags, geometry) ';
-         $sSQL .= 'select * from place where osm_id % '.$iLoadThreads.' = '.$i;
+         $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);