43
43
/* Functions defined in this file */
45
static ha_rows find_all_keys(MI_SORT_PARAM *info,uint32_t keys,
47
ha_rows find_all_keys(MI_SORT_PARAM *info,uint32_t keys,
46
48
unsigned char **sort_keys,
47
49
DYNAMIC_ARRAY *buffpek,
49
51
IO_CACHE *tempfile,
50
52
IO_CACHE *tempfile_for_exceptions);
51
static int write_keys(MI_SORT_PARAM *info,unsigned char **sort_keys,
53
int write_keys(MI_SORT_PARAM *info,unsigned char **sort_keys,
52
54
uint32_t count, BUFFPEK *buffpek,IO_CACHE *tempfile);
53
static int write_key(MI_SORT_PARAM *info, unsigned char *key,
55
int write_key(MI_SORT_PARAM *info, unsigned char *key,
54
56
IO_CACHE *tempfile);
55
static int write_index(MI_SORT_PARAM *info,unsigned char * *sort_keys,
57
int write_index(MI_SORT_PARAM *info,unsigned char * *sort_keys,
57
static int merge_many_buff(MI_SORT_PARAM *info,uint32_t keys,
59
int merge_many_buff(MI_SORT_PARAM *info,uint32_t keys,
58
60
unsigned char * *sort_keys,
59
61
BUFFPEK *buffpek,size_t *maxbuffer,
61
static uint32_t read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
63
uint32_t read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
62
64
uint32_t sort_length);
63
static int merge_buffers(MI_SORT_PARAM *info,uint32_t keys,
65
int merge_buffers(MI_SORT_PARAM *info,uint32_t keys,
64
66
IO_CACHE *from_file, IO_CACHE *to_file,
65
67
unsigned char * *sort_keys, BUFFPEK *lastbuff,
66
68
BUFFPEK *Fb, BUFFPEK *Tb);
67
static int merge_index(MI_SORT_PARAM *,uint,unsigned char **,BUFFPEK *, int,
69
int merge_index(MI_SORT_PARAM *,uint,unsigned char **,BUFFPEK *, int,
70
static int write_keys_varlen(MI_SORT_PARAM *info,unsigned char **sort_keys,
71
uint32_t count, BUFFPEK *buffpek,
73
static uint32_t read_to_buffer_varlen(IO_CACHE *fromfile,BUFFPEK *buffpek,
74
uint32_t sort_length);
75
static int write_merge_key(MI_SORT_PARAM *info, IO_CACHE *to_file,
76
unsigned char *key, uint32_t sort_length, uint32_t count);
77
static int write_merge_key_varlen(MI_SORT_PARAM *info,
79
unsigned char* key, uint32_t sort_length,
71
int write_keys_varlen(MI_SORT_PARAM *info,unsigned char **sort_keys,
72
uint32_t count, BUFFPEK *buffpek,
74
uint32_t read_to_buffer_varlen(IO_CACHE *fromfile,BUFFPEK *buffpek,
75
uint32_t sort_length);
76
int write_merge_key(MI_SORT_PARAM *info, IO_CACHE *to_file,
77
unsigned char *key, uint32_t sort_length, uint32_t count);
78
int write_merge_key_varlen(MI_SORT_PARAM *info,
80
unsigned char* key, uint32_t sort_length,
82
84
my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, unsigned char *bufs);