~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/records.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "drizzled/internal/my_sys.h"
29
29
#include "drizzled/internal/iocache.h"
30
30
 
31
 
using namespace drizzled;
 
31
namespace drizzled
 
32
{
32
33
 
33
34
int rr_sequential(READ_RECORD *info);
34
35
static int rr_quick(READ_RECORD *info);
70
71
                      int use_record_cache, 
71
72
                      bool print_error)
72
73
{
73
 
  IO_CACHE *tempfile;
 
74
  internal::IO_CACHE *tempfile;
74
75
 
75
76
  memset(info, 0, sizeof(*info));
76
77
  info->session=session;
103
104
    info->read_record= (table->sort.addon_field ?
104
105
                        rr_unpack_from_tempfile : rr_from_tempfile);
105
106
    info->io_cache=tempfile;
106
 
    reinit_io_cache(info->io_cache,READ_CACHE,0L,0,0);
 
107
    reinit_io_cache(info->io_cache,internal::READ_CACHE,0L,0,0);
107
108
    info->ref_pos=table->cursor->ref;
108
109
    if (!table->cursor->inited)
109
110
      table->cursor->ha_rnd_init(0);
122
123
                                                table->cursor->stats.deleted) >
123
124
        (uint64_t) MIN_FILE_LENGTH_TO_USE_ROW_CACHE &&
124
125
        info->io_cache->end_of_file/info->ref_length * table->s->reclength >
125
 
        (my_off_t) MIN_ROWS_TO_USE_TABLE_CACHE &&
 
126
        (internal::my_off_t) MIN_ROWS_TO_USE_TABLE_CACHE &&
126
127
        !table->s->blob_fields &&
127
128
        info->ref_length <= MAX_REFLENGTH)
128
129
    {
412
413
{
413
414
  register uint32_t i;
414
415
  uint32_t length;
415
 
  my_off_t rest_of_file;
 
416
  internal::my_off_t rest_of_file;
416
417
  int16_t error;
417
418
  unsigned char *position,*ref_position,*record_pos;
418
419
  uint32_t record;
437
438
    }
438
439
    length=info->rec_cache_size;
439
440
    rest_of_file=info->io_cache->end_of_file - my_b_tell(info->io_cache);
440
 
    if ((my_off_t) length > rest_of_file)
 
441
    if ((internal::my_off_t) length > rest_of_file)
441
442
      length= (uint32_t) rest_of_file;
442
443
    if (!length || my_b_read(info->io_cache,info->cache,length))
443
444
    {
454
455
      int3store(ref_position,(long) i);
455
456
      ref_position+=3;
456
457
    }
457
 
    my_qsort(info->read_positions, length, info->struct_length,
458
 
             (qsort_cmp) rr_cmp);
 
458
    internal::my_qsort(info->read_positions, length, info->struct_length,
 
459
                       (qsort_cmp) rr_cmp);
459
460
 
460
461
    position=info->read_positions;
461
462
    for (i=0 ; i < length ; i++)
499
500
  return (int) a[7] - (int) b[7];
500
501
#endif
501
502
}
 
503
 
 
504
} /* namespace drizzled */