1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

Fix for bugs #1885, #2464, #2539. Proper handling of default

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:
dlenev@mysql.com
2004-01-30 15:13:19 +03:00
parent ea789c173f
commit e3816cb461
6 changed files with 98 additions and 16 deletions

View File

@@ -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)) ==