~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/ha_myisam.cc

  • Committer: Brian Aker
  • Date: 2008-07-04 22:54:17 UTC
  • Revision ID: brian@tangent.org-20080704225417-ceh03krik89vlxqu
Remove LOAD bit for key cache.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1100
1100
 
1101
1101
 
1102
1102
/*
1103
 
  Preload pages of the index file for a table into the key cache.
1104
 
*/
1105
 
 
1106
 
int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
1107
 
{
1108
 
  int error;
1109
 
  const char *errmsg;
1110
 
  uint64_t map;
1111
 
  TABLE_LIST *table_list= table->pos_in_table_list;
1112
 
  my_bool ignore_leaves= table_list->ignore_leaves;
1113
 
  char buf[ERRMSGSIZE+20];
1114
 
 
1115
 
  DBUG_ENTER("ha_myisam::preload_keys");
1116
 
 
1117
 
  table->keys_in_use_for_query.clear_all();
1118
 
 
1119
 
  if (table_list->process_index_hints(table))
1120
 
    DBUG_RETURN(HA_ADMIN_FAILED);
1121
 
 
1122
 
  map= ~(uint64_t) 0;
1123
 
  /* Check validity of the index references */
1124
 
  if (!table->keys_in_use_for_query.is_clear_all())
1125
 
    /* use all keys if there's no list specified by the user through hints */
1126
 
    map= table->keys_in_use_for_query.to_ulonglong();
1127
 
 
1128
 
  mi_extra(file, HA_EXTRA_PRELOAD_BUFFER_SIZE,
1129
 
           (void *) &thd->variables.preload_buff_size);
1130
 
 
1131
 
  if ((error= mi_preload(file, map, ignore_leaves)))
1132
 
  {
1133
 
    switch (error) {
1134
 
    case HA_ERR_NON_UNIQUE_BLOCK_SIZE:
1135
 
      errmsg= "Indexes use different block sizes";
1136
 
      break;
1137
 
    case HA_ERR_OUT_OF_MEM:
1138
 
      errmsg= "Failed to allocate buffer";
1139
 
      break;
1140
 
    default:
1141
 
      my_snprintf(buf, ERRMSGSIZE,
1142
 
                  "Failed to read from index file (errno: %d)", my_errno);
1143
 
      errmsg= buf;
1144
 
    }
1145
 
    error= HA_ADMIN_FAILED;
1146
 
    goto err;
1147
 
  }
1148
 
 
1149
 
  DBUG_RETURN(HA_ADMIN_OK);
1150
 
 
1151
 
 err:
1152
 
  {
1153
 
    MI_CHECK param;
1154
 
    myisamchk_init(&param);
1155
 
    param.thd= thd;
1156
 
    param.op_name=    "preload_keys";
1157
 
    param.db_name=    table->s->db.str;
1158
 
    param.table_name= table->s->table_name.str;
1159
 
    param.testflag=   0;
1160
 
    mi_check_print_error(&param, errmsg);
1161
 
    DBUG_RETURN(error);
1162
 
  }
1163
 
}
1164
 
 
1165
 
 
1166
 
/*
1167
1103
  Disable indexes, making it persistent if requested.
1168
1104
 
1169
1105
  SYNOPSIS