~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/range.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 17:21:46 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622172146-fmtxxu9xt3ddmnm5
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
2871
2871
        field_length= length;
2872
2872
    }
2873
2873
    length+=offset;
2874
 
    min_str= (unsigned char*) alloc->alloc(length*2);
 
2874
    min_str= alloc->alloc(length*2);
2875
2875
    max_str=min_str+length;
2876
2876
    if (maybe_null)
2877
2877
      max_str[0]= min_str[0]=0;
3107
3107
    goto end;
3108
3108
  }
3109
3109
 
3110
 
  str= (unsigned char*) alloc->alloc(key_part->store_length+1);
 
3110
  str= alloc->alloc(key_part->store_length+1);
3111
3111
  if (maybe_null)
3112
 
    *str= (unsigned char) field->is_real_null();        // Set to 1 if null
 
3112
    *str= field->is_real_null();        // Set to 1 if null
3113
3113
  field->get_key_image(str+maybe_null, key_part->length);
3114
 
  if (! (tree= new (alloc) optimizer::SEL_ARG(field, str, str)))
3115
 
    goto end; // out of memory
 
3114
  tree= new (alloc) optimizer::SEL_ARG(field, str, str);
3116
3115
 
3117
3116
  /*
3118
3117
    Check if we are comparing an UNSIGNED integer with a negative constant.
3976
3975
    {
3977
3976
      quick->mrr_flags= mrr_flags;
3978
3977
      quick->mrr_buf_size= mrr_buf_size;
3979
 
      if (parent_alloc)
3980
 
      {
3981
 
        quick->key_parts= (KEY_PART*)parent_alloc->memdup(param->key[idx], sizeof(KEY_PART)* param->table->key_info[param->real_keynr[idx]].key_parts);
3982
 
      }
3983
 
      else
3984
 
      {
3985
 
        quick->key_parts= (KEY_PART*)quick->alloc.memdup(param->key[idx], sizeof(KEY_PART)* param->table->key_info[param->real_keynr[idx]].key_parts);
3986
 
      }
 
3978
      quick->key_parts= parent_alloc
 
3979
        ? (KEY_PART*)parent_alloc->memdup(param->key[idx], sizeof(KEY_PART)* param->table->key_info[param->real_keynr[idx]].key_parts)
 
3980
        : (KEY_PART*)quick->alloc.memdup(param->key[idx], sizeof(KEY_PART)* param->table->key_info[param->real_keynr[idx]].key_parts);
3987
3981
    }
3988
3982
  }
3989
3983
  return quick;