~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/ha_heap.cc

Merged Drizzle's Trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
 
264
264
const char *ha_heap::index_type(uint32_t inx)
265
265
{
266
 
  return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ?
 
266
  return ((table_share->getKeyInfo(inx).algorithm == HA_KEY_ALG_BTREE) ?
267
267
          "BTREE" : "HASH");
268
268
}
269
269
 
287
287
void ha_heap::set_keys_for_scanning(void)
288
288
{
289
289
  btree_keys.reset();
290
 
  for (uint32_t i= 0 ; i < table->getShare()->keys ; i++)
 
290
  for (uint32_t i= 0 ; i < table->getShare()->sizeKeys() ; i++)
291
291
  {
292
292
    if (table->key_info[i].algorithm == HA_KEY_ALG_BTREE)
293
293
      btree_keys.set(i);
297
297
 
298
298
void ha_heap::update_key_stats()
299
299
{
300
 
  for (uint32_t i= 0; i < table->getShare()->keys; i++)
 
300
  for (uint32_t i= 0; i < table->getShare()->sizeKeys(); i++)
301
301
  {
302
 
    KeyInfo *key=table->key_info+i;
 
302
    KeyInfo *key= &table->key_info[i];
303
303
    if (!key->rec_per_key)
304
304
      continue;
305
305
    if (key->algorithm != HA_KEY_ALG_BTREE)
661
661
ha_rows ha_heap::records_in_range(uint32_t inx, key_range *min_key,
662
662
                                  key_range *max_key)
663
663
{
664
 
  KeyInfo *key=table->key_info+inx;
 
664
  KeyInfo *key= &table->key_info[inx];
665
665
  if (key->algorithm == HA_KEY_ALG_BTREE)
666
666
    return hp_rb_records_in_range(file, inx, min_key, max_key);
667
667
 
709
709
                                  message::Table &create_proto,
710
710
                                  HP_SHARE **internal_share)
711
711
{
712
 
  uint32_t key, parts, mem_per_row_keys= 0, keys= table_arg->getShare()->keys;
 
712
  uint32_t key, parts, mem_per_row_keys= 0, keys= table_arg->getShare()->sizeKeys();
713
713
  uint32_t auto_key= 0, auto_key_type= 0;
714
714
  uint32_t max_key_fieldnr = 0, key_part_size = 0, next_field_pos = 0;
715
 
  uint32_t column_idx, column_count= table_arg->getShare()->fields;
 
715
  uint32_t column_idx, column_count= table_arg->getShare()->sizeFields();
716
716
  HP_COLUMNDEF *columndef;
717
717
  HP_KEYDEF *keydef;
718
718
  HA_KEYSEG *seg;
735
735
 
736
736
  for (column_idx= 0; column_idx < column_count; column_idx++)
737
737
  {
738
 
    Field* field= *(table_arg->field + column_idx);
 
738
    Field* field= *(table_arg->getFields() + column_idx);
739
739
    HP_COLUMNDEF* column= columndef + column_idx;
740
740
    column->type= (uint16_t)field->type();
741
741
    column->length= field->pack_length();
775
775
  seg= reinterpret_cast<HA_KEYSEG*> (keydef + keys);
776
776
  for (key= 0; key < keys; key++)
777
777
  {
778
 
    KeyInfo *pos= table_arg->key_info+key;
 
778
    KeyInfo *pos= &table_arg->key_info[key];
779
779
    KeyPartInfo *key_part=     pos->key_part;
780
780
    KeyPartInfo *key_part_end= key_part + pos->key_parts;
781
781
 
888
888
                    keys, keydef,
889
889
                    column_count, columndef,
890
890
                    max_key_fieldnr, key_part_size,
891
 
                    table_arg->getShare()->reclength, mem_per_row_keys,
 
891
                    table_arg->getShare()->getRecordLength(), mem_per_row_keys,
892
892
                    static_cast<uint32_t>(num_rows), /* We check for overflow above, so cast is fine here. */
893
893
                    0, // Factor out MIN
894
894
                    &hp_create_info, internal_share);