~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/create_field.cc

  • Committer: Mark Atwood
  • Date: 2011-06-22 20:04:22 UTC
  • mfrom: (2318.6.39 rf)
  • Revision ID: me@mark.atwood.name-20110622200422-609npl456o0e5p32
mergeĀ lp:~olafvdspek/drizzle/refactor13

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
       old_field->getTable()->timestamp_field != old_field ||  /* timestamp field */
110
110
       unireg_check == Field::TIMESTAMP_UN_FIELD))        /* has default val */
111
111
  {
112
 
    ptrdiff_t diff;
113
 
 
114
112
    /* Get the value from default_values */
115
 
    diff= (ptrdiff_t) (orig_field->getTable()->getDefaultValues() - orig_field->getTable()->getInsertRecord());
 
113
    ptrdiff_t diff= (ptrdiff_t) (orig_field->getTable()->getDefaultValues() - orig_field->getTable()->getInsertRecord());
116
114
    orig_field->move_field_offset(diff);        // Points now at default_values
117
115
    if (! orig_field->is_real_null())
118
116
    {
119
 
      char buff[MAX_FIELD_WIDTH], *pos;
120
 
      String tmp(buff, sizeof(buff), charset), *res;
121
 
      res= orig_field->val_str_internal(&tmp);
122
 
      pos= (char*) memory::sql_strmake(res->ptr(), res->length());
 
117
      char buff[MAX_FIELD_WIDTH];
 
118
      String tmp(buff, sizeof(buff), charset);
 
119
      String* res= orig_field->val_str_internal(&tmp);
 
120
      char* pos= (char*) memory::sql_strmake(res->ptr(), res->length());
123
121
      def= new Item_string(pos, res->length(), charset);
124
122
    }
125
123
    orig_field->move_field_offset(-diff);       // Back to getInsertRecord()