~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-08-15 18:21:46 UTC
  • mto: This revision was merged to the branch mainline in revision 2408.
  • Revision ID: olafvdspek@gmail.com-20110815182146-1pg6jf39vwtff8o8
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
521
521
  }
522
522
 
523
523
  char* path_buff= mem_root.strdup(_path);
524
 
  setPath(path_buff, _path.length());
525
 
  setNormalizedPath(path_buff, _path.length());
 
524
  path= str_ref(path_buff, _path.length());
 
525
  normalized_path= str_ref(path_buff, _path.length());
526
526
 
527
527
  version= g_refresh_version;
528
528
}
529
529
 
530
530
void TableShare::init(const char *new_table_name, const char *new_path)
531
531
{
532
 
 
533
532
  table_category= TABLE_CATEGORY_TEMPORARY;
534
533
  tmp_table= message::Table::INTERNAL;
535
534
  db= str_ref("");
615
614
  for (int indx= 0; indx < table.indexes_size(); indx++)
616
615
    key_parts+= table.indexes(indx).index_part_size();
617
616
 
618
 
  key_info= (KeyInfo*) alloc(table.indexes_size() * sizeof(KeyInfo) +key_parts*sizeof(KeyPartInfo));
 
617
  key_info= (KeyInfo*) mem().alloc(table.indexes_size() * sizeof(KeyInfo) +key_parts*sizeof(KeyPartInfo));
619
618
 
620
619
  KeyPartInfo *key_part;
621
620
 
623
622
    (key_info+table.indexes_size());
624
623
 
625
624
 
626
 
  ulong *rec_per_key= (ulong*) alloc(sizeof(ulong*)*key_parts);
 
625
  ulong *rec_per_key= (ulong*) mem().alloc(sizeof(ulong*)*key_parts);
627
626
 
628
627
  KeyInfo* keyinfo= key_info;
629
628
  for (int keynr= 0; keynr < table.indexes_size(); keynr++, keyinfo++)
904
903
 
905
904
    TYPELIB *t= (&intervals[interval_nr]);
906
905
 
907
 
    t->type_names= (const char**)alloc((field_options.field_value_size() + 1) * sizeof(char*));
908
 
 
909
 
    t->type_lengths= (unsigned int*)alloc((field_options.field_value_size() + 1) * sizeof(unsigned int));
 
906
    t->type_names= (const char**)mem().alloc((field_options.field_value_size() + 1) * sizeof(char*));
 
907
    t->type_lengths= (unsigned int*)mem().alloc((field_options.field_value_size() + 1) * sizeof(unsigned int));
910
908
 
911
909
    t->type_names[field_options.field_value_size()]= NULL;
912
910
    t->type_lengths[field_options.field_value_size()]= 0;