~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

Merged Nathan (and added a valgrind suppression)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1649
1649
} /* open_table_error */
1650
1650
 
1651
1651
 
1652
 
TYPELIB *typelib(MEM_ROOT *mem_root, vector<String*> &strings)
 
1652
TYPELIB *typelib(MEM_ROOT *mem_root, List<String> &strings)
1653
1653
{
1654
1654
  TYPELIB *result= (TYPELIB*) alloc_root(mem_root, sizeof(TYPELIB));
1655
1655
  if (!result)
1656
1656
    return 0;
1657
 
  result->count= strings.size();
 
1657
  result->count= strings.elements;
1658
1658
  result->name= "";
1659
1659
  uint32_t nbytes= (sizeof(char*) + sizeof(uint32_t)) * (result->count + 1);
1660
1660
  
1663
1663
    
1664
1664
  result->type_lengths= (uint*) (result->type_names + result->count + 1);
1665
1665
 
1666
 
  vector<String*>::iterator it= strings.begin();
1667
 
  for (int i= 0; it != strings.end(); ++it, ++i )
 
1666
  List_iterator<String> it(strings);
 
1667
  String *tmp;
 
1668
  for (uint32_t i= 0; (tmp= it++); i++)
1668
1669
  {
1669
 
    result->type_names[i]= (*it)->c_ptr();
1670
 
    result->type_lengths[i]= (*it)->length();
 
1670
    result->type_names[i]= tmp->ptr();
 
1671
    result->type_lengths[i]= tmp->length();
1671
1672
  }
1672
1673
 
1673
1674
  result->type_names[result->count]= 0;   // End marker