]> git.openstreetmap.org Git - nominatim.git/commitdiff
do not depend on cmdline parameter for creating partition tables
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Mar 2021 20:28:39 +0000 (21:28 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Mar 2021 20:28:39 +0000 (21:28 +0100)
The partition numbers in use only depend on the entries in search_name.

lib-php/setup/SetupClass.php

index b0081fd873ce3bce62cbc318c3b6e815db1026dc..7516861932f4cd9aef328a0d6ea12aa59b9035fb 100755 (executable)
@@ -13,7 +13,6 @@ class SetupFunctions
     protected $sIgnoreErrors;
     protected $bEnableDiffUpdates;
     protected $bEnableDebugStatements;
-    protected $bNoPartitions;
     protected $bDrop;
     protected $oDB = null;
     protected $oNominatimCmd;
@@ -51,11 +50,6 @@ class SetupFunctions
         } else {
             $this->bEnableDebugStatements = false;
         }
-        if (isset($aCMDResult['no-partitions'])) {
-            $this->bNoPartitions = $aCMDResult['no-partitions'];
-        } else {
-            $this->bNoPartitions = false;
-        }
         if (isset($aCMDResult['enable-diff-updates'])) {
             $this->bEnableDiffUpdates = $aCMDResult['enable-diff-updates'];
         } else {
@@ -350,9 +344,9 @@ class SetupFunctions
 
     private function pgsqlRunPartitionScript($sTemplate)
     {
-        $sSQL = 'select distinct partition from country_name';
+        $sSQL = 'select distinct partition from country_name order by partition';
         $aPartitions = $this->db()->getCol($sSQL);
-        if (!$this->bNoPartitions) $aPartitions[] = 0;
+        if ($aPartitions[0] != 0) $aPartitions[] = 0;
 
         preg_match_all('#^-- start(.*?)^-- end#ms', $sTemplate, $aMatches, PREG_SET_ORDER);
         foreach ($aMatches as $aMatch) {