~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/records.cc

  • Committer: Mark Atwood
  • Date: 2011-08-17 19:14:47 UTC
  • mfrom: (2385.3.17 rf)
  • Revision ID: me@mark.atwood.name-20110817191447-h86yzddvycd0xmof
mergeĀ lp:~olafvdspek/drizzle/refactor6

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
  ignore_not_found_rows= 0;
106
106
  table->status=0;                      /* And it's always found */
107
107
 
108
 
  if (select && my_b_inited(select->file))
 
108
  if (select && select->file->inited())
109
109
  {
110
110
    tempfile= select->file;
111
111
  }
114
114
    tempfile= table->sort.io_cache;
115
115
  }
116
116
 
117
 
  if (tempfile && my_b_inited(tempfile)) // Test if ref-records was used
 
117
  if (tempfile && tempfile->inited()) // Test if ref-records was used
118
118
  {
119
 
    read_record= (table->sort.addon_field ?
120
 
                  rr_unpack_from_tempfile : rr_from_tempfile);
 
119
    read_record= table->sort.addon_field ? rr_unpack_from_tempfile : rr_from_tempfile;
121
120
 
122
121
    io_cache=tempfile;
123
122
    io_cache->reinit_io_cache(internal::READ_CACHE,0L,0,0);
316
315
  int tmp;
317
316
  for (;;)
318
317
  {
319
 
    if (my_b_read(info->io_cache,info->ref_pos,info->ref_length))
 
318
    if (info->io_cache->read(info->ref_pos, info->ref_length))
320
319
      return -1;                                        /* End of cursor */
321
320
    if (!(tmp=info->cursor->rnd_pos(info->record,info->ref_pos)))
322
321
      break;
347
346
*/
348
347
static int rr_unpack_from_tempfile(ReadRecord *info)
349
348
{
350
 
  if (my_b_read(info->io_cache, info->rec_buf, info->ref_length))
 
349
  if (info->io_cache->read(info->rec_buf, info->ref_length))
351
350
    return -1;
352
351
  Table *table= info->table;
353
352
  (*table->sort.unpack)(table->sort.addon_field, info->rec_buf);
470
469
      return ((int) error);
471
470
    }
472
471
    length=info->rec_cache_size;
473
 
    rest_of_file= info->io_cache->end_of_file - my_b_tell(info->io_cache);
 
472
    rest_of_file= info->io_cache->end_of_file - info->io_cache->tell();
474
473
    if ((internal::my_off_t) length > rest_of_file)
475
474
    {
476
475
      length= (uint32_t) rest_of_file;
477
476
    }
478
477
 
479
 
    if (!length || my_b_read(info->io_cache, info->getCache(), length))
 
478
    if (!length || info->io_cache->read(info->getCache(), length))
480
479
    {
481
480
      return -1;                        /* End of cursor */
482
481
    }