~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/func.cc

  • Committer: Brian Aker
  • Date: 2010-10-22 17:44:34 UTC
  • mto: This revision was merged to the branch mainline in revision 1873.
  • Revision ID: brian@tangent.org-20101022174434-q8fjovcpclzqer7n
TableShare is no longer in the house (i.e. we no longer directly have a copy
of it in cursor).

One more bit of the knot now gone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <drizzled/sql_list.h>
24
24
 
25
25
#include <drizzled/function/math/int.h>
26
 
#include <drizzled/field/int32.h>
27
 
#include <drizzled/field/int64.h>
 
26
#include <drizzled/field/int64_t.h>
 
27
#include <drizzled/field/long.h>
28
28
#include <drizzled/field/double.h>
29
29
#include <drizzled/field/decimal.h>
30
30
#include <drizzled/session.h>
454
454
 
455
455
Field *Item_func::tmp_table_field(Table *table)
456
456
{
457
 
  Field *field= NULL;
 
457
  Field *field;
458
458
 
459
459
  switch (result_type()) {
460
460
  case INT_RESULT:
461
461
    if (max_length > MY_INT32_NUM_DECIMAL_DIGITS)
462
 
      field= new field::Int64(max_length, maybe_null, name, unsigned_flag);
 
462
      field= new Field_int64_t(max_length, maybe_null, name, unsigned_flag);
463
463
    else
464
 
      field= new field::Int32(max_length, maybe_null, name, unsigned_flag);
 
464
      field= new Field_long(max_length, maybe_null, name, unsigned_flag);
465
465
    break;
466
 
 
467
466
  case REAL_RESULT:
468
467
    field= new Field_double(max_length, maybe_null, name, decimals);
469
468
    break;
470
 
 
471
469
  case STRING_RESULT:
472
470
    return make_string_field(table);
473
 
 
474
471
  case DECIMAL_RESULT:
475
472
    field= new Field_decimal(my_decimal_precision_to_length(decimal_precision(),
476
473
                                                            decimals,
481
478
                             unsigned_flag);
482
479
    break;
483
480
  case ROW_RESULT:
 
481
  default:
484
482
    // This case should never be chosen
485
483
    assert(0);
 
484
    field= 0;
486
485
    break;
487
486
  }
488
 
 
489
487
  if (field)
490
488
    field->init(table);
491
 
 
492
489
  return field;
493
490
}
494
491