~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Lee Bieber
  • Date: 2010-12-09 19:40:05 UTC
  • mfrom: (1991.1.2 build)
  • Revision ID: kalebral@gmail.com-20101209194005-hpxailmc9afmvelh
Remove disabling of drizzleslap test
Merge Shrews - fix bug 683147: Large row affecting statements failing mid-transaction may not get undone properly by TransactionServices if part of multi-message Transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
192
  for (table_ptr= select_lex->leaf_tables;
193
193
       table_ptr;
194
194
       table_ptr= table_ptr->next_leaf)
195
 
  {
196
195
    tables++;
197
 
  }
198
 
 
199
196
 
200
197
  if (setup_wild(session, fields_list, &all_fields, wild_num) ||
201
198
      select_lex->setup_ref_array(session, og_num) ||
3016
3013
      case REAL_RESULT:
3017
3014
        key_length+= sizeof(double);
3018
3015
        break;
3019
 
 
3020
3016
      case INT_RESULT:
3021
3017
        key_length+= sizeof(int64_t);
3022
3018
        break;
3023
 
 
3024
3019
      case DECIMAL_RESULT:
3025
3020
        key_length+= my_decimal_get_binary_size(group_item->max_length -
3026
3021
                                                (group_item->decimals ? 1 : 0),
3027
3022
                                                group_item->decimals);
3028
3023
        break;
3029
 
 
3030
3024
      case STRING_RESULT:
3031
 
        {
3032
 
          enum enum_field_types type= group_item->field_type();
 
3025
      {
 
3026
        enum enum_field_types type= group_item->field_type();
 
3027
        /*
 
3028
          As items represented as DATE/TIME fields in the group buffer
 
3029
          have STRING_RESULT result type, we increase the length
 
3030
          by 8 as maximum pack length of such fields.
 
3031
        */
 
3032
        if (type == DRIZZLE_TYPE_DATE ||
 
3033
            type == DRIZZLE_TYPE_DATETIME ||
 
3034
            type == DRIZZLE_TYPE_TIMESTAMP)
 
3035
        {
 
3036
          key_length+= 8;
 
3037
        }
 
3038
        else
 
3039
        {
3033
3040
          /*
3034
 
            As items represented as DATE/TIME fields in the group buffer
3035
 
            have STRING_RESULT result type, we increase the length
3036
 
            by 8 as maximum pack length of such fields.
 
3041
            Group strings are taken as varstrings and require an length field.
 
3042
            A field is not yet created by create_tmp_field()
 
3043
            and the sizes should match up.
3037
3044
          */
3038
 
          if (type == DRIZZLE_TYPE_DATE ||
3039
 
              type == DRIZZLE_TYPE_DATETIME ||
3040
 
              type == DRIZZLE_TYPE_TIMESTAMP)
3041
 
          {
3042
 
            key_length+= 8;
3043
 
          }
3044
 
          else
3045
 
          {
3046
 
            /*
3047
 
              Group strings are taken as varstrings and require an length field.
3048
 
              A field is not yet created by create_tmp_field()
3049
 
              and the sizes should match up.
3050
 
            */
3051
 
            key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH;
3052
 
          }
3053
 
          break;
 
3045
          key_length+= group_item->max_length + HA_KEY_BLOB_LENGTH;
3054
3046
        }
3055
 
 
3056
 
      case ROW_RESULT:
 
3047
        break;
 
3048
      }
 
3049
      default:
3057
3050
        /* This case should never be choosen */
3058
3051
        assert(0);
3059
3052
        my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
3060
3053
      }
3061
3054
    }
3062
 
 
3063
3055
    parts++;
3064
 
 
3065
3056
    if (group_item->maybe_null)
3066
3057
      null_parts++;
3067
3058
  }
3068
 
 
3069
3059
  join->tmp_table_param.group_length=key_length+null_parts;
3070
3060
  join->tmp_table_param.group_parts=parts;
3071
3061
  join->tmp_table_param.group_null_parts=null_parts;