~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4475
4475
      if (!(form->keys_in_use_for_query.is_set(key)))
4476
4476
        continue;
4477
4477
 
4478
 
      uint32_t key_parts= (uint) form->key_info[key].key_parts;
 
4478
      uint32_t key_parts= (uint32_t) form->key_info[key].key_parts;
4479
4479
      for (uint32_t part=0 ; part <  key_parts ; part++)
4480
4480
      {
4481
4481
        if (field->eq(form->key_info[key].key_part[part].field))
4750
4750
      use->table->reginfo.join_tab->checked_keys.set_bit(use->key);
4751
4751
      save_pos++;
4752
4752
    }
4753
 
    i=(uint) (save_pos-(KEYUSE*) keyuse->buffer);
 
4753
    i=(uint32_t) (save_pos-(KEYUSE*) keyuse->buffer);
4754
4754
    set_dynamic(keyuse,(unsigned char*) &key_end,i);
4755
4755
    keyuse->elements=i;
4756
4756
  }
6292
6292
    rec_length+=sizeof(bool);
6293
6293
  if (blobs)
6294
6294
  {
6295
 
    uint32_t blob_length=(uint) (join_tab->table->file->stats.mean_rec_length-
 
6295
    uint32_t blob_length=(uint32_t) (join_tab->table->file->stats.mean_rec_length-
6296
6296
                             (join_tab->table->getRecordLength()- rec_length));
6297
 
    rec_length+=(uint) cmax((uint)4,blob_length);
 
6297
    rec_length+=(uint32_t) cmax((uint32_t)4,blob_length);
6298
6298
  }
6299
6299
  join_tab->used_fields=fields;
6300
6300
  join_tab->used_fieldlength=rec_length;
7033
7033
      used_tables|=current_map;
7034
7034
 
7035
7035
      if (tab->type == JT_REF && tab->quick &&
7036
 
          (uint) tab->ref.key == tab->quick->index &&
 
7036
          (uint32_t) tab->ref.key == tab->quick->index &&
7037
7037
          tab->ref.key_length < tab->quick->max_used_key_length)
7038
7038
      {
7039
7039
        /* Range uses longer key;  Use this instead of ref on key */
7124
7124
          /* Use quick key read if it's a constant and it's not used
7125
7125
             with key reading */
7126
7126
          if (tab->needed_reg.is_clear_all() && tab->type != JT_EQ_REF
7127
 
              && (tab->type != JT_REF || (uint) tab->ref.key == tab->quick->index))
 
7127
              && (tab->type != JT_REF || (uint32_t) tab->ref.key == tab->quick->index))
7128
7128
          {
7129
7129
            sel->quick=tab->quick;              // Use value from get_quick_...
7130
7130
            sel->quick_keys.clear_all();
7136
7136
          }
7137
7137
          tab->quick=0;
7138
7138
        }
7139
 
        uint32_t ref_key=(uint) sel->head->reginfo.join_tab->ref.key+1;
 
7139
        uint32_t ref_key=(uint32_t) sel->head->reginfo.join_tab->ref.key+1;
7140
7140
        if (i == join->const_tables && ref_key)
7141
7141
        {
7142
7142
          if (!tab->const_keys.is_clear_all() &&
8404
8404
public:
8405
8405
  static void *operator new(size_t size)
8406
8406
  {
8407
 
    return (void*) sql_alloc((uint) size);
 
8407
    return (void*) sql_alloc((uint32_t) size);
8408
8408
  }
8409
8409
  static void operator delete(void *, size_t)
8410
8410
  { TRASH(ptr, size); }
12020
12020
          }
12021
12021
          if (join->rollup.state != ROLLUP::STATE_NONE && error <= 0)
12022
12022
          {
12023
 
            if (join->rollup_send_data((uint) (idx+1)))
 
12023
            if (join->rollup_send_data((uint32_t) (idx+1)))
12024
12024
              error= 1;
12025
12025
          }
12026
12026
        }
12285
12285
        }
12286
12286
        if (join->rollup.state != ROLLUP::STATE_NONE)
12287
12287
        {
12288
 
          if (join->rollup_write_data((uint) (idx+1), table))
 
12288
          if (join->rollup_write_data((uint32_t) (idx+1), table))
12289
12289
            return(NESTED_LOOP_ERROR);
12290
12290
        }
12291
12291
        if (end_of_records)
12670
12670
    key_part++;
12671
12671
  }
12672
12672
  *used_key_parts= on_primary_key ? table->key_info[idx].key_parts :
12673
 
    (uint) (key_part - table->key_info[idx].key_part);
 
12673
    (uint32_t) (key_part - table->key_info[idx].key_part);
12674
12674
  if (reverse == -1 && !(table->file->index_flags(idx, *used_key_parts-1, 1) &
12675
12675
                         HA_READ_PREV))
12676
12676
    reverse= 0;                                 // Index can't be used
13394
13394
        We can only use 'Only index' if quick key is same as ref_key
13395
13395
        and in index_merge 'Only index' cannot be used
13396
13396
      */
13397
 
      if (table->key_read && ((uint) tab->ref.key != select->quick->index))
 
13397
      if (table->key_read && ((uint32_t) tab->ref.key != select->quick->index))
13398
13398
      {
13399
13399
        table->key_read=0;
13400
13400
        table->file->extra(HA_EXTRA_NO_KEYREAD);
13622
13622
 
13623
13623
  if (!my_multi_malloc(MYF(MY_WME),
13624
13624
                       &key_buffer,
13625
 
                       (uint) ((key_length + extra_length) *
 
13625
                       (uint32_t) ((key_length + extra_length) *
13626
13626
                               (long) file->stats.records),
13627
13627
                       &field_lengths,
13628
 
                       (uint) (field_count*sizeof(*field_lengths)),
 
13628
                       (uint32_t) (field_count*sizeof(*field_lengths)),
13629
13629
                       NULL))
13630
13630
    return(1);
13631
13631
 
13643
13643
    extra_length= ALIGN_SIZE(key_length)-key_length;
13644
13644
  }
13645
13645
 
13646
 
  if (hash_init(&hash, &my_charset_bin, (uint) file->stats.records, 0,
 
13646
  if (hash_init(&hash, &my_charset_bin, (uint32_t) file->stats.records, 0,
13647
13647
                key_length, (hash_get_key) 0, 0, 0))
13648
13648
  {
13649
13649
    free((char*) key_buffer);
13939
13939
        for (str=copy->str,end= str+copy->length;
13940
13940
             end > str && end[-1] == ' ' ;
13941
13941
             end--) ;
13942
 
        length=(uint) (end-str);
 
13942
        length=(uint32_t) (end-str);
13943
13943
        memcpy(pos+2, str, length);
13944
13944
        int2store(pos, length);
13945
13945
        pos+= length+2;
14137
14137
  */
14138
14138
  if (order_item->type() == Item::INT_ITEM && order_item->basic_const_item())
14139
14139
  {                                             /* Order by position */
14140
 
    uint32_t count= (uint) order_item->val_int();
 
14140
    uint32_t count= (uint32_t) order_item->val_int();
14141
14141
    if (!count || count > fields.elements)
14142
14142
    {
14143
14143
      my_error(ER_BAD_FIELD_ERROR, MYF(0),