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