]> git.joonet.de Git - adminer.git/commitdiff
Avoid overwriting existing tables when copying tables (bug #642)
authorJakub Vrana <jakub@vrana.cz>
Sat, 27 Oct 2018 16:50:50 +0000 (18:50 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sat, 27 Oct 2018 16:50:50 +0000 (18:50 +0200)
adminer/drivers/mysql.inc.php
changes.txt

index 82ea8fc103eace4b055ca9e9b54e84cb2467562c..e3fff80d6dd4fb9c95ee2db03ca013572bdf52c6 100644 (file)
@@ -810,8 +810,7 @@ if (!defined("DRIVER")) {
                queries("SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'");
                foreach ($tables as $table) {
                        $name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));
-                       if (!queries("\nDROP TABLE IF EXISTS $name")
-                               || !queries("CREATE TABLE $name LIKE " . table($table))
+                       if (!queries("CREATE TABLE $name LIKE " . table($table))
                                || !queries("INSERT INTO $name SELECT * FROM " . table($table))
                        ) {
                                return false;
@@ -826,9 +825,7 @@ if (!defined("DRIVER")) {
                foreach ($views as $table) {
                        $name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));
                        $view = view($table);
-                       if (!queries("DROP VIEW IF EXISTS $name")
-                               || !queries("CREATE VIEW $name AS $view[select]") //! USE to avoid db.table
-                       ) {
+                       if (!queries("CREATE VIEW $name AS $view[select]")) { //! USE to avoid db.table
                                return false;
                        }
                }
index d76eb9cf4018a9bb32abced677af1a635c77ab45..6cdbe4d567644bdc96bc2c9a9f0f21070ab59b60 100644 (file)
@@ -4,6 +4,7 @@ Warn when using password with leading or trailing spaces
 Hide import from server if no path
 Fix inline editing of empty cells (regression from 4.6.3)
 Allow adding more than two indexes and forign key columns at a time (regression from 4.4.0)
+Avoid overwriting existing tables when copying tables (bug #642)
 Fix function change with set data type
 Increase username maxlength to 80 (bug #623)
 Make maxlength in all fields a soft limit