summaryrefslogtreecommitdiff
path: root/storage/maria
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/maria
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/maria')
-rw-r--r--storage/maria/ma_check_standalone.h2
-rw-r--r--storage/maria/ma_checksum.c2
-rw-r--r--storage/maria/ma_ft_update.c2
-rw-r--r--storage/maria/ma_sort.c37
4 files changed, 24 insertions, 19 deletions
diff --git a/storage/maria/ma_check_standalone.h b/storage/maria/ma_check_standalone.h
index 6626a62c4ef..890d6ba3d31 100644
--- a/storage/maria/ma_check_standalone.h
+++ b/storage/maria/ma_check_standalone.h
@@ -23,7 +23,7 @@ void _mi_report_crashed(void *file __attribute__((unused)),
{
}
-static unsigned int no_key()
+static unsigned int no_key(unsigned int not_used __attribute__((unused)))
{
return ENCRYPTION_KEY_VERSION_INVALID;
}
diff --git a/storage/maria/ma_checksum.c b/storage/maria/ma_checksum.c
index da2d40d3687..48b29946cea 100644
--- a/storage/maria/ma_checksum.c
+++ b/storage/maria/ma_checksum.c
@@ -58,7 +58,7 @@ ha_checksum _ma_checksum(MARIA_HA *info, const uchar *record)
length= _ma_calc_blob_length(blob_size_length, pos);
if (length)
{
- memcpy(&pos, pos + blob_size_length, sizeof(char*));
+ memcpy((char**) &pos, pos + blob_size_length, sizeof(char*));
crc= my_checksum(crc, pos, length);
}
continue;
diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c
index a166b7b21fb..59c134cd4d3 100644
--- a/storage/maria/ma_ft_update.c
+++ b/storage/maria/ma_ft_update.c
@@ -83,7 +83,7 @@ uint _ma_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
if (ftsi->seg->flag & HA_BLOB_PART)
{
ftsi->len= _ma_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/maria/ma_sort.c b/storage/maria/ma_sort.c
index ef6e8506ac6..e90b1d96a4a 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -195,8 +195,10 @@ int _ma_create_index_by_sort(MARIA_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)))
@@ -436,13 +438,15 @@ pthread_handler_t _ma_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 */
@@ -624,7 +628,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param)
length=param->sort_buffer_length;
while (length >= MIN_SORT_MEMORY)
{
- if ((mergebuf= my_malloc(length, MYF(0))))
+ if ((mergebuf= my_malloc((size_t) length, MYF(0))))
break;
length=length*3/4;
}
@@ -728,8 +732,8 @@ static int write_keys(MARIA_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))
@@ -774,8 +778,8 @@ static int write_keys_varlen(MARIA_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))
@@ -917,7 +921,8 @@ 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))
@@ -985,7 +990,7 @@ static int write_merge_key(MARIA_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));
}
/*
@@ -1045,7 +1050,7 @@ merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file,
if (to_file)
{
if (info->write_key(info,to_file, buffpek->key,
- (uint) sort_length,1))
+ sort_length, 1))
goto err; /* purecov: inspected */
}
else
@@ -1062,7 +1067,7 @@ merge_buffers(MARIA_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);