Merge pull request #4051 from annando/remove-duplicates
Fix for duplicate removal in the database structure check
This commit is contained in:
commit
8b4c4572d3
1 changed files with 2 additions and 2 deletions
|
@ -385,7 +385,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
||||||
|
|
||||||
$field_list = '';
|
$field_list = '';
|
||||||
if ($is_unique && $ignore == '') {
|
if ($is_unique && $ignore == '') {
|
||||||
foreach ($structure['fields'] AS $fieldname => $parameters) {
|
foreach ($database[$name]["fields"] AS $fieldname => $parameters) {
|
||||||
$field_list .= 'ANY_VALUE(`' . $fieldname . '`),';
|
$field_list .= 'ANY_VALUE(`' . $fieldname . '`),';
|
||||||
}
|
}
|
||||||
$field_list = rtrim($field_list, ',');
|
$field_list = rtrim($field_list, ',');
|
||||||
|
@ -408,7 +408,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
||||||
if ($ignore != "") {
|
if ($ignore != "") {
|
||||||
echo "SET session old_alter_table=0;\n";
|
echo "SET session old_alter_table=0;\n";
|
||||||
} else {
|
} else {
|
||||||
echo "INSERT INTO `".$temp_name."` SELECT ".$field_list." FROM `".$name."`".$group_by.";\n";
|
echo "INSERT INTO `".$temp_name."` SELECT ".dba::any_value_fallback($field_list)." FROM `".$name."`".$group_by.";\n";
|
||||||
echo "DROP TABLE `".$name."`;\n";
|
echo "DROP TABLE `".$name."`;\n";
|
||||||
echo "RENAME TABLE `".$temp_name."` TO `".$name."`;\n";
|
echo "RENAME TABLE `".$temp_name."` TO `".$name."`;\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue