~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 20:08:19 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622200819-bsuuodmmksq23a7l
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
  TYPELIB *result= new (mem_root) TYPELIB;
212
212
  result->count= strings.size();
213
213
  result->name= "";
214
 
  result->type_names= (const char**) mem_root->alloc((sizeof(char*) + sizeof(uint32_t)) * (result->count + 1));
 
214
  result->type_names= (const char**) mem_root.alloc((sizeof(char*) + sizeof(uint32_t)) * (result->count + 1));
215
215
  result->type_lengths= (uint*) (result->type_names + result->count + 1);
216
216
 
217
217
  List<String>::iterator it(strings.begin());
663
663
    Make sure that the blob fits into a Field_varstring which has
664
664
    2-byte lenght.
665
665
  */
666
 
  if (convert_blob_length && convert_blob_length <= Field_varstring::MAX_SIZE &&
667
 
      (org_field->flags & BLOB_FLAG))
 
666
  if (convert_blob_length && convert_blob_length <= Field_varstring::MAX_SIZE && (org_field->flags & BLOB_FLAG))
668
667
  {
669
668
    table->setVariableWidth();
670
 
    new_field= new Field_varstring(convert_blob_length,
671
 
                                   org_field->maybe_null(),
672
 
                                   org_field->field_name,
673
 
                                   org_field->charset());
 
669
    new_field= new Field_varstring(convert_blob_length, org_field->maybe_null(), org_field->field_name, org_field->charset());
674
670
  }
675
671
  else
676
672
  {
677
 
    new_field= org_field->new_field(session->mem_root, table,
678
 
                                    table == org_field->getTable());
 
673
    new_field= org_field->new_field(session->mem_root, table, table == org_field->getTable());
679
674
  }
680
675
  if (new_field)
681
676
  {