diff --git a/ChangeLog b/ChangeLog index f9039d847a..cc22dd53aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ phpMyAdmin - ChangeLog - bug #4080 Overwrite existing file not obeyed - bug #3929 Database-specific privileges are not copied when cloning user - bug #3997 Error handling in case MySQL extension is missing +- bug #4089 Moving Columns will alter column definition 4.0.6.0 (2013-09-05) - bug #4036 Call to undefined function mb_detect_encoding (clarify the doc) diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index bed7869ef2..2d9fab94a2 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -2458,7 +2458,9 @@ function PMA_moveColumns($db, $table) unset($data['Extra']); } $current_timestamp = false; - if ($data['Type'] == 'timestamp' && $data['Default'] == 'CURRENT_TIMESTAMP') { + if (($data['Type'] == 'timestamp' || $data['Type'] == 'datetime') + && $data['Default'] == 'CURRENT_TIMESTAMP' + ) { $current_timestamp = true; } $default_type @@ -2466,7 +2468,7 @@ function PMA_moveColumns($db, $table) ? 'NULL' : ($current_timestamp ? 'CURRENT_TIMESTAMP' - : ($data['Default'] == '' + : ($data['Default'] === null ? 'NONE' : 'USER_DEFINED'));