~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.cc

  • Committer: Monty Taylor
  • Date: 2009-02-21 03:33:30 UTC
  • mfrom: (895 drizzle)
  • mto: (896.2.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 898.
  • Revision ID: mordred@inaugust.com-20090221033330-v110f94679dej04p
MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2107
2107
  else
2108
2108
  {
2109
2109
    /* Table is opened and defined at this point */
2110
 
    key_unpack(&str,table,(uint) key_nr);
2111
 
    uint32_t max_length=DRIZZLE_ERRMSG_SIZE-(uint) strlen(msg);
 
2110
    key_unpack(&str,table,(uint32_t) key_nr);
 
2111
    uint32_t max_length=DRIZZLE_ERRMSG_SIZE-(uint32_t) strlen(msg);
2112
2112
    if (str.length() >= max_length)
2113
2113
    {
2114
2114
      str.length(max_length-4);
2171
2171
      char key[MAX_KEY_LENGTH];
2172
2172
      String str(key,sizeof(key),system_charset_info);
2173
2173
      /* Table is opened and defined at this point */
2174
 
      key_unpack(&str,table,(uint) key_nr);
 
2174
      key_unpack(&str,table,(uint32_t) key_nr);
2175
2175
      max_length= (DRIZZLE_ERRMSG_SIZE-
2176
 
                   (uint) strlen(ER(ER_FOREIGN_DUPLICATE_KEY)));
 
2176
                   (uint32_t) strlen(ER(ER_FOREIGN_DUPLICATE_KEY)));
2177
2177
      if (str.length() >= max_length)
2178
2178
      {
2179
2179
        str.length(max_length-4);
2370
2370
*/
2371
2371
uint32_t handler::get_dup_key(int error)
2372
2372
{
2373
 
  table->file->errkey  = (uint) -1;
 
2373
  table->file->errkey  = (uint32_t) -1;
2374
2374
  if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOREIGN_DUPLICATE_KEY ||
2375
2375
      error == HA_ERR_FOUND_DUPP_UNIQUE ||
2376
2376
      error == HA_ERR_DROP_INDEX_FK)
2850
2850
 
2851
2851
  init_tmp_table_share(session, &share, db, 0, table_name, path);
2852
2852
  if (open_table_def(session, &share, 0) ||
2853
 
      open_table_from_share(session, &share, "", 0, (uint) READ_ALL, 0, &table,
 
2853
      open_table_from_share(session, &share, "", 0, (uint32_t) READ_ALL, 0, &table,
2854
2854
                            OTM_CREATE))
2855
2855
    goto err;
2856
2856
 
2898
2898
  {
2899
2899
    pthread_mutex_lock(&LOCK_global_system_variables);
2900
2900
    uint32_t tmp_buff_size= (uint32_t) key_cache->param_buff_size;
2901
 
    uint32_t tmp_block_size= (uint) key_cache->param_block_size;
 
2901
    uint32_t tmp_block_size= (uint32_t) key_cache->param_block_size;
2902
2902
    uint32_t division_limit= key_cache->param_division_limit;
2903
2903
    uint32_t age_threshold=  key_cache->param_age_threshold;
2904
2904
    pthread_mutex_unlock(&LOCK_global_system_variables);
3173
3173
    cost->zero();
3174
3174
    cost->avg_io_cost= 1; /* assume random seeks */
3175
3175
    if ((*flags & HA_MRR_INDEX_ONLY) && total_rows > 2)
3176
 
      cost->io_count= index_only_read_time(keyno, (uint)total_rows);
 
3176
      cost->io_count= index_only_read_time(keyno, (uint32_t)total_rows);
3177
3177
    else
3178
3178
      cost->io_count= read_time(keyno, n_ranges, total_rows);
3179
3179
    cost->cpu_cost= (double) total_rows / TIME_FOR_COMPARE + 0.01;
3780
3780
    return true; /* Buffer has not enough space for even 1 rowid */
3781
3781
 
3782
3782
  /* Number of iterations we'll make with full buffer */
3783
 
  n_full_steps= (uint)floor(rows2double(rows) / max_buff_entries);
 
3783
  n_full_steps= (uint32_t)floor(rows2double(rows) / max_buff_entries);
3784
3784
 
3785
3785
  /*
3786
3786
    Get numbers of rows we'll be processing in
3902
3902
  if (table->file->primary_key_is_clustered())
3903
3903
  {
3904
3904
    cost->io_count= table->file->read_time(table->s->primary_key,
3905
 
                                           (uint) nrows, nrows);
 
3905
                                           (uint32_t) nrows, nrows);
3906
3906
  }
3907
3907
  else
3908
3908
  {