~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/date_time_data_types.rst

  • Committer: Lee Bieber
  • Date: 2011-01-15 03:08:27 UTC
  • mfrom: (1994.5.38 doc)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: kalebral@gmail.com-20110115030827-0h9s99kiknrmt9ti
Merge Stewart - some documentation clean up

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        `b` TIMESTAMP(6) NULL DEFAULT NULL
28
28
        ) ENGINE=InnoDB
29
29
 
 
30
FIXME: why the number 6 ?
 
31
 
30
32
You can then use the following (but note that ON DEFAULT/UPDATE CURRENT_TIMESTAMP works with microseconds as well): ::
31
33
 
32
34
        insert into t1 values (1, '2010-01-10 07:32:43.234567');
42
44
DATE
43
45
----
44
46
 
45
 
In Drizzle, valid date inputs begin at 0001-01-01 rather than 0000-00-00, which is not a valid date. NULL is also a valid DATE entry.
 
47
In Drizzle, valid date inputs begin at 0001-01-01 rather than 0000-00-00, which is not a valid date (there was no year 1, there is no month zero and there is no day zero).
46
48
 
47
49
TIME
48
50
----
49
51
 
50
52
Drizzle's TIME data type has a range of 00:00:00 - 24:59:59, while MySQL's TIME data type has a range of -838:59:59 - 838:59:59.
51
53
 
 
54
FIXME: should be to 23hrs. in fact, to be compliant, it should be to at a minimum 23:59:61.999999.
 
55
 
 
56
FIXME: should also mention that this brings Drizzle closer to the SQL standard. Negative time is not meant to be there at all.
 
57
 
52
58
To prevent data loss to this type when converting from MySQL -> Drizzle, the conversion changes TIME to an INT of the number of seconds. For example, 00:00:00 becomes 0, 01:00:00 becomes 3600, and -01:00:00 becomes -3600.