summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 98de224f900..921148e8f0f 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -4387,6 +4387,24 @@ Field_timestamp::Field_timestamp(char *ptr_arg, uint32 len_arg,
}
+Field_timestamp::Field_timestamp(bool maybe_null_arg,
+ const char *field_name_arg,
+ struct st_table *table_arg, CHARSET_INFO *cs)
+ :Field_str((char*) 0, 19, maybe_null_arg ? (uchar*) "": 0, 0,
+ NONE, field_name_arg, table_arg, cs)
+{
+ /* For 4.0 MYD and 4.0 InnoDB compatibility */
+ flags|= ZEROFILL_FLAG | UNSIGNED_FLAG;
+ if (table && !table->timestamp_field &&
+ unireg_check != NONE)
+ {
+ /* This timestamp has auto-update */
+ table->timestamp_field= this;
+ flags|=TIMESTAMP_FLAG;
+ }
+}
+
+
/*
Get auto-set type for TIMESTAMP field.