~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.cc

  • Committer: Monty Taylor
  • Date: 2009-05-08 19:07:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1009.
  • Revision ID: mordred@inaugust.com-20090508190739-rwas5y9xjg1a92p6
Reverted a crap-ton of padraig's work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
581
581
  if (file->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
582
582
    int_table_flags|=HA_HAS_CHECKSUM;
583
583
 
584
 
  keys_with_parts.reset();
 
584
  keys_with_parts.clear_all();
585
585
  for (i= 0; i < table->s->keys; i++)
586
586
  {
587
587
    table->key_info[i].block_size= file->s->keyinfo[i].block_length;
590
590
    KEY_PART_INFO *kp_end= kp + table->key_info[i].key_parts;
591
591
    for (; kp != kp_end; kp++)
592
592
    {
593
 
      if (!kp->field->part_of_key.test(i))
 
593
      if (!kp->field->part_of_key.is_set(i))
594
594
      {
595
 
        keys_with_parts.set(i);
 
595
        keys_with_parts.set_bit(i);
596
596
        break;
597
597
      }
598
598
    }
999
999
  KEY_CACHE *new_key_cache= check_opt->key_cache;
1000
1000
  const char *errmsg= 0;
1001
1001
  int error= HA_ADMIN_OK;
 
1002
  uint64_t map;
1002
1003
  TableList *table_list= table->pos_in_table_list;
1003
1004
 
1004
 
  table->keys_in_use_for_query.reset();
 
1005
  table->keys_in_use_for_query.clear_all();
1005
1006
 
1006
1007
  if (table_list->process_index_hints(table))
1007
1008
    return(HA_ADMIN_FAILED);
 
1009
  map= ~(uint64_t) 0;
 
1010
  if (!table->keys_in_use_for_query.is_clear_all())
 
1011
    /* use all keys if there's no list specified by the user through hints */
 
1012
    map= table->keys_in_use_for_query.to_uint64_t();
1008
1013
 
1009
 
  if ((error= mi_assign_to_key_cache(file, new_key_cache)))
 
1014
  if ((error= mi_assign_to_key_cache(file, map, new_key_cache)))
1010
1015
  {
1011
1016
    char buf[STRING_BUFFER_USUAL_SIZE];
1012
1017
    snprintf(buf, sizeof(buf),
1361
1366
  return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
1362
1367
          0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
1363
1368
          HA_READ_ORDER | HA_KEYREAD_ONLY |
1364
 
          (keys_with_parts.test(inx)?0:HA_DO_INDEX_COND_PUSHDOWN));
 
1369
          (keys_with_parts.is_set(inx)?0:HA_DO_INDEX_COND_PUSHDOWN));
1365
1370
}
1366
1371
 
1367
1372
 
1538
1543
    /* Update share */
1539
1544
    if (share->tmp_table == NO_TMP_TABLE)
1540
1545
      pthread_mutex_lock(&share->mutex);
1541
 
    set_prefix(share->keys_in_use, share->keys);
1542
 
    share->keys_in_use&= misam_info.key_map;
1543
 
    share->keys_for_keyread&= share->keys_in_use;
 
1546
    share->keys_in_use.set_prefix(share->keys);
 
1547
    share->keys_in_use.intersect_extended(misam_info.key_map);
 
1548
    share->keys_for_keyread.intersect(share->keys_in_use);
1544
1549
    share->db_record_offset= misam_info.record_offset;
1545
1550
    if (share->key_parts)
1546
1551
      memcpy(table->key_info[0].rec_per_key,