~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/item_sum.cc

  • Committer: Patrick Galbraith
  • Date: 2008-07-28 01:47:41 UTC
  • mto: (212.1.8 codestyle)
  • mto: This revision was merged to the branch mainline in revision 217.
  • Revision ID: patg@ishvara-20080728014741-yoasv5trt1ef9rha
Renamed FIELD_TYPE to DRIZZLE_TYPE

Show diffs side-by-side

added added

removed removed

Lines of Context:
696
696
    fields creations separately.
697
697
  */
698
698
  switch (args[0]->field_type()) {
699
 
  case FIELD_TYPE_NEWDATE:
 
699
  case DRIZZLE_TYPE_NEWDATE:
700
700
    field= new Field_newdate(maybe_null, name, collation.collation);
701
701
    break;
702
 
  case FIELD_TYPE_TIME:
 
702
  case DRIZZLE_TYPE_TIME:
703
703
    field= new Field_time(maybe_null, name, collation.collation);
704
704
    break;
705
 
  case FIELD_TYPE_TIMESTAMP:
706
 
  case FIELD_TYPE_DATETIME:
 
705
  case DRIZZLE_TYPE_TIMESTAMP:
 
706
  case DRIZZLE_TYPE_DATETIME:
707
707
    field= new Field_datetime(maybe_null, name, collation.collation);
708
708
    break;
709
709
  default:
936
936
  case STRING_RESULT:
937
937
  case REAL_RESULT:
938
938
    val.traits= Hybrid_type_traits::instance();
939
 
    table_field_type= FIELD_TYPE_DOUBLE;
 
939
    table_field_type= DRIZZLE_TYPE_DOUBLE;
940
940
    break;
941
941
  case INT_RESULT:
942
942
  /*
946
946
    calculations. The range of int64 is enough to hold sum 2^32 distinct
947
947
    integers each <= 2^32.
948
948
  */
949
 
  if (table_field_type >= FIELD_TYPE_TINY && table_field_type <= FIELD_TYPE_LONG)
 
949
  if (table_field_type >= DRIZZLE_TYPE_TINY && table_field_type <= DRIZZLE_TYPE_LONG)
950
950
  {
951
951
    val.traits= Hybrid_type_traits_fast_decimal::instance();
952
952
    break;
953
953
  }
954
 
  table_field_type= FIELD_TYPE_LONGLONG;
 
954
  table_field_type= DRIZZLE_TYPE_LONGLONG;
955
955
  /* fallthrough */
956
956
  case DECIMAL_RESULT:
957
957
    val.traits= Hybrid_type_traits_decimal::instance();
958
 
    if (table_field_type != FIELD_TYPE_LONGLONG)
959
 
      table_field_type= FIELD_TYPE_NEWDECIMAL;
 
958
    if (table_field_type != DRIZZLE_TYPE_LONGLONG)
 
959
      table_field_type= DRIZZLE_TYPE_NEWDECIMAL;
960
960
    break;
961
961
  case ROW_RESULT:
962
962
  default:
2582
2582
      Field *f= *field;
2583
2583
      enum enum_field_types f_type= f->type();
2584
2584
      tree_key_length+= f->pack_length();
2585
 
      if ((f_type == FIELD_TYPE_VARCHAR) || (!f->binary() && (f_type == FIELD_TYPE_STRING)))
 
2585
      if ((f_type == DRIZZLE_TYPE_VARCHAR) || (!f->binary() && (f_type == DRIZZLE_TYPE_STRING)))
2586
2586
      {
2587
2587
        all_binary= false;
2588
2588
        break;