Fixed compiler warnings and test failures found by buildbot

Fixed ccfilter to detect errors where the column is included in the error message
This commit is contained in:
Monty 2016-06-24 02:25:14 +03:00
parent ec38c7e60b
commit 4dc5075860
54 changed files with 312 additions and 264 deletions

View file

@ -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;
@ -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;

View file

@ -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 */
{

View file

@ -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

View file

@ -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.

View file

@ -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)
{

View file

@ -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);
}
@ -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
@ -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);
@ -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)
@ -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=

View file

@ -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
@ -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);

View file

@ -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);
@ -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);

View file

@ -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()

View file

@ -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 */

View file

@ -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();
}

View file

@ -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;

View file

@ -41,7 +41,7 @@ private:
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:
/*

View file

@ -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;
@ -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\

View file

@ -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);
}

View file

@ -696,7 +696,7 @@ public:
- in table->record[0]..
- rownum parameter has the row number.
*/
void on_next_partition(int rownum)
void on_next_partition(ha_rows rownum)
{
/* Remember the sort key value from the new partition */
bound_tracker.check_if_next_group();
@ -706,7 +706,7 @@ public:
/*
Moves to a new row. The row is assumed to be within the current partition
*/
void move_to(int rownum) { tbl_cursor.move_to(rownum); }
void move_to(ha_rows rownum) { tbl_cursor.move_to(rownum); }
/*
This returns -1 when end of partition was reached.
@ -796,8 +796,8 @@ public:
- The callee may move tbl->file and tbl->record[0] to point to some other
row.
*/
virtual void pre_next_partition(longlong rownum, Item_sum* item){};
virtual void next_partition(longlong rownum, Item_sum* item)=0;
virtual void pre_next_partition(ha_rows rownum, Item_sum* item){};
virtual void next_partition(ha_rows rownum, Item_sum* item)=0;
/*
The current row has moved one row forward.
@ -872,13 +872,13 @@ public:
item_add->fix_fields(thd, &item_add);
}
void pre_next_partition(longlong rownum, Item_sum* item)
void pre_next_partition(ha_rows rownum, Item_sum* item)
{
// Save the value of FUNC(current_row)
range_expr->fetch_value_from(item_add);
}
void next_partition(longlong rownum, Item_sum* item)
void next_partition(ha_rows rownum, Item_sum* item)
{
cursor.move_to(rownum);
walk_till_non_peer(item);
@ -982,7 +982,7 @@ public:
item_add->fix_fields(thd, &item_add);
}
void pre_next_partition(longlong rownum, Item_sum* item)
void pre_next_partition(ha_rows rownum, Item_sum* item)
{
// Save the value of FUNC(current_row)
range_expr->fetch_value_from(item_add);
@ -991,7 +991,7 @@ public:
end_of_partition= false;
}
void next_partition(longlong rownum, Item_sum* item)
void next_partition(ha_rows rownum, Item_sum* item)
{
cursor.move_to(rownum);
walk_till_non_peer(item);
@ -1068,7 +1068,7 @@ public:
peer_tracker.init(thd, order_list);
}
void pre_next_partition(longlong rownum, Item_sum* item)
void pre_next_partition(ha_rows rownum, Item_sum* item)
{
// Save the value of the current_row
peer_tracker.check_if_next_group();
@ -1080,7 +1080,7 @@ public:
}
}
void next_partition(longlong rownum, Item_sum* item)
void next_partition(ha_rows rownum, Item_sum* item)
{
walk_till_non_peer(item);
}
@ -1158,14 +1158,14 @@ public:
peer_tracker.init(thd, order_list);
}
void pre_next_partition(longlong rownum, Item_sum* item)
void pre_next_partition(ha_rows rownum, Item_sum* item)
{
// Fetch the value from the first row
peer_tracker.check_if_next_group();
cursor.move_to(rownum+1);
}
void next_partition(longlong rownum, Item_sum* item) {}
void next_partition(ha_rows rownum, Item_sum* item) {}
void pre_next_row(Item_sum* item)
{
@ -1214,7 +1214,7 @@ public:
class Frame_unbounded_preceding : public Frame_cursor
{
public:
void next_partition(longlong rownum, Item_sum* item)
void next_partition(ha_rows rownum, Item_sum* item)
{
/*
UNBOUNDED PRECEDING frame end just stays on the first row.
@ -1245,12 +1245,12 @@ public:
cursor.init(thd, info, partition_list);
}
void pre_next_partition(longlong rownum, Item_sum* item)
void pre_next_partition(ha_rows rownum, Item_sum* item)
{
cursor.on_next_partition(rownum);
}
void next_partition(longlong rownum, Item_sum* item)
void next_partition(ha_rows rownum, Item_sum* item)
{
if (!rownum)
{
@ -1279,9 +1279,9 @@ class Frame_unbounded_following_set_count : public Frame_unbounded_following
public:
// pre_next_partition is inherited
void next_partition(longlong rownum, Item_sum* item)
void next_partition(ha_rows rownum, Item_sum* item)
{
ulonglong num_rows_in_partition= 0;
ha_rows num_rows_in_partition= 0;
if (!rownum)
{
/* Read the first row */
@ -1330,7 +1330,7 @@ public:
cursor.init(info);
}
void next_partition(longlong rownum, Item_sum* item)
void next_partition(ha_rows rownum, Item_sum* item)
{
/*
Position our cursor to point at the first row in the new partition
@ -1391,11 +1391,11 @@ public:
class Frame_rows_current_row_bottom : public Frame_cursor
{
public:
void pre_next_partition(longlong rownum, Item_sum* item)
void pre_next_partition(ha_rows rownum, Item_sum* item)
{
item->add();
}
void next_partition(longlong rownum, Item_sum* item) {}
void next_partition(ha_rows rownum, Item_sum* item) {}
void pre_next_row(Item_sum* item)
{
/* Temp table's current row is current_row. Add it to the window func */
@ -1456,7 +1456,7 @@ public:
at_partition_end= false;
}
void pre_next_partition(longlong rownum, Item_sum* item)
void pre_next_partition(ha_rows rownum, Item_sum* item)
{
at_partition_end= false;
@ -1476,10 +1476,10 @@ public:
}
/* Move our cursor to be n_rows ahead. */
void next_partition(longlong rownum, Item_sum* item)
void next_partition(ha_rows rownum, Item_sum* item)
{
longlong i_end= n_rows + ((rownum==0)?1:0)- is_top_bound;
for (longlong i= 0; i < i_end; i++)
ha_rows i_end= n_rows + ((rownum==0)?1:0)- is_top_bound;
for (ha_rows i= 0; i < i_end; i++)
{
if (next_row_intern(item))
break;
@ -1561,10 +1561,10 @@ Frame_cursor *get_frame_cursor(Window_frame *frame, bool is_top_bound)
if (frame->units == Window_frame::UNITS_ROWS)
{
longlong n_rows= bound->offset->val_int();
ha_rows n_rows= bound->offset->val_int();
/* These should be handled in the parser */
DBUG_ASSERT(!bound->offset->null_value);
DBUG_ASSERT(n_rows >= 0);
DBUG_ASSERT((longlong) n_rows >= 0);
if (is_preceding)
return new Frame_n_rows_preceding(is_top_bound, n_rows);
else
@ -1676,7 +1676,7 @@ void get_window_func_required_cursors(
bool compute_window_func_with_frames(Item_window_func *item_win,
TABLE *tbl, READ_RECORD *info)
{
THD *thd= current_thd;
THD *thd= tbl->in_use;
int err= 0;
Item_sum *sum_func= item_win->window_func();
@ -1695,7 +1695,7 @@ bool compute_window_func_with_frames(Item_window_func *item_win,
}
bool is_error= false;
longlong rownum= 0;
ha_rows rownum= 0;
uchar *rowid_buf= (uchar*) my_malloc(tbl->file->ref_length, MYF(0));
while (true)

View file

@ -57,6 +57,7 @@ class DOXDEF: public DOSDEF {
/* This is the DOS/UNIX Access Method base class declaration. */
/***********************************************************************/
class TDBDOX: public TDBDOS {
TDBDOX(): TDBDOS((PGLOBAL)0,(PTDBDOS) 0) {} /* Never called */
friend int MakeIndex(PGLOBAL, PTDB, PIXDEF);
friend int CntCloseTable(PGLOBAL, PTDB, bool, bool);
friend int CntIndexInit(PGLOBAL, PTDB, int, bool);

View file

@ -721,7 +721,7 @@ int CSORT::Qsortc(void)
void CSORT::Qstc(int *base, int *max)
{
register int *i, *j, *jj, *lt, *eq, *gt, *mid;
int c, lo, hi, rc;
int c= 0, lo, hi, rc;
size_t zlo, zhi, cnm;
zlo = zhi = cnm = 0; // Avoid warning message
@ -775,7 +775,11 @@ void CSORT::Qstc(int *base, int *max)
/* Small group. Do special quicker processing. */
/*****************************************************************/
if ((rc = Qcompare(base, (i = base + 1))) > 0)
c = *base, *base = *i, *i = c;
{
c = *base;
*base = *i;
*i = c;
}
if (Pof)
Pof[base - Pex] = Pof[i - Pex] = (rc) ? 1 : 2;

View file

@ -1098,7 +1098,7 @@ bool GetBooleanTableOption(PGLOBAL g, PTOS options, char *opname, bool bdef)
/****************************************************************************/
int GetIntegerTableOption(PGLOBAL g, PTOS options, char *opname, int idef)
{
ulonglong opval= NO_IVAL;
ulonglong opval= (ulonglong) NO_IVAL;
if (!options)
return idef;

View file

@ -1302,7 +1302,7 @@ static my_bool CalcLen(UDF_ARGS *args, my_bool obj,
{
char fn[_MAX_PATH];
unsigned long i, k, m, n;
long fl, j = -1;
long fl= 0, j = -1;
reslen = args->arg_count + 2;
@ -1370,7 +1370,6 @@ static my_bool CalcLen(UDF_ARGS *args, my_bool obj,
memlen += (k + sizeof(JOBJECT) + sizeof(JPAIR));
} else
memlen += sizeof(JARRAY);
fl= 0;
switch (args->arg_type[i]) {
case STRING_RESULT:
if (n == 2 && args->args[i]) {

View file

@ -681,7 +681,7 @@ bool TDBODBC::MakeCommand(PGLOBAL g)
} else {
sprintf(g->Message, "Cannot use this %s command",
(Mode == MODE_UPDATE) ? "UPDATE" : "DELETE");
return NULL;
return false;
} // endif p
Query = new(g) STRING(g, 0, stmt);

View file

@ -4070,7 +4070,7 @@ btr_estimate_number_of_different_key_vals(
*/
if (index->stat_index_size > 1) {
n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ?
ut_min(index->stat_index_size,
(ulint) ut_min((double) index->stat_index_size,
log2(index->stat_index_size)*srv_stats_transient_sample_pages)
: index->stat_index_size;

View file

@ -151,7 +151,7 @@ void
btr_defragment_init()
{
srv_defragment_interval = ut_microseconds_to_timer(
1000000.0 / srv_defragment_frequency);
(ulonglong) (1000000.0 / srv_defragment_frequency));
mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex,
SYNC_ANY_LATCH);
os_thread_create(btr_defragment_thread, NULL, NULL);

View file

@ -2066,7 +2066,7 @@ ulint
af_get_pct_for_dirty()
/*==================*/
{
ulint dirty_pct = buf_get_modified_ratio_pct();
ulint dirty_pct = (ulint) buf_get_modified_ratio_pct();
if (dirty_pct > 0 && srv_max_buf_pool_modified_pct == 0) {
return(100);
@ -2086,7 +2086,7 @@ af_get_pct_for_dirty()
}
} else if (dirty_pct > srv_max_dirty_pages_pct_lwm) {
/* We should start flushing pages gradually. */
return((dirty_pct * 100)
return (ulint) ((dirty_pct * 100)
/ (srv_max_buf_pool_modified_pct + 1));
}
@ -2104,8 +2104,8 @@ af_get_pct_for_lsn(
{
lsn_t max_async_age;
lsn_t lsn_age_factor;
lsn_t af_lwm = (srv_adaptive_flushing_lwm
* log_get_capacity()) / 100;
lsn_t af_lwm = (lsn_t) ((srv_adaptive_flushing_lwm
* log_get_capacity()) / 100);
if (age < af_lwm) {
/* No adaptive flushing. */

View file

@ -474,7 +474,7 @@ fil_parse_write_crypt_data(
4 + // size of key_id
1; // fil_encryption_t
if (end_ptr - ptr < entry_size){
if ((uint) (end_ptr - ptr) < entry_size){
return NULL;
}
@ -500,7 +500,7 @@ fil_parse_write_crypt_data(
fil_encryption_t encryption = (fil_encryption_t)mach_read_from_1(ptr);
ptr +=1;
if (end_ptr - ptr < len) {
if ((uint) (end_ptr - ptr) < len) {
return NULL;
}
@ -1351,7 +1351,7 @@ fil_crypt_space_needs_rotation(
last_scrub_completed;
bool need_scrubbing =
crypt_data->rotate_state.scrubbing.is_active
&& diff >= srv_background_scrub_data_interval;
&& diff >= (time_t) srv_background_scrub_data_interval;
if (need_key_rotation == false && need_scrubbing == false)
break;
@ -2247,7 +2247,7 @@ DECLARE_THREAD(fil_crypt_thread)(
time_t waited = time(0) - wait_start;
if (waited >= srv_background_scrub_data_check_interval) {
if (waited >= (time_t) srv_background_scrub_data_check_interval) {
break;
}
}

View file

@ -17753,7 +17753,7 @@ innodb_defragment_frequency_update(
{
srv_defragment_frequency = (*static_cast<const uint*>(save));
srv_defragment_interval = ut_microseconds_to_timer(
1000000.0 / srv_defragment_frequency);
(ulonglong) (1000000.0 / srv_defragment_frequency));
}
/****************************************************************//**

View file

@ -2387,7 +2387,7 @@ lock_rec_add_to_queue(
if (wsrep_debug) {
fprintf(stderr,
"BF skipping wait: %lu\n",
trx->id);
(ulong) trx->id);
lock_rec_print(stderr, lock);
}
} else
@ -4961,7 +4961,7 @@ lock_table_other_has_incompatible(
#ifdef WITH_WSREP
if(wsrep_thd_is_wsrep(trx->mysql_thd)) {
if (wsrep_debug) {
fprintf(stderr, "WSREP: trx %ld table lock abort\n",
fprintf(stderr, "WSREP: trx " TRX_ID_FMT " table lock abort\n",
trx->id);
}
trx_mutex_enter(lock->trx);

View file

@ -144,11 +144,11 @@ log_crypt_print_checkpoint_keys(
ib_uint64_t checkpoint_no = log_block_get_checkpoint_no(log_block);
if (crypt_info.size()) {
fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", checkpoint_no);
fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", (ulong) checkpoint_no);
for (size_t i = 0; i < crypt_info.size(); i++) {
struct crypt_info_t* it = &crypt_info[i];
fprintf(stderr, "[ %lu %u ] ",
it->checkpoint_no,
(ulong) it->checkpoint_no,
it->key_version);
}
fprintf(stderr, "\n");

View file

@ -2402,7 +2402,7 @@ os_file_set_size(
fprintf(stderr, "InnoDB: Error: preallocating file "
"space for file \'%s\' failed. Current size "
"%lu, desired size %lu\n",
name, current_size, size);
name, (ulong) current_size, (ulong) size);
os_file_handle_error_no_exit(name, "posix_fallocate", FALSE, __FILE__, __LINE__);
return(FALSE);
@ -6298,7 +6298,7 @@ os_file_trim(
fprintf(stderr,
" InnoDB: Warning: fallocate call failed with error code %d.\n"
" InnoDB: start: %lu len: %lu payload: %lu\n"
" InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len);
" InnoDB: Disabling fallocate for now.\n", errno, (ulong) off, (ulong) trim_len, (ulong) len);
os_file_handle_error_no_exit(slot->name,
" fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ",

View file

@ -109,9 +109,9 @@ row_merge_encrypt_buf(
if (! ((rc == MY_AES_OK) && ((ulint)dstlen == srv_sort_buf_size-ROW_MERGE_RESERVE_SIZE))) {
ib_logf(IB_LOG_LEVEL_FATAL,
"Unable to encrypt data-block "
" src: %p srclen: %lu buf: %p buflen: %d."
" src: %p srclen: %lu buf: %p buflen: %u."
" return-code: %d. Can't continue!\n",
input_buf, (size_t)srv_sort_buf_size,
input_buf, (ulong) srv_sort_buf_size,
crypted_buf, dstlen, rc);
ut_error;
}
@ -153,7 +153,7 @@ row_merge_decrypt_buf(
"Unable to encrypt data-block "
" src: %p srclen: %lu buf: %p buflen: %d."
" return-code: %d. Can't continue!\n",
input_buf, (size_t)srv_sort_buf_size,
input_buf, (ulong) srv_sort_buf_size,
crypted_buf, dstlen, rc);
ut_error;
}
@ -2067,7 +2067,7 @@ write_buffers:
pct_cost :
((pct_cost * read_rows) / table_total_rows);
/* presenting 10.12% as 1012 integer */
onlineddl_pct_progress = curr_progress * 100;
onlineddl_pct_progress = (ulint) (curr_progress * 100);
}
}
@ -2603,7 +2603,7 @@ row_merge_sort(
/* Find the number N which 2^N is greater or equal than num_runs */
/* N is merge sort running count */
total_merge_sort_count = ceil(my_log2f(num_runs));
total_merge_sort_count = (ulint) ceil(my_log2f(num_runs));
if(total_merge_sort_count <= 0) {
total_merge_sort_count=1;
}
@ -2650,7 +2650,7 @@ row_merge_sort(
pct_cost :
((pct_cost * merge_count) / total_merge_sort_count);
/* presenting 10.12% as 1012 integer */;
onlineddl_pct_progress = (pct_progress + curr_progress) * 100;
onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100);
}
if (error != DB_SUCCESS) {
@ -2933,7 +2933,7 @@ row_merge_insert_index_tuples(
((pct_cost * inserted_rows) / table_total_rows);
/* presenting 10.12% as 1012 integer */;
onlineddl_pct_progress = (pct_progress + curr_progress) * 100;
onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100);
}
}
}

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -738,7 +738,7 @@ grn_com_send(grn_ctx *ctx, grn_com *cs,
msg.msg_namelen = 0;
msg.msg_iov = msg_iov;
msg.msg_iovlen = 2;
msg_iov[0].iov_base = header;
msg_iov[0].iov_base = (char*) header;
msg_iov[0].iov_len = sizeof(grn_com_header);
msg_iov[1].iov_base = (char *)body;
msg_iov[1].iov_len = size;

View file

@ -51,7 +51,8 @@
#define GRN_CTX_INITIALIZER(enc) \
{ GRN_SUCCESS, 0, enc, 0, GRN_LOG_NOTICE,\
GRN_CTX_FIN, 0, 0, 0, 0, {0}, NULL, NULL, NULL, NULL, NULL }
GRN_CTX_FIN, 0, 0, 0, 0, {0}, NULL, NULL, NULL, NULL, NULL, \
{NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL}, ""}
#define GRN_CTX_CLOSED(ctx) ((ctx)->stat == GRN_CTX_FIN)

View file

@ -4137,7 +4137,7 @@ grn_column_create(grn_ctx *ctx, grn_obj *table,
{
grn_db *s;
uint32_t value_size;
grn_obj *db, *res = NULL;
grn_obj *db= NULL, *res = NULL;
grn_id id = GRN_ID_NIL;
grn_id range = GRN_ID_NIL;
grn_id domain = GRN_ID_NIL;

View file

@ -385,7 +385,7 @@ chunk_free(grn_ctx *ctx, grn_ii *ii, uint32_t offset, uint32_t dummy, uint32_t s
}
*/
grn_io_win iw, iw_;
grn_ii_ginfo *ginfo;
grn_ii_ginfo *ginfo= 0;
uint32_t seg, m, *gseg;
seg = offset >> GRN_II_N_CHUNK_VARIATION;
if (size > S_CHUNK) {

View file

@ -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;

View file

@ -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)

View file

@ -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);

View file

@ -4257,7 +4257,7 @@ btr_estimate_number_of_different_key_vals(
*/
if (index->stat_index_size > 1) {
n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ?
ut_min(index->stat_index_size,
(ulint) ut_min((double) index->stat_index_size,
log2(index->stat_index_size)*srv_stats_transient_sample_pages)
: index->stat_index_size;

View file

@ -151,7 +151,7 @@ void
btr_defragment_init()
{
srv_defragment_interval = ut_microseconds_to_timer(
1000000.0 / srv_defragment_frequency);
(ulonglong) (1000000.0 / srv_defragment_frequency));
mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex,
SYNC_ANY_LATCH);
os_thread_create(btr_defragment_thread, NULL, NULL);

View file

@ -2425,7 +2425,7 @@ ulint
af_get_pct_for_dirty()
/*==================*/
{
ulint dirty_pct = buf_get_modified_ratio_pct();
ulint dirty_pct = (ulint) buf_get_modified_ratio_pct();
if (dirty_pct > 0 && srv_max_buf_pool_modified_pct == 0) {
return(100);
@ -2445,7 +2445,7 @@ af_get_pct_for_dirty()
}
} else if (dirty_pct > srv_max_dirty_pages_pct_lwm) {
/* We should start flushing pages gradually. */
return((dirty_pct * 100)
return (ulint) ((dirty_pct * 100)
/ (srv_max_buf_pool_modified_pct + 1));
}
@ -2463,8 +2463,8 @@ af_get_pct_for_lsn(
{
lsn_t max_async_age;
lsn_t lsn_age_factor;
lsn_t af_lwm = (srv_adaptive_flushing_lwm
* log_get_capacity()) / 100;
lsn_t af_lwm = (lsn_t) ((srv_adaptive_flushing_lwm
* log_get_capacity()) / 100);
if (age < af_lwm) {
/* No adaptive flushing. */

View file

@ -18361,7 +18361,7 @@ innodb_defragment_frequency_update(
{
srv_defragment_frequency = (*static_cast<const uint*>(save));
srv_defragment_interval = ut_microseconds_to_timer(
1000000.0 / srv_defragment_frequency);
(ulonglong) (1000000.0 / srv_defragment_frequency));
}
/****************************************************************//**

View file

@ -2409,7 +2409,7 @@ lock_rec_add_to_queue(
if (wsrep_debug) {
fprintf(stderr,
"BF skipping wait: %lu\n",
trx->id);
(ulong) trx->id);
lock_rec_print(stderr, lock);
}
} else
@ -4998,7 +4998,7 @@ lock_table_other_has_incompatible(
#ifdef WITH_WSREP
if(wsrep_thd_is_wsrep(trx->mysql_thd)) {
if (wsrep_debug) {
fprintf(stderr, "WSREP: trx %ld table lock abort\n",
fprintf(stderr, "WSREP: trx " TRX_ID_FMT " table lock abort\n",
trx->id);
}
trx_mutex_enter(lock->trx);

View file

@ -144,11 +144,11 @@ log_crypt_print_checkpoint_keys(
ib_uint64_t checkpoint_no = log_block_get_checkpoint_no(log_block);
if (crypt_info.size()) {
fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", checkpoint_no);
fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", (ulong) checkpoint_no);
for (size_t i = 0; i < crypt_info.size(); i++) {
struct crypt_info_t* it = &crypt_info[i];
fprintf(stderr, "[ %lu %u ] ",
it->checkpoint_no,
(ulong) it->checkpoint_no,
it->key_version);
}
fprintf(stderr, "\n");

View file

@ -6364,7 +6364,7 @@ os_file_trim(
fprintf(stderr,
" InnoDB: Warning: fallocate call failed with error code %d.\n"
" InnoDB: start: %lu len: %lu payload: %lu\n"
" InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len);
" InnoDB: Disabling fallocate for now.\n", errno, (ulong) off, (ulong) trim_len, (ulong) len);
os_file_handle_error_no_exit(slot->name,
" fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ",

View file

@ -109,9 +109,9 @@ row_merge_encrypt_buf(
if (! ((rc == MY_AES_OK) && ((ulint)dstlen == srv_sort_buf_size-ROW_MERGE_RESERVE_SIZE))) {
ib_logf(IB_LOG_LEVEL_FATAL,
"Unable to encrypt data-block "
" src: %p srclen: %lu buf: %p buflen: %d."
" src: %p srclen: %lu buf: %p buflen: %u."
" return-code: %d. Can't continue!\n",
input_buf, (size_t)srv_sort_buf_size,
input_buf, (ulong) srv_sort_buf_size,
crypted_buf, dstlen, rc);
ut_error;
}
@ -153,7 +153,7 @@ row_merge_decrypt_buf(
"Unable to encrypt data-block "
" src: %p srclen: %lu buf: %p buflen: %d."
" return-code: %d. Can't continue!\n",
input_buf, (size_t)srv_sort_buf_size,
input_buf, (ulong) srv_sort_buf_size,
crypted_buf, dstlen, rc);
ut_error;
}
@ -2010,7 +2010,7 @@ write_buffers:
pct_cost :
((pct_cost * read_rows) / table_total_rows);
/* presenting 10.12% as 1012 integer */
onlineddl_pct_progress = curr_progress * 100;
onlineddl_pct_progress = (ulint) (curr_progress * 100);
}
}
@ -2545,7 +2545,7 @@ row_merge_sort(
/* Find the number N which 2^N is greater or equal than num_runs */
/* N is merge sort running count */
total_merge_sort_count = ceil(my_log2f(num_runs));
total_merge_sort_count = (ulint) ceil(my_log2f(num_runs));
if(total_merge_sort_count <= 0) {
total_merge_sort_count=1;
}
@ -2592,7 +2592,7 @@ row_merge_sort(
pct_cost :
((pct_cost * merge_count) / total_merge_sort_count);
/* presenting 10.12% as 1012 integer */;
onlineddl_pct_progress = (pct_progress + curr_progress) * 100;
onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100);
}
if (error != DB_SUCCESS) {
@ -2875,7 +2875,7 @@ row_merge_insert_index_tuples(
((pct_cost * inserted_rows) / table_total_rows);
/* presenting 10.12% as 1012 integer */;
onlineddl_pct_progress = (pct_progress + curr_progress) * 100;
onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100);
}
}
}

View file

@ -20448,7 +20448,7 @@ my_uca_scanner_contraction_find(my_uca_scanner *scanner, my_wc_t *wc)
size_t clen= 1;
int flag;
const uchar *s, *beg[MY_UCA_MAX_CONTRACTION];
memset(beg, 0, sizeof(beg));
memset((void*) beg, 0, sizeof(beg));
/* Scan all contraction candidates */
for (s= scanner->sbeg, flag= MY_UCA_CNT_MID1;

View file

@ -495,7 +495,7 @@ start:
char errmsg_buff[MYSYS_STRERROR_SIZE];
*to++= ' ';
*to++= '"';
my_strerror(errmsg_buff, sizeof(errmsg_buff), larg);
my_strerror(errmsg_buff, sizeof(errmsg_buff), (int) larg);
to= process_str_arg(cs, to, real_end, width, errmsg_buff,
print_arr[i].flags);
if (real_end > to) *to++= '"';
@ -675,7 +675,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
char errmsg_buff[MYSYS_STRERROR_SIZE];
*to++= ' ';
*to++= '"';
my_strerror(errmsg_buff, sizeof(errmsg_buff), larg);
my_strerror(errmsg_buff, sizeof(errmsg_buff), (int) larg);
to= process_str_arg(cs, to, real_end, width, errmsg_buff, print_type);
if (real_end > to) *to++= '"';
}

View file

@ -7,14 +7,20 @@
#
# Use by setting CC="ccfilter gcc" CXX="ccfilter gcc" before ./configure.
#
# When testing from command line, you can run it as
# perl ccfilter cat logfile > /dev/null
# to see the errors that are not filtered
#
# By default, just filters the output for suppressed warnings. If the
# FAILONWARNING environment variable is set, then instead will fail the
# compile on encountering a non-suppressed warnings.
use strict;
use warnings;
my $suppressions;
my $filter_stderr= $ARGV[0] ne "cat";
open STDOUT_COPY, ">&STDOUT"
or die "Failed to dup stdout: $!]n";
@ -27,11 +33,14 @@ if (!defined($pid)) {
# Child.
# actually want to send the STDERR to the parent, not the STDOUT.
# So shuffle things around a bit.
open STDERR, ">&STDOUT"
or die "Child: Failed to dup pipe to parent: $!\n";
open STDOUT, ">&STDOUT_COPY"
or die "Child: Failed to dup parent stdout: $!\n";
close STDOUT_COPY;
if ($filter_stderr)
{
open STDERR, ">&STDOUT"
or die "Child: Failed to dup pipe to parent: $!\n";
open STDOUT, ">&STDOUT_COPY"
or die "Child: Failed to dup parent stdout: $!\n";
close STDOUT_COPY;
}
exec { $ARGV[0] } @ARGV;
die "Child: exec() failed: $!\n";
} else {
@ -41,9 +50,9 @@ if (!defined($pid)) {
chomp($cwd);
while (<PIPE>) {
my $line= $_;
if (/^(.*?):([0-9]+): [Ww]arning: (.*)$/) {
if (/^(.*?):([0-9]+):(?:[0-9]+:)? [Ww]arning: (.*)$/) {
my ($file, $lineno, $msg)= ($1, $2, $3);
$file= "$cwd/$file";
$file= "$cwd/$file" if (length($file) > 0 && substr($file,0,1) ne "/");
next
if check_if_suppressed($file, $lineno, $msg);
@ -52,8 +61,14 @@ if (!defined($pid)) {
print STDERR $line;
next;
}
print STDERR $line;
if ($filter_stderr)
{
print STDERR $line;
}
else
{
print STDOUT $line;
}
}
close(PIPE);
}

View file

@ -3,61 +3,61 @@
# be ignored for various reasons.
#
integer.cpp: .*control reaches end of non-void function.*: 1288-1427
integer.cpp: .*no return statement in function returning non-void.*: 1288-1427
DictTabInfo.cpp : .*invalid access to non-static.*
DictTabInfo.cpp : .*macro was used incorrectly.*
DbdihMain.cpp : .*unused variable.* : 6666-7013
DbtupExecQuery.cpp : .*unused variable.* : 1823
kernel_types.h : .*only defines private constructors and has no friends.* : 51
Dbtup.hpp: .*only defines private constructors and has no friends.*
diskpage.hpp: .*only defines private constructors and has no friends.*
tuppage.hpp: .*only defines private constructors and has no friends.*
sql_yacc.cc : .*label 'yyerrlab1' defined but not used.*
kernel_types.h : .*'struct Local_key' only defines private constructors and has no friends.*
lgman.hpp : .*'struct Lgman::Buffer_idx' only defines private constructors and has no friends.*
SchemaFile.hpp : .*'struct SchemaFile::TableEntry' only defines private constructors and has no friends.*
sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.*
.*/integer.cpp: .*control reaches end of non-void function.*: 1288-1427
.*/integer.cpp: .*no return statement in function returning non-void.*: 1288-1427
.*/DictTabInfo.cpp : .*invalid access to non-static.*
.*/DictTabInfo.cpp : .*macro was used incorrectly.*
.*/DbdihMain.cpp : .*unused variable.* : 6666-7013
.*/DbtupExecQuery.cpp : .*unused variable.* : 1823
.*/kernel_types.h : .*only defines private constructors and has no friends.* : 51
.*/Dbtup.hpp: .*only defines private constructors and has no friends.*
.*/diskpage.hpp: .*only defines private constructors and has no friends.*
.*/tuppage.hpp: .*only defines private constructors and has no friends.*
.*/sql_yacc.cc : .*label 'yyerrlab1' defined but not used.*
.*/kernel_types.h : .*'struct Local_key' only defines private constructors and has no friends.*
.*/lgman.hpp : .*'struct Lgman::Buffer_idx' only defines private constructors and has no friends.*
.*/SchemaFile.hpp : .*'struct SchemaFile::TableEntry' only defines private constructors and has no friends.*
.*/sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.*
#
# Things that can be ignored in InnoDB
#
pars0grm.tab.c: .*'yyerrorlab' : unreferenced label.*
pars0grm.c: 'yyerrorlab' : unreferenced label
_flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.*
lexyy.c : not enough actual parameters for macro 'yywrap'
pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.*
include/buf0buf\.ic: unused parameter .*mtr.*
fil/fil0fil\.c: pointer targets in passing argument.*differ in signedness
fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199
fil/fil0fil\.c: unused parameter
log/log0recv\.c: unused variable
os/os0file\.c: unused parameter
os/os0file\.c: pointer targets in assignment differ in signedness
handler/i_s\.cc: unused variable
sync/sync0rw\.c: unused parameter
sync/sync0sync\.c: unused parameter
sync/sync0sync\.c: unused variable
ut/ut0ut\.c: ignoring return value of
srv/srv0srv\.c: value computed is not used
buf/buf0buf\.c: .*block_mutex.* might be used uninitialized
btr/btr0cur\.c: null argument where non-null required: 1800-3000
btr/btr0btr\.c: null argument where non-null required
btr/btr0cur\.c: .*value computed is not used.*: 3175-3375
btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target type
ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000
fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits
log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type
log/log0online\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type
buf/buf0buf\.c : label.*loop2.* defined but not used
.*/pars0grm.tab.c: .*'yyerrorlab' : unreferenced label.*
.*/pars0grm.c: 'yyerrorlab' : unreferenced label
.*/_flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.*
.*/lexyy.c : not enough actual parameters for macro 'yywrap'
.*/pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.*
.*/include/buf0buf\.ic: unused parameter .*mtr.*
.*/fil/fil0fil\.c: pointer targets in passing argument.*differ in signedness
.*/fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199
.*/fil/fil0fil\.c: unused parameter
.*/log/log0recv\.c: unused variable
.*/os/os0file\.c: unused parameter
.*/os/os0file\.c: pointer targets in assignment differ in signedness
.*/handler/i_s\.cc: unused variable
.*/sync/sync0rw\.c: unused parameter
.*/sync/sync0sync\.c: unused parameter
.*/sync/sync0sync\.c: unused variable
.*/ut/ut0ut\.c: ignoring return value of
.*/srv/srv0srv\.c: value computed is not used
.*/buf/buf0buf\.c: .*block_mutex.* might be used uninitialized
.*/btr/btr0cur\.c: null argument where non-null required: 1800-3000
.*/btr/btr0btr\.c: null argument where non-null required
.*/btr/btr0cur\.c: .*value computed is not used.*: 3175-3375
.*/btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target type
.*/ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000
.*/fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits
.*/log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type
.*/log/log0online\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type
.*/buf/buf0buf\.c : label.*loop2.* defined but not used
#
# Xtradb engine
#
storage/xtradb/handler/ha_innodb\.cc: ignoring return value of
storage/xtradb/row/row0log\.cc: ignoring return value of
storage/xtradb/btr/btr0cur\.cc : null argument where non-null required
storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required
.*/storage/xtradb/handler/ha_innodb\.cc: ignoring return value of
.*/storage/xtradb/row/row0log\.cc: ignoring return value of
.*/storage/xtradb/btr/btr0cur\.cc : null argument where non-null required
.*/storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required
#
# bdb is not critical to keep up to date
@ -66,29 +66,29 @@ storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required
.*/bdb/.* : .*unused parameter.*
.*/bdb/.* : .*may be used uninitialized.*
.*/bdb/.* : .*empty body in an if-statement.*
db_vrfy.c : .*comparison is always false due to limited range of data type.*
.*/db_vrfy.c : .*comparison is always false due to limited range of data type.*
#
# readline is not maintained by us
#
.*/cmd-line-utils/readline/.* : .*
readline\.c : unused parameter
term\.c : unused parameter
vi\.c : unused parameter
common\.c : unused parameter
term\.c : .*
.*/readline\.c : unused parameter
.*/term\.c : unused parameter
.*/vi\.c : unused parameter
.*/common\.c : unused parameter
.*/term\.c : .*
#
# Ignore some warnings in libevent, which is not maintained by us.
#
.*/extra/libevent/.* : .*unused parameter.*
.*/extra/libevent/select\.c : .*comparison between signed and unsigned.* : 270-280
signal\.c : .*unused parameter.*
.*/signal\.c : .*unused parameter.*
#
# Ignore warnings from system libraries
#
/usr/share/aclocal/audiofile.m4 : .*
.*/aclocal/audiofile.m4 : .*
#
# Ignore strict-aliasing warnings (for now)
@ -131,30 +131,30 @@ signal\.c : .*unused parameter.*
#
# Aria warning that is ok in debug builds
#
storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used
.*/storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used
#
# oqgraph errors that are hard to fix
#
oqgraph/graphcore\.cc : may be used uninitialized in this function
.*/oqgraph/graphcore\.cc : may be used uninitialized in this function
#
# Yassl
#
include/runtime.hpp: .*pure_error.*
.*/include/runtime.hpp: .*pure_error.*
.*/extra/yassl/.*taocrypt/.*: comparison with string literal
.*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds
.*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value
.*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function
mySTL/algorithm\.hpp: is used uninitialized in this function
include/pwdbased\.hpp: comparison of unsigned expression
.*/mySTL/algorithm\.hpp: is used uninitialized in this function
.*/include/pwdbased\.hpp: comparison of unsigned expression
#
# OpenSSL
#
# The following comes because of different prototype between yassl and openssl.
# Save as the argument is a function withing the library.
vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type
.*/vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type
#
# Groff warnings on OpenSUSE.
@ -166,88 +166,105 @@ vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type
# Warnings on OpenSolaris
#
.*/my_config\.h : _FILE_OFFSET_BITS
/usr/include/sys/feature_tests.h : this is the location of the previous definition
.*auth_pam\.c : initialization from incompatible pointer type : 100-200
.*/include/sys/feature_tests.h : this is the location of the previous definition
.*/auth_pam\.c : initialization from incompatible pointer type : 100-200
.*/mysys/my_lock\.c : incompatible pointer
#
# jemalloc
#
jemalloc/src/jemalloc\.c: always_inline function might not be inlinable
jemalloc/src/jemalloc\.c: set but not used
.*/jemalloc/src/jemalloc\.c: always_inline function might not be inlinable
.*/jemalloc/src/jemalloc\.c: set but not used
#
# Connect engine
#
storage/connect/ha_connect\.cc: might be clobbered by.*longjmp
storage/connect/connect\.cc: might be clobbered by.*longjmp
storage/connect/filamvct\.cpp: ignoring return value of
storage/connect/filamvct\.cpp: might be clobbered by
storage/connect/xindex\.cpp: ignoring return value of
storage/connect/value\.cpp: always false
storage/connect/json\.cpp: might be clobbered by
.*/storage/connect/ha_connect\.cc: might be clobbered by.*longjmp
.*/storage/connect/connect\.cc: might be clobbered by.*longjmp
.*/storage/connect/filamvct\.cpp: ignoring return value of
.*/storage/connect/filamvct\.cpp: might be clobbered by
.*/storage/connect/xindex\.cpp: ignoring return value of
.*/storage/connect/value\.cpp: always false : 1000-1020
.*/storage/connect/json\.cpp: might be clobbered by
#
# mroonga
#
groonga/lib/expr\.c: propagation disabled
groonga/lib/expr\.c: PRE disabled
groonga/lib/expr\.c: always false
.*/groonga/lib/expr\.c : GCSE disabled
.*/groonga/lib/expr\.c : NULL pointer checks disabled
.*/groonga/lib/expr\.c : PRE disabled
.*/groonga/lib/expr\.c : always false
.*/groonga/lib/expr\.c : jump bypassing disabled
.*/groonga/lib/expr\.c : propagation disabled
.*/groonga/lib/nfkc\.c : GCSE disabled
.*/groonga/lib/nfkc\.c : NULL pointer checks disabled
.*/groonga/lib/nfkc\.c : jump bypassing disabled
.*/groonga/lib/str\.c : comparing floating point
.*/groonga/lib/db\.c : missing initializer
.*/groonga/lib/ii\.c : missing initializer
.*/groonga/lib/normalizer\.c : missing initializer
.*/groonga/lib/proc\.c : missing initializer
.*/groonga/lib/tokenizer\.c : missing initializer
#
# Mroonga
# TokuDB
#
groonga/lib/expr\.c : const/copy propagation disabled
# This one is marked with __attribute__, but we still get a (wrong) warning
.*/liblzma/lz/lz_encoder\.c : variable.*in_used.*set but not used
#
# Unexplanable (?) stuff
#
listener\.cc : .*conversion from 'SOCKET' to 'int'.*
net_serv\.cc : .*conversion from 'SOCKET' to 'int'.*
.*/listener\.cc : .*conversion from 'SOCKET' to 'int'.*
.*/net_serv\.cc : .*conversion from 'SOCKET' to 'int'.*
#
# Ignorable warnings from header files
#
backward_warning\.h : This file includes at least one
.*/backward_warning\.h : This file includes at least one
/usr/include/i386-linux-gnu/bits/string3\.h: memset used with constant zero length parameter
bits/string3.h : might overflow destination buffer
.*/bits/string3.h : might overflow destination buffer
# allow a little moving space for the warning below
mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600
ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650
.*/mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600
.*/ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650
#
# Wrong compiler warnings
#
.* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.*
ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.*
sql/sys_vars\.cc : invalid access to non-static data member
string3\.h : memset used with constant zero length parameter
.*/ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.*
.*/sql/sys_vars\.cc : invalid access to non-static data member
.*/string3\.h : memset used with constant zero length parameter
.*/sql/wsrep_hton\.cc : NULL used in arithmetic : 500-600
.* : missing-declarations.*is valid
#
# Ignorable errors on mac
#
my_aes\.c: deprecated
my_sha1\.cc: deprecated
my_md5\.cc: deprecated
my_rnd\.cc: deprecated
mdl\.cc: invalid access
mdl\.cc: offsetoff
.*/my_aes\.c: deprecated
.*/my_sha1\.cc: deprecated
.*/my_md5\.cc: deprecated
.*/my_rnd\.cc: deprecated
.*/mdl\.cc: invalid access
.*/mdl\.cc: offsetoff
# Wrong warning due to GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478
regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type
libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000
storage/.*/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500
storage/.*/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300
storage/.*/btr/btr0sea\.c : passing argument 2 of .*btr_cur_position.* discards qualifiers from pointer
.*/regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type
.*/libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000
.*/storage/.*/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500
.*/storage/.*/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300
.*/storage/.*/btr/btr0sea\.c : passing argument 2 of .*btr_cur_position.* discards qualifiers from pointer
# Fixed wrong warning in GCC due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61520
strings/decimal.c: array subscript is below array bounds
.*/strings/decimal\.c : array subscript is .* array bounds
#
# Strange things from autoconf that is probably safe to ignore
#
configure.in : warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
configure.in : config/ac-macros/character_sets.m4.*prefer named diversions
warning: File listed twice
.*configure.in : warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
.*configure.in : config/ac-macros/character_sets.m4.*prefer named diversions warning: File listed twice
.*/include/mysql/client_plugin\.h : _mysql_client_plugin_declaration_
.*/plugin/auth_gssapi/client_plugin\.cc: _mysql_client_plugin_declaration_

View file

@ -93,7 +93,7 @@ IO_CACHE info;
#define CACHE_SIZE 16384
#define INFO_TAIL ", pos_in_file = %llu, pos_in_mem = %lu", \
info.pos_in_file, (*info.current_pos - info.request_pos)
info.pos_in_file, (ulong) (*info.current_pos - info.request_pos)
#define FILL 0x5A