diff --git a/ChangeLog b/ChangeLog index ff529fc67..a7a75273d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,7 +8,8 @@ $Source$ 2005-04-01 Marc Delisle * tbl_addfield.php: TIMESTAMP options support * libraries/common.lib.php: DEFAULT CURRENT_TIMESTAMP is only - for TIMESTAMP (bug when changing from a TIMESTAMP to a non-TIMESTAMP type) + for TIMESTAMP (bug when changing from a TIMESTAMP to a non-TIMESTAMP type) * (same): bug #1163595, problem 4: a TIMESTAMP must be explicitely + set to NULL to have the NULL attribute 2005-03-31 Alexander M. Turek * left.php: Undefined offset (Bug #1174045). diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 1de0a957c..45cab2201 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2533,6 +2533,12 @@ if (typeof(document.getElementById) != 'undefined' $query .= PMA_generateCharsetQueryPart($collation); } + if (!empty($null)) { + $query .= ' NOT NULL'; + } else { + $query .= ' NULL'; + } + if ($default_current_timestamp && strtoupper($full_field_type) == 'TIMESTAMP') { $query .= ' DEFAULT CURRENT_TIMESTAMP'; } elseif (!empty($default)) { @@ -2543,9 +2549,6 @@ if (typeof(document.getElementById) != 'undefined' } } - if (!empty($null)) { - $query .= ' NOT NULL'; - } if (!empty($extra)) { $query .= ' ' . $extra; }