mysql/core_cities_merge.sql
authorEdward <edward@roojs.com>
Thu, 26 Jun 2014 10:16:02 +0000 (18:16 +0800)
committerEdward <edward@roojs.com>
Thu, 26 Jun 2014 10:16:02 +0000 (18:16 +0800)
mysql/core_cities_merge.sql

index 60c1d72..4b03873 100644 (file)
@@ -246,6 +246,8 @@ CREATE FUNCTION core_country_locations()  RETURNS INT DETERMINISTIC
         DECLARE v_country_iso_code INT DEFAULT 0;
         DECLARE v_country_name INT DEFAULT 0;
 
+        DECLARE v_id INT DEFAULT 0;
+
         DECLARE csr CURSOR FOR 
         SELECT 
             geoname_id,continent_code,continent_name,country_iso_code,country_name
@@ -262,8 +264,6 @@ CREATE FUNCTION core_country_locations()  RETURNS INT DETERMINISTIC
             
             SET v_count = v_count + 1;
 
-            SET v_id_tmp = 0;
-
             SELECT id INTO v_id_tmp FROM core_geoip_country WHERE code = v_iso;
 
             IF(v_id_tmp = 0) THEN