~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/create_field.cc

  • Committer: Brian Aker
  • Date: 2011-01-04 04:05:27 UTC
  • mto: (2057.2.1 clean)
  • mto: This revision was merged to the branch mainline in revision 2064.
  • Revision ID: brian@tangent.org-20110104040527-w2xglgjmlet2hy1p
First pass on micro timestamp.

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
  if (!(flags & (NO_DEFAULT_VALUE_FLAG)) &&
103
103
      !(flags & AUTO_INCREMENT_FLAG) &&
104
104
      old_field->ptr && orig_field &&
105
 
      (sql_type != DRIZZLE_TYPE_TIMESTAMP ||                /* set def only if */
 
105
      (not old_field->is_timestamp() ||                /* set def only if */
106
106
       old_field->getTable()->timestamp_field != old_field ||  /* timestamp field */
107
107
       unireg_check == Field::TIMESTAMP_UN_FIELD))        /* has default val */
108
108
  {
227
227
    it is NOT NULL, not an AUTO_INCREMENT field and not a TIMESTAMP.
228
228
  */
229
229
  if (!fld_default_value && !(fld_type_modifier & AUTO_INCREMENT_FLAG) &&
230
 
      (fld_type_modifier & NOT_NULL_FLAG) && fld_type != DRIZZLE_TYPE_TIMESTAMP)
 
230
      (fld_type_modifier & NOT_NULL_FLAG) && (fld_type != DRIZZLE_TYPE_TIMESTAMP and fld_type != DRIZZLE_TYPE_MICROTIME))
 
231
  {
231
232
    flags|= NO_DEFAULT_VALUE_FLAG;
 
233
  }
232
234
 
233
235
  if (fld_length && !(length= (uint32_t) atoi(fld_length)))
234
236
    fld_length= 0;
300
302
        return(true);
301
303
      }
302
304
      break;
 
305
    case DRIZZLE_TYPE_MICROTIME:
303
306
    case DRIZZLE_TYPE_TIMESTAMP:
304
 
      if (!fld_length)
 
307
      if (not fld_length)
305
308
      {
306
309
        length= DateTime::MAX_STRING_LENGTH;
307
310
      }
328
331
          def= 0;
329
332
        }
330
333
        else
 
334
        {
331
335
          unireg_check= (fld_on_update_value ? Field::TIMESTAMP_UN_FIELD:
332
 
                                              Field::NONE);
 
336
                         Field::NONE);
 
337
        }
333
338
      }
334
339
      else
335
340
      {