From: Sarah Hoffmann Date: Mon, 26 May 2014 20:24:54 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~529 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/f1cbca788531e9eefe5fbbadd7ac0d218f6aa076?hp=6b1f2cb2bc9771f2c65ff3f44855e6bfdf778d90 Merge remote-tracking branch 'upstream/master' --- diff --git a/lib/lib.php b/lib/lib.php index b26038d8..b54023a4 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -45,7 +45,7 @@ if (!$sUserError) $sUserError = $sError; error_log('ERROR: '.$sError); echo $sUserError."\n"; - exit; + exit(-1); } diff --git a/sql/functions.sql b/sql/functions.sql index a6fa20ea..488d340f 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -2503,7 +2503,7 @@ BEGIN CASE WHEN class = 'place' and type = 'postcode' THEN hstore('name', postcode) ELSE name END as name, class, type, admin_level, true as fromarea, true as isaddress, CASE WHEN rank_address = 0 THEN 100 WHEN rank_address = 11 THEN 5 ELSE rank_address END as rank_address, - 0 as distance, calculated_country_code + 0 as distance, calculated_country_code, postcode from placex where place_id = for_place_id LOOP @@ -2514,6 +2514,9 @@ BEGIN IF searchpostcode IS NOT NULL and location.type = 'postcode' THEN location.isaddress := FALSE; END IF; + IF searchpostcode IS NULL and location.postcode IS NOT NULL THEN + searchpostcode := location.postcode; + END IF; IF location.rank_address = 4 AND location.isaddress THEN hadcountry := true; END IF;