summaryrefslogtreecommitdiff
path: root/storage/maria/ma_sort.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/maria/ma_sort.c')
-rw-r--r--storage/maria/ma_sort.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c
index b9d6fffda86..f02a7a81020 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -50,7 +50,7 @@ extern void print_error(const char *fmt,...);
static ha_rows find_all_keys(MARIA_SORT_PARAM *info, ha_keys keys,
uchar **sort_keys,
- DYNAMIC_ARRAY *buffpek,uint *maxbuffer,
+ DYNAMIC_ARRAY *buffpek,size_t *maxbuffer,
IO_CACHE *tempfile,
IO_CACHE *tempfile_for_exceptions);
static int write_keys(MARIA_SORT_PARAM *info,uchar **sort_keys,
@@ -61,7 +61,7 @@ static int write_index(MARIA_SORT_PARAM *info, uchar **sort_keys,
ha_keys count);
static int merge_many_buff(MARIA_SORT_PARAM *info, ha_keys keys,
uchar **sort_keys,
- BUFFPEK *buffpek, uint *maxbuffer,
+ BUFFPEK *buffpek, size_t *maxbuffer,
IO_CACHE *t_file);
static my_off_t read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
uint sort_length);
@@ -69,7 +69,7 @@ static int merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys,
IO_CACHE *from_file, IO_CACHE *to_file,
uchar **sort_keys, BUFFPEK *lastbuff,
BUFFPEK *Fb, BUFFPEK *Tb);
-static int merge_index(MARIA_SORT_PARAM *,ha_keys,uchar **,BUFFPEK *, uint,
+static int merge_index(MARIA_SORT_PARAM *,ha_keys,uchar **,BUFFPEK *, size_t,
IO_CACHE *);
static int flush_maria_ft_buf(MARIA_SORT_PARAM *info);
@@ -126,8 +126,8 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
size_t sortbuff_size)
{
int error;
- uint sort_length, maxbuffer;
- size_t memavl, old_memavl;
+ uint sort_length;
+ size_t memavl, old_memavl, maxbuffer;
DYNAMIC_ARRAY buffpek;
ha_rows records, UNINIT_VAR(keys);
uchar **sort_keys;
@@ -165,7 +165,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
will be allocated when needed.
*/
keys= memavl / (sort_length+sizeof(char*));
- maxbuffer= (uint) MY_MIN((ulonglong) 1000, (records / keys)+1);
+ maxbuffer= (size_t) MY_MIN((ulonglong) 1000, (records / keys)+1);
}
else
{
@@ -173,7 +173,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
All keys can't fit in memory.
Calculate how many keys + buffers we can keep in memory
*/
- uint maxbuffer_org;
+ size_t maxbuffer_org;
do
{
maxbuffer_org= maxbuffer;
@@ -190,7 +190,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
goto err;
}
}
- while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org);
+ while ((maxbuffer= (size_t) (records/(keys-1)+1)) != maxbuffer_org);
}
if ((sort_keys= ((uchar**)
@@ -310,7 +310,7 @@ err:
static ha_rows find_all_keys(MARIA_SORT_PARAM *info, ha_rows keys,
uchar **sort_keys, DYNAMIC_ARRAY *buffpek,
- uint *maxbuffer, IO_CACHE *tempfile,
+ size_t *maxbuffer, IO_CACHE *tempfile,
IO_CACHE *tempfile_for_exceptions)
{
int error;
@@ -371,7 +371,7 @@ static my_bool _ma_thr_find_all_keys_exec(MARIA_SORT_PARAM* sort_param)
longlong sortbuff_size;
ha_keys UNINIT_VAR(keys), idx;
uint sort_length;
- uint maxbuffer;
+ size_t maxbuffer;
uchar **sort_keys= NULL;
DBUG_ENTER("_ma_thr_find_all_keys_exec");
DBUG_PRINT("enter", ("master: %d", sort_param->master));
@@ -406,11 +406,11 @@ static my_bool _ma_thr_find_all_keys_exec(MARIA_SORT_PARAM* sort_param)
will be allocated when needed.
*/
keys= memavl / (sort_length+sizeof(char*));
- maxbuffer= (uint) MY_MIN((ulonglong) 1000, (idx / keys)+1);
+ maxbuffer= (size_t) MY_MIN((ulonglong) 1000, (idx / keys)+1);
}
else
{
- uint maxbuffer_org;
+ size_t maxbuffer_org;
do
{
maxbuffer_org= maxbuffer;
@@ -622,7 +622,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
if (sinfo->buffpek.elements)
{
- uint maxbuffer=sinfo->buffpek.elements-1;
+ size_t maxbuffer=sinfo->buffpek.elements-1;
if (!mergebuf)
{
length=(size_t)param->sort_buffer_length;
@@ -838,9 +838,9 @@ static int write_index(MARIA_SORT_PARAM *info, register uchar **sort_keys,
static int merge_many_buff(MARIA_SORT_PARAM *info, ha_keys keys,
uchar **sort_keys, BUFFPEK *buffpek,
- uint *maxbuffer, IO_CACHE *t_file)
+ size_t *maxbuffer, IO_CACHE *t_file)
{
- uint tmp, merges, max_merges;
+ size_t tmp, merges, max_merges;
IO_CACHE t_file2, *from_file, *to_file, *temp;
BUFFPEK *lastbuff;
DBUG_ENTER("merge_many_buff");
@@ -866,7 +866,7 @@ static int merge_many_buff(MARIA_SORT_PARAM *info, ha_keys keys,
from_file= t_file ; to_file= &t_file2;
while (*maxbuffer >= MERGEBUFF2)
{
- uint i;
+ size_t i;
reinit_io_cache(from_file,READ_CACHE,0L,0,0);
reinit_io_cache(to_file,WRITE_CACHE,0L,0,0);
lastbuff=buffpek;
@@ -884,7 +884,7 @@ static int merge_many_buff(MARIA_SORT_PARAM *info, ha_keys keys,
if (flush_io_cache(to_file))
break; /* purecov: inspected */
temp=from_file; from_file=to_file; to_file=temp;
- *maxbuffer= (uint) (lastbuff-buffpek)-1;
+ *maxbuffer= (size_t) (lastbuff-buffpek)-1;
if (info->sort_info->param->max_stage != 1) /* If not parallel */
_ma_report_progress(info->sort_info->param, merges++, max_merges);
}
@@ -1140,7 +1140,7 @@ err:
static int
merge_index(MARIA_SORT_PARAM *info, ha_keys keys, uchar **sort_keys,
- BUFFPEK *buffpek, uint maxbuffer, IO_CACHE *tempfile)
+ BUFFPEK *buffpek, size_t maxbuffer, IO_CACHE *tempfile)
{
DBUG_ENTER("merge_index");
if (merge_buffers(info,keys,tempfile,(IO_CACHE*) 0,sort_keys,buffpek,buffpek,