Skip to content

Commit

Permalink
Fixed compiler warnings and test failures found by buildbot
Browse files Browse the repository at this point in the history
Fixed ccfilter to detect errors where the column is included in the error message
  • Loading branch information
montywi committed Jun 23, 2016
1 parent ec38c7e commit 4dc5075
Show file tree
Hide file tree
Showing 54 changed files with 312 additions and 264 deletions.
7 changes: 4 additions & 3 deletions extra/comp_err.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ static int create_sys_files(struct languages *lang_head,
uint error_count)
{
FILE *to;
uint csnum= 0, length, i, row_nr;
uint csnum= 0, i, row_nr;
ulong length;
uchar head[HEADER_LENGTH];
char outfile[FN_REFLEN], *outfile_end;
long start_pos;
Expand Down Expand Up @@ -397,8 +398,8 @@ static int create_sys_files(struct languages *lang_head,
DBUG_ASSERT(error_count == row_nr);

/* continue with header of the errmsg.sys file */
length= (my_ftell(to, MYF(0)) - HEADER_LENGTH -
(error_count + section_count) * 2);
length= (ulong) (my_ftell(to, MYF(0)) - HEADER_LENGTH -
(error_count + section_count) * 2);
bzero((uchar*) head, HEADER_LENGTH);
bmove((uchar*) head, (uchar*) file_head, 4);
head[4]= 1;
Expand Down
2 changes: 1 addition & 1 deletion extra/innochecksum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ parse_page(
}
if (per_page_details) {
printf("index %lu page %lu leaf %u n_recs %lu data_bytes %lu"
"\n", id, page_no, is_leaf, n_recs, data_bytes);
"\n", (ulong) id, page_no, is_leaf, n_recs, data_bytes);
}
/* update per-index statistics */
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include/master-slave.inc
[connection master]
connection slave;
call mtr.add_suppression("Master is configured to log replication events");
connection slave;
connection slave;
start slave;
connection master;
include/rpl_end.inc
4 changes: 2 additions & 2 deletions mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#
--source include/master-slave.inc

--connection slave

call mtr.add_suppression("Master is configured to log replication events");

--connection slave


# If everything is okay, the test will end in several seconds; maybe a minute.
# If the problem shows up, it will hang until testcase timeout is exceeded.
Expand Down
2 changes: 1 addition & 1 deletion mysys/lf_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static inline const uchar* hash_key(const LF_HASH *hash,
@note, that the hash value is limited to 2^31, because we need one
bit to distinguish between normal and dummy nodes.
*/
static inline my_hash_value_type calc_hash(const CHARSET_INFO *cs,
static inline my_hash_value_type calc_hash(CHARSET_INFO *cs,
const uchar *key,
size_t keylen)
{
Expand Down
14 changes: 7 additions & 7 deletions mysys/ma_dyncol.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ static my_bool type_and_offset_read_named(DYNAMIC_COLUMN_TYPE *type,
return 1;
}
*type= (val & 0xf) + 1;
*offset= val >> 4;
*offset= (size_t) (val >> 4);
return (*offset >= lim);
}

Expand Down Expand Up @@ -2803,7 +2803,7 @@ dynamic_column_update_copy(DYNAMIC_COLUMN *str, PLAN *plan,
else if (offs < first_offset)
goto err;

offs+= plan[i].ddelta;
offs+= (size_t) plan[i].ddelta;
{
DYNAMIC_COLUMN_VALUE val;
val.type= tp; // only the type used in the header
Expand Down Expand Up @@ -2969,7 +2969,7 @@ dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan,
return ER_DYNCOL_FORMAT;
}

offs+= plan[i].ddelta;
offs+= (size_t) plan[i].ddelta;
int2store(write, nm);
/* write rest of data at write + COLUMN_NUMBER_SIZE */
type_and_offset_store_num(write, new_offset_size, tp, offs);
Expand Down Expand Up @@ -3023,9 +3023,9 @@ dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan,
memmove((header_base + new_header_size +
plan[i].mv_offset + plan[i].ddelta),
header_base + header_size + plan[i].mv_offset,
plan[i].mv_length);
(size_t) plan[i].mv_length);
}
str->length+= plan[i].mv_length;
str->length+= (size_t) plan[i].mv_length;

/* new data adding */
if (i < add_column_count)
Expand Down Expand Up @@ -3514,8 +3514,8 @@ dynamic_column_update_many_fmt(DYNAMIC_COLUMN *str,
Check if it is only "increasing" or only "decreasing" plan for (header
and data separately).
*/
new_header.data_size= header.data_size + data_delta;
new_header.nmpool_size= new_header.nmpool_size + name_delta;
new_header.data_size= (size_t) (header.data_size + data_delta);
new_header.nmpool_size= (size_t) (new_header.nmpool_size + name_delta);
DBUG_ASSERT(new_header.format != dyncol_fmt_num ||
new_header.nmpool_size == 0);
if ((new_header.offset_size=
Expand Down
4 changes: 2 additions & 2 deletions mysys/mf_iocache.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ int _my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
{
my_off_t old_pos_in_file= info->pos_in_file;
res= info->write_function(info, Buffer, Count);
Count-= info->pos_in_file - old_pos_in_file;
Count-= (size_t) (info->pos_in_file - old_pos_in_file);
Buffer+= info->pos_in_file - old_pos_in_file;
}
else
Expand Down Expand Up @@ -1226,7 +1226,7 @@ static int _my_b_cache_read_r(IO_CACHE *cache, uchar *Buffer, size_t Count)
static void copy_to_read_buffer(IO_CACHE *write_cache,
const uchar *write_buffer, my_off_t pos_in_file)
{
size_t write_length= write_cache->pos_in_file - pos_in_file;
size_t write_length= (size_t) (write_cache->pos_in_file - pos_in_file);
IO_CACHE_SHARE *cshare= write_cache->share;

DBUG_ASSERT(cshare->source_cache == write_cache);
Expand Down
4 changes: 2 additions & 2 deletions mysys/mulalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void *my_multi_malloc_large(myf myFlags, ...)
{
va_list args;
char **ptr,*start,*res;
size_t tot_length,length;
ulonglong tot_length,length;
DBUG_ENTER("my_multi_malloc");

va_start(args,myFlags);
Expand All @@ -92,7 +92,7 @@ void *my_multi_malloc_large(myf myFlags, ...)
}
va_end(args);

if (!(start=(char *) my_malloc(tot_length, myFlags)))
if (!(start=(char *) my_malloc((size_t) tot_length, myFlags)))
DBUG_RETURN(0); /* purecov: inspected */

va_start(args,myFlags);
Expand Down
2 changes: 1 addition & 1 deletion sql/item_windowfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ class Item_sum_ntile : public Item_sum_window_with_row_count

double val_real()
{
return val_int();
return (double) val_int();
}

longlong val_int()
Expand Down
4 changes: 2 additions & 2 deletions sql/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1681,13 +1681,13 @@ static int binlog_close_connection(handlerton *hton, THD *thd)
size_t len=0;
wsrep_write_cache_buf(cache, &buf, &len);
WSREP_WARN("binlog trx cache not empty (%lu bytes) @ connection close %lld",
len, (longlong) thd->thread_id);
(ulong) len, (longlong) thd->thread_id);
if (len > 0) wsrep_dump_rbr_buf(thd, buf, len);

cache = cache_mngr->get_binlog_cache_log(false);
wsrep_write_cache_buf(cache, &buf, &len);
WSREP_WARN("binlog stmt cache not empty (%lu bytes) @ connection close %lld",
len, (longlong) thd->thread_id);
(ulong) len, (longlong) thd->thread_id);
if (len > 0) wsrep_dump_rbr_buf(thd, buf, len);
}
#endif /* WITH_WSREP */
Expand Down
2 changes: 1 addition & 1 deletion sql/mdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ int mdl_iterate(int (*callback)(MDL_ticket *ticket, void *arg), void *arg)
my_hash_value_type mdl_hash_function(CHARSET_INFO *cs,
const uchar *key, size_t length)
{
MDL_key *mdl_key= (MDL_key*) (key - offsetof(MDL_key, m_ptr));
MDL_key *mdl_key= (MDL_key*) (key - my_offsetof(MDL_key, m_ptr));
return mdl_key->hash_value();
}

Expand Down
4 changes: 2 additions & 2 deletions sql/rpl_gtid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,8 @@ gtid_parser_helper(char **ptr, char *end, rpl_gtid *out_gtid)
if (err != 0)
return 1;

out_gtid->domain_id= v1;
out_gtid->server_id= v2;
out_gtid->domain_id= (uint32) v1;
out_gtid->server_id= (uint32) v2;
out_gtid->seq_no= v3;
*ptr= q;
return 0;
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_cte.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class With_element : public Sql_alloc
LEX_STRING unparsed_spec;

/* Return the map where 1 is set only in the position for this element */
table_map get_elem_map() { return 1 << number; }
table_map get_elem_map() { return (table_map) 1 << number; }

public:
/*
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ C_MODE_END
void mysql_print_status()
{
char current_dir[FN_REFLEN];
char llbuff[10][22];
STATUS_VAR tmp;
uint count;

Expand Down Expand Up @@ -616,6 +615,7 @@ Next alarm time: %lu\n",
display_table_locks();
#ifdef HAVE_MALLINFO
struct mallinfo info= mallinfo();
char llbuff[10][22];
printf("\nMemory status:\n\
Non-mmapped space allocated from system: %s\n\
Number of free chunks: %lu\n\
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_time.cc
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime,
bool int_to_datetime_with_warn(bool neg, ulonglong value, MYSQL_TIME *ltime,
ulonglong fuzzydate, const char *field_name)
{
const ErrConvInteger str(neg ? -value : value, !neg);
const ErrConvInteger str(neg ? - (longlong) value : (longlong) value, !neg);
return number_to_time_with_warn(neg, value, 0, ltime,
fuzzydate, &str, field_name);
}
Expand Down

0 comments on commit 4dc5075

Please sign in to comment.