]> git.mxchange.org Git - friendica.git/commitdiff
Fix for duplicate removal in the database structure check
authorMichael <heluecht@pirati.ca>
Mon, 11 Dec 2017 21:53:52 +0000 (21:53 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 11 Dec 2017 21:53:52 +0000 (21:53 +0000)
include/dbstructure.php

index dae54835f0ad585d3390682257138744568c2bff..5e60d38b5f91e5ee82dce2902cc0dc7e41565bb1 100644 (file)
@@ -385,7 +385,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
 
                        $field_list = '';
                        if ($is_unique && $ignore == '') {
-                               foreach ($structure['fields'] AS $fieldname => $parameters) {
+                               foreach ($database[$name]["fields"] AS $fieldname => $parameters) {
                                        $field_list .= 'ANY_VALUE(`' . $fieldname . '`),';
                                }
                                $field_list = rtrim($field_list, ',');
@@ -408,7 +408,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
                                        if ($ignore != "") {
                                                echo "SET session old_alter_table=0;\n";
                                        } 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 "RENAME TABLE `".$temp_name."` TO `".$name."`;\n";
                                        }