mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
values for TIMESTAMP columns. The solution is not perfect since we just silently ignoring default value for first TIMESTAMP column and properly reflecting this fact in SHOW CREATE TABLE. We can't give a warning or simply support standard syntax (niladic functions as legal value for default) for first field since it is 4.0 tree.
This commit is contained in:
@@ -3056,12 +3056,12 @@ bool add_field_to_list(char *field_name, enum_field_types type,
|
||||
|
||||
if (default_value)
|
||||
{
|
||||
if (type == FIELD_TYPE_TIMESTAMP)
|
||||
{
|
||||
net_printf(&thd->net, ER_INVALID_DEFAULT, field_name);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
else if (default_value->type() == Item::NULL_ITEM)
|
||||
/*
|
||||
We allow specifying value for first TIMESTAMP column
|
||||
altough it is silently ignored. This should be fixed in 4.1
|
||||
(by proper warning or real support for default values)
|
||||
*/
|
||||
if (default_value->type() == Item::NULL_ITEM)
|
||||
{
|
||||
default_value=0;
|
||||
if ((type_modifier & (NOT_NULL_FLAG | AUTO_INCREMENT_FLAG)) ==
|
||||
|
Reference in New Issue
Block a user