~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.cc

  • Committer: Brian Aker
  • Date: 2010-12-18 02:06:13 UTC
  • Revision ID: brian@tangent.org-20101218020613-8lxhcvsy812bu960
Formatting + remove default from switch/case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
454
454
 
455
455
Field *Item_func::tmp_table_field(Table *table)
456
456
{
457
 
  Field *field;
 
457
  Field *field= NULL;
458
458
 
459
459
  switch (result_type()) {
460
460
  case INT_RESULT:
463
463
    else
464
464
      field= new field::Int32(max_length, maybe_null, name, unsigned_flag);
465
465
    break;
 
466
 
466
467
  case REAL_RESULT:
467
468
    field= new Field_double(max_length, maybe_null, name, decimals);
468
469
    break;
 
470
 
469
471
  case STRING_RESULT:
470
472
    return make_string_field(table);
 
473
 
471
474
  case DECIMAL_RESULT:
472
475
    field= new Field_decimal(my_decimal_precision_to_length(decimal_precision(),
473
476
                                                            decimals,
478
481
                             unsigned_flag);
479
482
    break;
480
483
  case ROW_RESULT:
481
 
  default:
482
484
    // This case should never be chosen
483
485
    assert(0);
484
 
    field= 0;
485
486
    break;
486
487
  }
 
488
 
487
489
  if (field)
488
490
    field->init(table);
 
491
 
489
492
  return field;
490
493
}
491
494