diff options
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc index 2fb60ec1fd9..61c0a71b742 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8468,7 +8468,10 @@ create_field::create_field(Field *old_field,Field *orig_field) def=0; if (!(flags & (NO_DEFAULT_VALUE_FLAG | BLOB_FLAG)) && !old_field->is_real_null() && - old_field->ptr && orig_field) + old_field->ptr && orig_field && + (sql_type != FIELD_TYPE_TIMESTAMP || /* set def only if */ + old_field->table->timestamp_field != old_field || /* timestamp field */ + unireg_check == Field::TIMESTAMP_UN_FIELD)) /* has default val */ { char buff[MAX_FIELD_WIDTH],*pos; String tmp(buff,sizeof(buff), charset), *res; |