~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/create_field.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
 
70
70
  /* Fix if the original table had 4 byte pointer blobs */
71
71
  if (flags & BLOB_FLAG)
72
 
    pack_length= (pack_length - old_field->table->s->blob_ptr_size + portable_sizeof_char_ptr);
 
72
    pack_length= (pack_length - old_field->getTable()->getShare()->blob_ptr_size + portable_sizeof_char_ptr);
73
73
 
74
74
  switch (sql_type) 
75
75
  {
94
94
  def= 0;
95
95
  char_length= length;
96
96
 
97
 
  if (!(flags & (NO_DEFAULT_VALUE_FLAG )) &&
 
97
  if (!(flags & (NO_DEFAULT_VALUE_FLAG)) &&
 
98
      !(flags & AUTO_INCREMENT_FLAG) &&
98
99
      old_field->ptr && orig_field &&
99
100
      (sql_type != DRIZZLE_TYPE_TIMESTAMP ||                /* set def only if */
100
 
       old_field->table->timestamp_field != old_field ||  /* timestamp field */
 
101
       old_field->getTable()->timestamp_field != old_field ||  /* timestamp field */
101
102
       unireg_check == Field::TIMESTAMP_UN_FIELD))        /* has default val */
102
103
  {
103
104
    ptrdiff_t diff;
104
105
 
105
106
    /* Get the value from default_values */
106
 
    diff= (ptrdiff_t) (orig_field->table->s->default_values - orig_field->table->record[0]);
 
107
    diff= (ptrdiff_t) (orig_field->getTable()->getDefaultValues() - orig_field->getTable()->getInsertRecord());
107
108
    orig_field->move_field_offset(diff);        // Points now at default_values
108
109
    if (! orig_field->is_real_null())
109
110
    {
113
114
      pos= (char*) memory::sql_strmake(res->ptr(), res->length());
114
115
      def= new Item_string(pos, res->length(), charset);
115
116
    }
116
 
    orig_field->move_field_offset(-diff);       // Back to record[0]
 
117
    orig_field->move_field_offset(-diff);       // Back to getInsertRecord()
117
118
  }
118
119
}
119
120
 
164
165
  interval= 0;
165
166
  charset= &my_charset_bin;
166
167
  decimals= decimals_arg & FIELDFLAG_MAX_DEC;
167
 
  pack_flag= 0;
168
168
 
169
169
  if (! maybe_null)
170
170
    flags= NOT_NULL_FLAG;
355
355
    case DRIZZLE_TYPE_ENUM:
356
356
      {
357
357
        /* Should be safe. */
358
 
        pack_length= get_enum_pack_length(fld_interval_list->elements);
 
358
        pack_length= 4;
359
359
 
360
360
        List_iterator<String> it(*fld_interval_list);
361
361
        String *tmp;