~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/instance/base.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 14:35:11 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622143511-bqcqg1tho8v0fn0d
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
633
633
  for (int indx= 0; indx < table.indexes_size(); indx++)
634
634
    key_parts+= table.indexes(indx).index_part_size();
635
635
 
636
 
  key_info= (KeyInfo*) alloc_root( table.indexes_size() * sizeof(KeyInfo) +key_parts*sizeof(KeyPartInfo));
 
636
  key_info= (KeyInfo*) alloc(table.indexes_size() * sizeof(KeyInfo) +key_parts*sizeof(KeyPartInfo));
637
637
 
638
638
  KeyPartInfo *key_part;
639
639
 
641
641
    (key_info+table.indexes_size());
642
642
 
643
643
 
644
 
  ulong *rec_per_key= (ulong*) alloc_root(sizeof(ulong*)*key_parts);
 
644
  ulong *rec_per_key= (ulong*) alloc(sizeof(ulong*)*key_parts);
645
645
 
646
646
  KeyInfo* keyinfo= key_info;
647
647
  for (int keynr= 0; keynr < table.indexes_size(); keynr++, keyinfo++)
922
922
 
923
923
    TYPELIB *t= (&intervals[interval_nr]);
924
924
 
925
 
    t->type_names= (const char**)alloc_root((field_options.field_value_size() + 1) * sizeof(char*));
 
925
    t->type_names= (const char**)alloc((field_options.field_value_size() + 1) * sizeof(char*));
926
926
 
927
 
    t->type_lengths= (unsigned int*) alloc_root((field_options.field_value_size() + 1) * sizeof(unsigned int));
 
927
    t->type_lengths= (unsigned int*)alloc((field_options.field_value_size() + 1) * sizeof(unsigned int));
928
928
 
929
929
    t->type_names[field_options.field_value_size()]= NULL;
930
930
    t->type_lengths[field_options.field_value_size()]= 0;
1637
1637
 
1638
1638
  records++;
1639
1639
 
1640
 
  record= (unsigned char*) outparam.alloc_root(rec_buff_length * records);
 
1640
  record= (unsigned char*) outparam.alloc(rec_buff_length * records);
1641
1641
 
1642
1642
  if (records == 0)
1643
1643
  {
1671
1671
    memcpy(outparam.getUpdateRecord(), getDefaultValues(), null_bytes);
1672
1672
  }
1673
1673
 
1674
 
  field_ptr = (Field **) outparam.alloc_root( (uint32_t) ((_field_size+1)* sizeof(Field*)));
 
1674
  field_ptr = (Field **) outparam.alloc((_field_size+1) * sizeof(Field*));
1675
1675
 
1676
1676
  outparam.setFields(field_ptr);
1677
1677
 
1700
1700
    KeyPartInfo *key_part;
1701
1701
    uint32_t n_length;
1702
1702
    n_length= keys*sizeof(KeyInfo) + key_parts*sizeof(KeyPartInfo);
1703
 
    local_key_info= (KeyInfo*) outparam.alloc_root(n_length);
 
1703
    local_key_info= (KeyInfo*) outparam.alloc(n_length);
1704
1704
    outparam.key_info= local_key_info;
1705
1705
    key_part= (reinterpret_cast<KeyPartInfo*> (local_key_info+keys));
1706
1706