51
51
unsigned char **sort_keys,
52
52
DYNAMIC_ARRAY *buffpek,
54
internal::IO_CACHE *tempfile,
55
internal::IO_CACHE *tempfile_for_exceptions);
54
internal::io_cache_st *tempfile,
55
internal::io_cache_st *tempfile_for_exceptions);
56
56
static int write_keys(MI_SORT_PARAM *info,unsigned char **sort_keys,
57
uint32_t count, BUFFPEK *buffpek,internal::IO_CACHE *tempfile);
57
uint32_t count, BUFFPEK *buffpek,internal::io_cache_st *tempfile);
58
58
static int write_key(MI_SORT_PARAM *info, unsigned char *key,
59
internal::IO_CACHE *tempfile);
59
internal::io_cache_st *tempfile);
60
60
static int write_index(MI_SORT_PARAM *info,unsigned char * *sort_keys,
62
62
static int merge_many_buff(MI_SORT_PARAM *info,uint32_t keys,
63
63
unsigned char * *sort_keys,
64
64
BUFFPEK *buffpek,size_t *maxbuffer,
65
internal::IO_CACHE *t_file);
66
static uint32_t read_to_buffer(internal::IO_CACHE *fromfile,BUFFPEK *buffpek,
65
internal::io_cache_st *t_file);
66
static uint32_t read_to_buffer(internal::io_cache_st *fromfile,BUFFPEK *buffpek,
67
67
uint32_t sort_length);
68
68
static int merge_buffers(MI_SORT_PARAM *info,uint32_t keys,
69
internal::IO_CACHE *from_file, internal::IO_CACHE *to_file,
69
internal::io_cache_st *from_file, internal::io_cache_st *to_file,
70
70
unsigned char * *sort_keys, BUFFPEK *lastbuff,
71
71
BUFFPEK *Fb, BUFFPEK *Tb);
72
72
static int merge_index(MI_SORT_PARAM *,uint,unsigned char **,BUFFPEK *, int,
73
internal::IO_CACHE *);
73
internal::io_cache_st *);
74
74
static int write_keys_varlen(MI_SORT_PARAM *info,unsigned char **sort_keys,
75
75
uint32_t count, BUFFPEK *buffpek,
76
internal::IO_CACHE *tempfile);
77
static uint32_t read_to_buffer_varlen(internal::IO_CACHE *fromfile,BUFFPEK *buffpek,
76
internal::io_cache_st *tempfile);
77
static uint32_t read_to_buffer_varlen(internal::io_cache_st *fromfile,BUFFPEK *buffpek,
78
78
uint32_t sort_length);
79
static int write_merge_key(MI_SORT_PARAM *info, internal::IO_CACHE *to_file,
79
static int write_merge_key(MI_SORT_PARAM *info, internal::io_cache_st *to_file,
80
80
unsigned char *key, uint32_t sort_length, uint32_t count);
81
81
static int write_merge_key_varlen(MI_SORT_PARAM *info,
82
internal::IO_CACHE *to_file,
82
internal::io_cache_st *to_file,
83
83
unsigned char* key, uint32_t sort_length,
87
my_var_write(MI_SORT_PARAM *info, internal::IO_CACHE *to_file, unsigned char *bufs);
87
my_var_write(MI_SORT_PARAM *info, internal::io_cache_st *to_file, unsigned char *bufs);
90
90
Creates a index of sorted keys
551
551
static int merge_many_buff(MI_SORT_PARAM *info, uint32_t keys,
552
552
unsigned char **sort_keys, BUFFPEK *buffpek,
553
size_t *maxbuffer, internal::IO_CACHE *t_file)
553
size_t *maxbuffer, internal::io_cache_st *t_file)
556
internal::IO_CACHE t_file2, *from_file, *to_file, *temp;
556
internal::io_cache_st t_file2, *from_file, *to_file, *temp;
557
557
BUFFPEK *lastbuff;
559
559
if (*maxbuffer < MERGEBUFF2)
709
merge_buffers(MI_SORT_PARAM *info, uint32_t keys, internal::IO_CACHE *from_file,
710
internal::IO_CACHE *to_file, unsigned char **sort_keys, BUFFPEK *lastbuff,
709
merge_buffers(MI_SORT_PARAM *info, uint32_t keys, internal::io_cache_st *from_file,
710
internal::io_cache_st *to_file, unsigned char **sort_keys, BUFFPEK *lastbuff,
711
711
BUFFPEK *Fb, BUFFPEK *Tb)
825
825
merge_index(MI_SORT_PARAM *info, uint32_t keys, unsigned char **sort_keys,
826
BUFFPEK *buffpek, int maxbuffer, internal::IO_CACHE *tempfile)
826
BUFFPEK *buffpek, int maxbuffer, internal::io_cache_st *tempfile)
828
if (merge_buffers(info,keys,tempfile,(internal::IO_CACHE*) 0,sort_keys,buffpek,buffpek,
828
if (merge_buffers(info,keys,tempfile,(internal::io_cache_st*) 0,sort_keys,buffpek,buffpek,
829
829
buffpek+maxbuffer))