~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/opt_range.cc

  • Committer: Monty Taylor
  • Date: 2008-08-18 23:04:17 UTC
  • mfrom: (327.1.12 drizzle)
  • Revision ID: monty@inaugust.com-20080818230417-442rhihpahnout34
MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
640
640
{
641
641
public:
642
642
  THD   *thd;   /* Current thread handle */
643
 
  TABLE *table; /* Table being analyzed */
 
643
  Table *table; /* Table being analyzed */
644
644
  COND *cond;   /* Used inside get_mm_tree(). */
645
645
  table_map prev_tables;
646
646
  table_map read_tables;
754
754
 
755
755
static void print_sel_tree(PARAM *param, SEL_TREE *tree, key_map *tree_map,
756
756
                           const char *msg);
757
 
static void print_ror_scans_arr(TABLE *table, const char *msg,
 
757
static void print_ror_scans_arr(Table *table, const char *msg,
758
758
                                struct st_ror_scan_info **start,
759
759
                                struct st_ror_scan_info **end);
760
760
 
999
999
           1 = Got some error (out of memory?)
1000
1000
           */
1001
1001
 
1002
 
SQL_SELECT *make_select(TABLE *head, table_map const_tables,
 
1002
SQL_SELECT *make_select(Table *head, table_map const_tables,
1003
1003
                        table_map read_tables, COND *conds,
1004
1004
                        bool allow_null_cond,
1005
1005
                        int *error)
1063
1063
   used_key_parts(0)
1064
1064
{}
1065
1065
 
1066
 
QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
 
1066
QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, Table *table, uint key_nr,
1067
1067
                                       bool no_alloc, MEM_ROOT *parent_alloc,
1068
1068
                                       bool *create_error)
1069
1069
  :free_file(0),cur_range(NULL),last_range(0),dont_free(0)
1153
1153
 
1154
1154
 
1155
1155
QUICK_INDEX_MERGE_SELECT::QUICK_INDEX_MERGE_SELECT(THD *thd_param,
1156
 
                                                   TABLE *table)
 
1156
                                                   Table *table)
1157
1157
  :pk_quick_select(NULL), thd(thd_param)
1158
1158
{
1159
1159
  index= MAX_KEY;
1203
1203
 
1204
1204
 
1205
1205
QUICK_ROR_INTERSECT_SELECT::QUICK_ROR_INTERSECT_SELECT(THD *thd_param,
1206
 
                                                       TABLE *table,
 
1206
                                                       Table *table,
1207
1207
                                                       bool retrieve_full_rows,
1208
1208
                                                       MEM_ROOT *parent_alloc)
1209
1209
  : cpk_quick(NULL), thd(thd_param), need_to_fetch_row(retrieve_full_rows),
1442
1442
 
1443
1443
 
1444
1444
QUICK_ROR_UNION_SELECT::QUICK_ROR_UNION_SELECT(THD *thd_param,
1445
 
                                               TABLE *table)
 
1445
                                               Table *table)
1446
1446
  : thd(thd_param), scans_inited(false)
1447
1447
{
1448
1448
  index= MAX_KEY;
1777
1777
    MAX_KEY if no such index was found.
1778
1778
*/
1779
1779
 
1780
 
uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit)
 
1780
uint get_index_for_order(Table *table, ORDER *order, ha_rows limit)
1781
1781
{
1782
1782
  uint idx;
1783
1783
  uint match_key= MAX_KEY, match_key_len= MAX_KEY_LENGTH + 1;
2052
2052
 
2053
2053
static int fill_used_fields_bitmap(PARAM *param)
2054
2054
{
2055
 
  TABLE *table= param->table;
 
2055
  Table *table= param->table;
2056
2056
  my_bitmap_map *tmp;
2057
2057
  uint pk;
2058
2058
  param->tmp_covered_fields.bitmap= 0;
6596
6596
    NULL on error.
6597
6597
*/
6598
6598
 
6599
 
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
 
6599
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, Table *table,
6600
6600
                                             TABLE_REF *ref, ha_rows records)
6601
6601
{
6602
6602
  MEM_ROOT *old_root, *alloc;
7693
7693
                               Field::imagetype image_type);
7694
7694
 
7695
7695
static void
7696
 
cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
 
7696
cost_group_min_max(Table* table, KEY *index_info, uint used_key_parts,
7697
7697
                   uint group_key_parts, SEL_TREE *range_tree,
7698
7698
                   SEL_ARG *index_tree, ha_rows quick_prefix_records,
7699
7699
                   bool have_min, bool have_max,
7833
7833
{
7834
7834
  THD *thd= param->thd;
7835
7835
  JOIN *join= thd->lex->current_select->join;
7836
 
  TABLE *table= param->table;
 
7836
  Table *table= param->table;
7837
7837
  bool have_min= false;              /* true if there is a MIN function. */
7838
7838
  bool have_max= false;              /* true if there is a MAX function. */
7839
7839
  Item_field *min_max_arg_item= NULL; // The argument of all MIN/MAX functions
8585
8585
    None
8586
8586
*/
8587
8587
 
8588
 
void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
 
8588
void cost_group_min_max(Table* table, KEY *index_info, uint used_key_parts,
8589
8589
                        uint group_key_parts, SEL_TREE *range_tree,
8590
8590
                        SEL_ARG *index_tree __attribute__((unused)),
8591
8591
                        ha_rows quick_prefix_records,
8782
8782
*/
8783
8783
 
8784
8784
QUICK_GROUP_MIN_MAX_SELECT::
8785
 
QUICK_GROUP_MIN_MAX_SELECT(TABLE *table, JOIN *join_arg, bool have_min_arg,
 
8785
QUICK_GROUP_MIN_MAX_SELECT(Table *table, JOIN *join_arg, bool have_min_arg,
8786
8786
                           bool have_max_arg,
8787
8787
                           KEY_PART_INFO *min_max_arg_part_arg,
8788
8788
                           uint group_prefix_len_arg, uint group_key_parts_arg,
9762
9762
}
9763
9763
 
9764
9764
 
9765
 
static void print_ror_scans_arr(TABLE *table,
 
9765
static void print_ror_scans_arr(Table *table,
9766
9766
                                const char *msg __attribute__((unused)),
9767
9767
                                struct st_ror_scan_info **start,
9768
9768
                                struct st_ror_scan_info **end)