Commit 2901497b authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-4243 Warnings/errors while compiling with clang

parent 78683672
......@@ -440,7 +440,7 @@ static MYSQL_RES * emb_store_result(MYSQL *mysql)
int emb_read_change_user_result(MYSQL *mysql)
{
mysql->net.read_pos= (uchar*)""; // fake an OK packet
return mysql_errno(mysql) ? packet_error : 1 /* length of the OK packet */;
return mysql_errno(mysql) ? (int)packet_error : 1 /* length of the OK packet */;
}
MYSQL_METHODS embedded_methods=
......
......@@ -814,7 +814,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
continue;
/* Configuration File Directives */
if ((*ptr == '!'))
if (*ptr == '!')
{
if (recursion_level >= max_recursion_level)
{
......
......@@ -2253,7 +2253,7 @@ static int find_uniq_filename(char *name)
my_dirend(dir_info);
/* check if reached the maximum possible extension number */
if ((max_found == MAX_LOG_UNIQUE_FN_EXT))
if (max_found == MAX_LOG_UNIQUE_FN_EXT)
{
sql_print_error("Log filename extension number exhausted: %06lu. \
Please fix this by archiving old logs and \
......
......@@ -1369,7 +1369,7 @@ failed my_b_read"));
Log_event *res= 0;
#ifndef max_allowed_packet
THD *thd=current_thd;
uint max_allowed_packet= thd ? slave_max_allowed_packet:~(ulong)0;
uint max_allowed_packet= thd ? slave_max_allowed_packet:~(uint)0;
#endif
if (data_len > max_allowed_packet)
......
......@@ -84,7 +84,7 @@ static ulonglong get_exact_record_count(List<TABLE_LIST> &tables)
while ((tl= ti++))
{
ha_rows tmp= tl->table->file->records();
if ((tmp == HA_POS_ERROR))
if (tmp == HA_POS_ERROR)
return ULONGLONG_MAX;
count*= tmp;
}
......
......@@ -1436,9 +1436,9 @@ int ha_tina::rnd_end()
DBUG_RETURN(-1);
/* Open the file again */
if (((data_file= mysql_file_open(csv_key_file_data,
share->data_file_name,
O_RDONLY, MYF(MY_WME))) == -1))
if ((data_file= mysql_file_open(csv_key_file_data,
share->data_file_name,
O_RDONLY, MYF(MY_WME))) == -1)
DBUG_RETURN(my_errno ? my_errno : -1);
/*
As we reopened the data file, increase share->data_file_version
......
......@@ -764,7 +764,7 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share, TABLE *table,
user:@hostname:port/db/table
Then password is a null string, so set to NULL
*/
if ((share->password[0] == '\0'))
if (share->password[0] == '\0')
share->password= NULL;
}
......
......@@ -316,9 +316,9 @@ mutex_create_func(
/* NOTE! The very first mutexes are not put to the mutex list */
if ((mutex == &mutex_list_mutex)
if (mutex == &mutex_list_mutex
#ifdef UNIV_SYNC_DEBUG
|| (mutex == &sync_thread_mutex)
|| mutex == &sync_thread_mutex
#endif /* UNIV_SYNC_DEBUG */
) {
......
......@@ -135,8 +135,7 @@ const char *bits_to_txt[]=
"tail 00-40 % full", "tail 40-80 % full", "tail/blob full"
};
/*#define WRONG_BITMAP_FLUSH 1*/ /*define only for provoking bugs*/
#undef WRONG_BITMAP_FLUSH
#define WRONG_BITMAP_FLUSH 0 /*define to 1 only for provoking bugs*/
static my_bool _ma_read_bitmap_page(MARIA_HA *info,
MARIA_FILE_BITMAP *bitmap,
......@@ -164,11 +163,7 @@ static inline my_bool write_changed_bitmap(MARIA_SHARE *share,
*/
bitmap->changed_not_flushed= 1;
if ((bitmap->non_flushable == 0)
#ifdef WRONG_BITMAP_FLUSH
|| 1
#endif
)
if ((bitmap->non_flushable == 0) || WRONG_BITMAP_FLUSH)
{
res= pagecache_write(share->pagecache,
&bitmap->file, bitmap->page, 0,
......@@ -495,7 +490,7 @@ my_bool _ma_bitmap_flush_all(MARIA_SHARE *share)
{
bitmap->flush_all_requested++;
bitmap->waiting_for_non_flushable++;
#ifndef WRONG_BITMAP_FLUSH
#if !WRONG_BITMAP_FLUSH
while (bitmap->non_flushable > 0)
{
DBUG_PRINT("info", ("waiting for bitmap to be flushable"));
......
......@@ -7123,7 +7123,7 @@ my_bool _ma_apply_undo_row_delete(MARIA_HA *info, LSN undo_lsn,
memcpy(field_pos, field_length_data, size_length);
field_length_data+= size_length;
memcpy(field_pos + size_length, &header, sizeof(&header));
memcpy(field_pos + size_length, &header, sizeof(header));
header+= blob_length;
*blob_lengths++= blob_length;
break;
......
......@@ -114,7 +114,7 @@ int main(int argc,char **argv)
sleep(1);
return 0;
}
rnd(1);
(void)rnd(1);
}
for (i=0 ; i < forks ; i++)
......
......@@ -315,9 +315,9 @@ mutex_create_func(
/* NOTE! The very first mutexes are not put to the mutex list */
if ((mutex == &mutex_list_mutex)
if (mutex == &mutex_list_mutex
#ifdef UNIV_SYNC_DEBUG
|| (mutex == &sync_thread_mutex)
|| mutex == &sync_thread_mutex
#endif /* UNIV_SYNC_DEBUG */
) {
......
......@@ -669,7 +669,7 @@ int decimal_shift(decimal_t *dec, int shift)
if (do_left)
{
do_mini_left_shift(dec, l_mini_shift, beg, end);
mini_shift=- l_mini_shift;
mini_shift= -l_mini_shift;
}
else
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment