~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/opt_range.cc

MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
685
685
{
686
686
public:
687
687
  KEY_PART *key[MAX_KEY]; /* First key parts of keys used in the query */
688
 
  longlong baseflag;
 
688
  int64_t baseflag;
689
689
  uint max_key_part;
690
690
  /* Number of ranges in the last checked tree->key */
691
691
  uint range_count;
4193
4193
      {
4194
4194
        field_item= (Item_field*) (cond_func->arguments()[i]->real_item());
4195
4195
        SEL_TREE *tmp= get_full_func_mm_tree(param, cond_func, 
4196
 
                                    field_item, (Item*)(intptr)i, inv);
 
4196
                                    field_item, (Item*)(intptr_t)i, inv);
4197
4197
        if (inv)
4198
4198
          tree= !tree ? tmp : tree_or(param, tree, tmp);
4199
4199
        else 
4572
4572
      value->result_type() == INT_RESULT &&
4573
4573
      ((Field_num*)field)->unsigned_flag && !((Item_int*)value)->unsigned_flag)
4574
4574
  {
4575
 
    longlong item_val= value->val_int();
 
4575
    int64_t item_val= value->val_int();
4576
4576
    if (item_val < 0)
4577
4577
    {
4578
4578
      if (type == Item_func::LT_FUNC || type == Item_func::LE_FUNC)
7587
7587
  uint length;
7588
7588
  KEY *key_info= head->key_info + index;
7589
7589
  key_names->append(key_info->name);
7590
 
  length= longlong2str(max_used_key_length, buf, 10) - buf;
 
7590
  length= int64_t2str(max_used_key_length, buf, 10) - buf;
7591
7591
  used_lengths->append(buf, length);
7592
7592
}
7593
7593
 
7612
7612
 
7613
7613
    KEY *key_info= head->key_info + quick->index;
7614
7614
    key_names->append(key_info->name);
7615
 
    length= longlong2str(quick->max_used_key_length, buf, 10) - buf;
 
7615
    length= int64_t2str(quick->max_used_key_length, buf, 10) - buf;
7616
7616
    used_lengths->append(buf, length);
7617
7617
  }
7618
7618
  if (pk_quick_select)
7620
7620
    KEY *key_info= head->key_info + pk_quick_select->index;
7621
7621
    key_names->append(',');
7622
7622
    key_names->append(key_info->name);
7623
 
    length= longlong2str(pk_quick_select->max_used_key_length, buf, 10) - buf;
 
7623
    length= int64_t2str(pk_quick_select->max_used_key_length, buf, 10) - buf;
7624
7624
    used_lengths->append(',');
7625
7625
    used_lengths->append(buf, length);
7626
7626
  }
7645
7645
      used_lengths->append(',');
7646
7646
    }
7647
7647
    key_names->append(key_info->name);
7648
 
    length= longlong2str(quick->max_used_key_length, buf, 10) - buf;
 
7648
    length= int64_t2str(quick->max_used_key_length, buf, 10) - buf;
7649
7649
    used_lengths->append(buf, length);
7650
7650
  }
7651
7651
 
7654
7654
    KEY *key_info= head->key_info + cpk_quick->index;
7655
7655
    key_names->append(',');
7656
7656
    key_names->append(key_info->name);
7657
 
    length= longlong2str(cpk_quick->max_used_key_length, buf, 10) - buf;
 
7657
    length= int64_t2str(cpk_quick->max_used_key_length, buf, 10) - buf;
7658
7658
    used_lengths->append(',');
7659
7659
    used_lengths->append(buf, length);
7660
7660
  }
8046
8046
        all_parts have all bits set from 0 to (max_key_part-1).
8047
8047
        cur_parts have bits set for only used keyparts.
8048
8048
      */
8049
 
      ulonglong all_parts, cur_parts;
 
8049
      uint64_t all_parts, cur_parts;
8050
8050
      all_parts= (1<<max_key_part) - 1;
8051
 
      cur_parts= cur_used_key_parts.to_ulonglong() >> 1;
 
8051
      cur_parts= cur_used_key_parts.to_uint64_t() >> 1;
8052
8052
      if (all_parts != cur_parts)
8053
8053
        goto next_index;
8054
8054
    }
9737
9737
  char buf[64];
9738
9738
  uint length;
9739
9739
  key_names->append(index_info->name);
9740
 
  length= longlong2str(max_used_key_length, buf, 10) - buf;
 
9740
  length= int64_t2str(max_used_key_length, buf, 10) - buf;
9741
9741
  used_lengths->append(buf, length);
9742
9742
}
9743
9743
 
9744
9744
static void print_sel_tree(PARAM *param, SEL_TREE *tree, key_map *tree_map,
9745
 
                           const char *msg)
 
9745
                           const char *msg __attribute__((__unused__)))
9746
9746
{
9747
9747
  SEL_ARG **key,**end;
9748
9748
  int idx;
9769
9769
}
9770
9770
 
9771
9771
 
9772
 
static void print_ror_scans_arr(TABLE *table, const char *msg,
 
9772
static void print_ror_scans_arr(TABLE *table,
 
9773
                                const char *msg __attribute__((__unused__)),
9773
9774
                                struct st_ror_scan_info **start,
9774
9775
                                struct st_ror_scan_info **end)
9775
9776
{