~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/opt_range.cc

  • Committer: Monty Taylor
  • Date: 2008-08-10 06:11:44 UTC
  • mto: (312.1.3 translations)
  • mto: This revision was merged to the branch mainline in revision 295.
  • Revision ID: monty@inaugust.com-20080810061144-llnyqeju5zckd6pw
Oy. Replaced max and min macros with std::max and std::min so that we get
strong typing. And, then, cast things in the right direction...

Show diffs side-by-side

added added

removed removed

Lines of Context:
6127
6127
    }
6128
6128
  }
6129
6129
  seq->param->range_count++;
6130
 
  seq->param->max_key_part=max(seq->param->max_key_part,key_tree->part);
 
6130
  seq->param->max_key_part=max(seq->param->max_key_part,(uint)key_tree->part);
6131
6131
  return 0;
6132
6132
}
6133
6133
 
7249
7249
    last_range= *(cur_range++);
7250
7250
 
7251
7251
    start_key.key=    (const uchar*) last_range->min_key;
7252
 
    start_key.length= min(last_range->min_length, prefix_length);
 
7252
    start_key.length= min(last_range->min_length, (uint16_t)prefix_length);
7253
7253
    start_key.keypart_map= last_range->min_keypart_map & keypart_map;
7254
7254
    start_key.flag=   ((last_range->flag & NEAR_MIN) ? HA_READ_AFTER_KEY :
7255
7255
                       (last_range->flag & EQ_RANGE) ?
7256
7256
                       HA_READ_KEY_EXACT : HA_READ_KEY_OR_NEXT);
7257
7257
    end_key.key=      (const uchar*) last_range->max_key;
7258
 
    end_key.length=   min(last_range->max_length, prefix_length);
 
7258
    end_key.length=   min(last_range->max_length, (uint16_t)prefix_length);
7259
7259
    end_key.keypart_map= last_range->max_keypart_map & keypart_map;
7260
7260
    /*
7261
7261
      We use READ_AFTER_KEY here because if we are reading on a key
8640
8640
      p_overlap= (blocks_per_group * (keys_per_subgroup - 1)) / keys_per_group;
8641
8641
      p_overlap= min(p_overlap, 1.0);
8642
8642
    }
8643
 
    io_cost= (double) min(num_groups * (1 + p_overlap), num_blocks);
 
8643
    io_cost= (double) min(num_groups * (1 + p_overlap), (double)num_blocks);
8644
8644
  }
8645
8645
  else
8646
8646
    io_cost= (keys_per_group > keys_per_block) ?