summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-05-18 17:30:44 +0000
committerfisharebest <fisharebest@gmail.com>2010-05-18 17:30:44 +0000
commite232fc0d7a692f38d64700f6b0e4ad2d5f12dc59 (patch)
tree397a5add8e56107aaa6387620428511dc938b0d2 /includes
parentc18aabe3dc1bd37d217dc3c1b3010449b1feedf1 (diff)
downloadwebtrees-e232fc0d7a692f38d64700f6b0e4ad2d5f12dc59.tar.gz
webtrees-e232fc0d7a692f38d64700f6b0e4ad2d5f12dc59.tar.bz2
webtrees-e232fc0d7a692f38d64700f6b0e4ad2d5f12dc59.zip
#582226 Near duplicate place names cause MySQL duplicate primary key error on import
Diffstat (limited to 'includes')
-rw-r--r--includes/functions/functions_import.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/functions/functions_import.php b/includes/functions/functions_import.php
index a064bc6afa..eec7b75d03 100644
--- a/includes/functions/functions_import.php
+++ b/includes/functions/functions_import.php
@@ -765,8 +765,12 @@ function update_places($gid, $ged_id, $gedrec) {
static $sql_insert_places=null;
static $sql_select_places=null;
if (!$sql_insert_placelinks) {
+ // Use INSERT IGNORE as a (temporary) fix for https://bugs.launchpad.net/webtrees/+bug/582226
+ // It ignores places that utf8_unicode_ci consider to be the same (i.e. accents).
+ // Of course, there almost certainly are such places .....
+ // We need a better solution that attaches multiple names to single places
$sql_insert_placelinks=WT_DB::prepare(
- "INSERT INTO {$TBLPREFIX}placelinks (pl_p_id, pl_gid, pl_file) VALUES (?,?,?)"
+ "INSERT IGNORE INTO {$TBLPREFIX}placelinks (pl_p_id, pl_gid, pl_file) VALUES (?,?,?)"
);
$sql_insert_places=WT_DB::prepare(
"INSERT INTO {$TBLPREFIX}places (p_id, p_place, p_level, p_parent_id, p_file, p_std_soundex, p_dm_soundex) VALUES (?,?,?,?,?,?,?)"