~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:19:44 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622141944-na0vb0uv30n6u55z
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
530
530
    identifier::Table::build_table_filename(_path, db.str, table_name.str, false);
531
531
  }
532
532
 
533
 
  if ((path_buff= (char *)mem_root.alloc_root(_path.length() + 1)))
534
 
  {
535
 
    setPath(path_buff, _path.length());
536
 
    strcpy(path_buff, _path.c_str());
537
 
    setNormalizedPath(path_buff, _path.length());
 
533
  path_buff= (char *)mem_root.alloc(_path.length() + 1);
 
534
  setPath(path_buff, _path.length());
 
535
  strcpy(path_buff, _path.c_str());
 
536
  setNormalizedPath(path_buff, _path.length());
538
537
 
539
 
    version= g_refresh_version;
540
 
  }
541
 
  else
542
 
  {
543
 
    assert(0); // We should throw here.
544
 
    abort();
545
 
  }
 
538
  version= g_refresh_version;
546
539
}
547
540
 
548
541
void TableShare::init(const char *new_table_name,
1644
1637
 
1645
1638
  records++;
1646
1639
 
1647
 
  if (!(record= (unsigned char*) outparam.alloc_root(rec_buff_length * records)))
1648
 
    return local_error;
 
1640
  record= (unsigned char*) outparam.alloc_root(rec_buff_length * records);
1649
1641
 
1650
1642
  if (records == 0)
1651
1643
  {
1679
1671
    memcpy(outparam.getUpdateRecord(), getDefaultValues(), null_bytes);
1680
1672
  }
1681
1673
 
1682
 
  if (!(field_ptr = (Field **) outparam.alloc_root( (uint32_t) ((_field_size+1)* sizeof(Field*)))))
1683
 
  {
1684
 
    return local_error;
1685
 
  }
 
1674
  field_ptr = (Field **) outparam.alloc_root( (uint32_t) ((_field_size+1)* sizeof(Field*)));
1686
1675
 
1687
1676
  outparam.setFields(field_ptr);
1688
1677
 
1711
1700
    KeyPartInfo *key_part;
1712
1701
    uint32_t n_length;
1713
1702
    n_length= keys*sizeof(KeyInfo) + key_parts*sizeof(KeyPartInfo);
1714
 
    if (!(local_key_info= (KeyInfo*) outparam.alloc_root(n_length)))
1715
 
      return local_error;
 
1703
    local_key_info= (KeyInfo*) outparam.alloc_root(n_length);
1716
1704
    outparam.key_info= local_key_info;
1717
1705
    key_part= (reinterpret_cast<KeyPartInfo*> (local_key_info+keys));
1718
1706