From: Janusz Dobrowolski Date: Wed, 21 Oct 2009 16:27:05 +0000 (+0000) Subject: Fixed refs table upgrade to avoid duplicate record errors. X-Git-Tag: v2.4.2~19^2~1107 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=e3423fc85f1f3557ed45fefc8089afbf7d1a2731;p=fa-stable.git Fixed refs table upgrade to avoid duplicate record errors. --- diff --git a/sql/alter2.2.php b/sql/alter2.2.php index a1a4b1d5..457850ff 100644 --- a/sql/alter2.2.php +++ b/sql/alter2.2.php @@ -56,7 +56,7 @@ class fa2_2 { $info = get_systype_db_info($typeno); if ($info == null || $info[3] == null) continue; $tbl = str_replace(TB_PREF, $pref, $info[0]); - $sql = "SELECT {$info[2]} as id,{$info[3]} as ref FROM $tbl"; + $sql = "SELECT DISTINCT {$info[2]} as id,{$info[3]} as ref FROM $tbl"; if ($info[1]) $sql .= " WHERE {$info[1]}=$typeno"; $result = db_query($sql);