summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2016-06-24 02:25:14 +0300
committerMonty <monty@mariadb.org>2016-06-24 02:25:14 +0300
commit4dc50758603d6ed2891412fdb6d37cd8b5541999 (patch)
treec31def9d565271ff6ca10ec9c15433a12e91bba6 /storage/myisam
parentec38c7e60bf8dbe54b1551e75254337bec1993a4 (diff)
downloadmariadb-git-4dc50758603d6ed2891412fdb6d37cd8b5541999.tar.gz
Fixed compiler warnings and test failures found by buildbot
Fixed ccfilter to detect errors where the column is included in the error message
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/ft_update.c2
-rw-r--r--storage/myisam/mi_unique.c6
-rw-r--r--storage/myisam/sort.c39
3 files changed, 26 insertions, 21 deletions
diff --git a/storage/myisam/ft_update.c b/storage/myisam/ft_update.c
index 10a36650b0a..8f437476121 100644
--- a/storage/myisam/ft_update.c
+++ b/storage/myisam/ft_update.c
@@ -83,7 +83,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
if (ftsi->seg->flag & HA_BLOB_PART)
{
ftsi->len=_mi_calc_blob_length(ftsi->seg->bit_start,ftsi->pos);
- memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*));
+ memcpy((char**) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*));
DBUG_RETURN(1);
}
ftsi->len=ftsi->seg->length;
diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c
index 5192d404939..dae453beaec 100644
--- a/storage/myisam/mi_unique.c
+++ b/storage/myisam/mi_unique.c
@@ -112,7 +112,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record)
else if (keyseg->flag & HA_BLOB_PART)
{
uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos);
- memcpy(&pos, pos+keyseg->bit_start, sizeof(char*));
+ memcpy((char**) &pos, pos+keyseg->bit_start, sizeof(char*));
if (!length || length > tmp_length)
length=tmp_length; /* The whole blob */
}
@@ -207,8 +207,8 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b,
set_if_smaller(a_length, keyseg->length);
set_if_smaller(b_length, keyseg->length);
}
- memcpy(&pos_a, pos_a+keyseg->bit_start, sizeof(char*));
- memcpy(&pos_b, pos_b+keyseg->bit_start, sizeof(char*));
+ memcpy((char**) &pos_a, pos_a+keyseg->bit_start, sizeof(char*));
+ memcpy((char**) &pos_b, pos_b+keyseg->bit_start, sizeof(char*));
}
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 ||
type == HA_KEYTYPE_VARTEXT2)
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index f490e5f0b44..17e2ca4190b 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -191,8 +191,9 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org);
}
- if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+
- HA_FT_MAXBYTELEN, MYF(0))))
+ if ((sort_keys= ((uchar **)
+ my_malloc((size_t) (keys*(sort_length+sizeof(char*))+
+ HA_FT_MAXBYTELEN), MYF(0)))))
{
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
MY_MIN(maxbuffer/2, 1000), MYF(0)))
@@ -417,13 +418,15 @@ pthread_handler_t thr_find_all_keys(void *arg)
}
while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org);
}
- if ((sort_keys= (uchar**)
- my_malloc(keys*(sort_length+sizeof(char*))+
- ((sort_param->keyinfo->flag & HA_FULLTEXT) ?
- HA_FT_MAXBYTELEN : 0), MYF(0))))
+ if ((sort_keys= ((uchar**)
+ my_malloc((size_t)
+ (keys*(sort_length+sizeof(char*))+
+ ((sort_param->keyinfo->flag & HA_FULLTEXT) ?
+ HA_FT_MAXBYTELEN : 0)), MYF(0)))))
{
if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK),
- maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0)))
+ maxbuffer, MY_MIN(maxbuffer/2, 1000),
+ MYF(0)))
{
my_free(sort_keys);
sort_keys= (uchar **) NULL; /* for err: label */
@@ -603,7 +606,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
length=param->sort_buffer_length;
while (length >= MIN_SORT_BUFFER)
{
- if ((mergebuf= my_malloc(length, MYF(0))))
+ if ((mergebuf= my_malloc((size_t) length, MYF(0))))
break;
length=length*3/4;
}
@@ -695,8 +698,8 @@ static int write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
if (!buffpek)
DBUG_RETURN(1); /* Out of memory */
- my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp,
- info);
+ my_qsort2((uchar*) sort_keys,(size_t) count, sizeof(uchar*),
+ (qsort2_cmp) info->key_cmp, info);
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST",
DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
@@ -741,8 +744,8 @@ static int write_keys_varlen(MI_SORT_PARAM *info,
if (!buffpek)
DBUG_RETURN(1); /* Out of memory */
- my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp,
- info);
+ my_qsort2((uchar*) sort_keys, (size_t) count, sizeof(uchar*),
+ (qsort2_cmp) info->key_cmp, info);
if (!my_b_inited(tempfile) &&
open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST",
DISK_BUFFER_SIZE, info->sort_info->param->myf_rw))
@@ -865,10 +868,12 @@ static my_off_t read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek,
register ha_keys count;
my_off_t length;
- if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys,buffpek->count)))
+ if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys,
+ (ha_rows) buffpek->count)))
{
if (my_b_pread(fromfile, (uchar*) buffpek->base,
- (length= sort_length * count), buffpek->file_pos))
+ (length= (my_off_t) (sort_length * count)),
+ buffpek->file_pos))
return(HA_OFFSET_ERROR);
buffpek->key=buffpek->base;
buffpek->file_pos+= length; /* New filepos */
@@ -933,7 +938,7 @@ static int write_merge_key(MI_SORT_PARAM *info __attribute__((unused)),
IO_CACHE *to_file, uchar *key,
uint sort_length, ha_keys count)
{
- return my_b_write(to_file, key, ((size_t) sort_length) * count);
+ return my_b_write(to_file, key, (size_t) (sort_length * count));
}
/*
@@ -993,7 +998,7 @@ merge_buffers(MI_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file,
if (to_file)
{
if (info->write_key(info,to_file,(uchar*) buffpek->key,
- (uint) sort_length,1))
+ sort_length, 1))
{
error=1; goto err; /* purecov: inspected */
}
@@ -1016,7 +1021,7 @@ merge_buffers(MI_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file,
if (!(read_length= info->read_to_buffer(from_file,buffpek,sort_length)))
{
uchar *base= buffpek->base;
- uint max_keys=buffpek->max_keys;
+ ha_keys max_keys=buffpek->max_keys;
queue_remove_top(&queue);