~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/datetime.cc

  • Committer: Brian Aker
  • Date: 2009-07-11 05:59:19 UTC
  • mfrom: (1089.1.9 merge)
  • Revision ID: brian@gaz-20090711055919-m4px3crrdgta5lie
Collection of patches from new-cleanup (includes asserts for field in debug)

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
                          uint32_t len,
41
41
                          const CHARSET_INFO * const )
42
42
{
 
43
  ASSERT_COLUMN_MARKED_FOR_WRITE;
43
44
  /* 
44
45
   * Try to create a DateTime from the supplied string.  Throw an error
45
46
   * if unable to create a valid DateTime.  
67
68
 
68
69
int Field_datetime::store(double from)
69
70
{
 
71
  ASSERT_COLUMN_MARKED_FOR_WRITE;
70
72
  if (from < 0.0 || from > 99991231235959.0)
71
73
  {
72
74
    /* Convert the double to a string using stringstream */
83
85
 
84
86
int Field_datetime::store(int64_t from, bool)
85
87
{
 
88
  ASSERT_COLUMN_MARKED_FOR_WRITE;
86
89
  /* 
87
90
   * Try to create a DateTime from the supplied integer.  Throw an error
88
91
   * if unable to create a valid DateTime.  
162
165
int64_t Field_datetime::val_int(void)
163
166
{
164
167
  int64_t j;
 
168
 
 
169
  ASSERT_COLUMN_MARKED_FOR_READ;
 
170
 
165
171
#ifdef WORDS_BIGENDIAN
166
172
  if (table && table->s->db_low_byte_first)
167
173
    j=sint8korr(ptr);
179
185
  val_buffer->length(drizzled::DateTime::MAX_STRING_LENGTH);
180
186
  int64_t tmp;
181
187
 
 
188
  ASSERT_COLUMN_MARKED_FOR_READ;
 
189
 
182
190
#ifdef WORDS_BIGENDIAN
183
191
  if (table && table->s->db_low_byte_first)
184
192
    tmp=sint8korr(ptr);