~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/records.cc

  • Committer: Brian Aker
  • Date: 2010-05-20 06:34:25 UTC
  • mto: (1552.1.1 new-staging)
  • mto: This revision was merged to the branch mainline in revision 1553.
  • Revision ID: brian@gaz-20100520063425-0hwu5fx4fmmp2g49
Partial encapsulation of TableShare from Table.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
        !(table->cursor->getEngine()->check_flag(HTON_BIT_FAST_KEY_READ)) &&
122
122
        (table->db_stat & HA_READ_ONLY ||
123
123
        table->reginfo.lock_type <= TL_READ_NO_INSERT) &&
124
 
        (uint64_t) table->s->reclength* (table->cursor->stats.records+
 
124
        (uint64_t) table->getShare()->reclength* (table->cursor->stats.records+
125
125
                                                table->cursor->stats.deleted) >
126
126
        (uint64_t) MIN_FILE_LENGTH_TO_USE_ROW_CACHE &&
127
 
        io_cache->end_of_file/ref_length * table->s->reclength >
 
127
        io_cache->end_of_file/ref_length * table->getShare()->reclength >
128
128
        (internal::my_off_t) MIN_ROWS_TO_USE_TABLE_CACHE &&
129
 
        !table->s->blob_fields &&
 
129
        !table->getShare()->blob_fields &&
130
130
        ref_length <= MAX_REFLENGTH)
131
131
    {
132
132
      if (init_rr_cache())
154
154
    if (!table->no_cache &&
155
155
        (use_record_cache > 0 ||
156
156
        (int) table->reginfo.lock_type <= (int) TL_READ_WITH_SHARED_LOCKS ||
157
 
        !(table->s->db_options_in_use & HA_OPTION_PACK_RECORD)))
 
157
        !(table->getShare()->db_options_in_use & HA_OPTION_PACK_RECORD)))
158
158
      table->cursor->extra_opt(HA_EXTRA_CACHE, session->variables.read_buff_size);
159
159
  }
160
160
 
385
385
  uint32_t local_rec_cache_size;
386
386
 
387
387
  struct_length= 3 + MAX_REFLENGTH;
388
 
  reclength= ALIGN_SIZE(table->s->reclength+1);
 
388
  reclength= ALIGN_SIZE(table->getShare()->reclength+1);
389
389
  if (reclength < struct_length)
390
390
    reclength= ALIGN_SIZE(struct_length);
391
391
 
392
 
  error_offset= table->s->reclength;
 
392
  error_offset= table->getShare()->reclength;
393
393
  cache_records= (session->variables.read_rnd_buff_size /
394
394
                        (reclength+struct_length));
395
395
  local_rec_cache_size= cache_records * reclength;
433
433
      else
434
434
      {
435
435
        error=0;
436
 
        memcpy(info->record,info->cache_pos, (size_t) info->table->s->reclength);
 
436
        memcpy(info->record,info->cache_pos, (size_t) info->table->getShare()->reclength);
437
437
      }
438
438
      info->cache_pos+=info->reclength;
439
439
      return ((int) error);