~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/create_field.cc

Merge Stewart

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
#include "drizzled/field/timestamp.h"
43
43
#include "drizzled/field/datetime.h"
44
44
#include "drizzled/field/varstring.h"
 
45
#include "drizzled/temporal.h"
45
46
 
46
47
#include <algorithm>
47
48
 
295
296
    case DRIZZLE_TYPE_TIMESTAMP:
296
297
      if (!fld_length)
297
298
      {
298
 
        /* Compressed date YYYYMMDDHHMMSS */
299
 
        length= MAX_DATETIME_COMPRESSED_WIDTH;
300
 
      }
301
 
      else if (length != MAX_DATETIME_WIDTH)
302
 
      {
303
 
        /*
304
 
          We support only even TIMESTAMP lengths less or equal than 14
305
 
          and 19 as length of 4.1 compatible representation.
306
 
        */
307
 
        length= ((length+1)/2)*2; /* purecov: inspected */
308
 
        length= min(length, (uint32_t)MAX_DATETIME_COMPRESSED_WIDTH); /* purecov: inspected */
309
 
      }
 
299
        length= drizzled::DateTime::MAX_STRING_LENGTH;
 
300
      }
 
301
 
 
302
      /* This assert() should be correct due to absence of length
 
303
         specifiers for timestamp. Previous manipulation also wasn't
 
304
         ever called (from examining lcov)
 
305
      */
 
306
      assert(length == (uint32_t)drizzled::DateTime::MAX_STRING_LENGTH);
 
307
 
310
308
      flags|= UNSIGNED_FLAG;
311
309
      if (fld_default_value)
312
310
      {
347
345
      }
348
346
      break;
349
347
    case DRIZZLE_TYPE_DATE:
350
 
      length= 10;
 
348
      length= drizzled::Date::MAX_STRING_LENGTH;
351
349
      break;
352
350
    case DRIZZLE_TYPE_DATETIME:
353
 
      length= MAX_DATETIME_WIDTH;
 
351
      length= drizzled::DateTime::MAX_STRING_LENGTH;
354
352
      break;
355
353
    case DRIZZLE_TYPE_ENUM:
356
354
      {