Commit 691b295a authored by Michael Widenius's avatar Michael Widenius

Fixed compiler warnings and sporadic failures in test cases


mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test:
  Added missing sync_slave_with_master; Fixes random failures
mysql-test/include/default_mysqld.cnf:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/lib/My/SafeProcess/safe_process.cc:
  Fixed compiler warning
mysql-test/lib/v1/mysql-test-run.pl:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/suite/rpl/r/rpl_do_grant.result:
  Updated test results
mysql-test/suite/rpl/t/rpl_do_grant.test:
  Added missing sync_slave_with_master; Fixes random failures
  Had to explictely do stop slave before DROP USER to avoid failure on slave as the user is already dropped on slave.
mysql-test/suite/rpl/t/rpl_name_const.test:
  Added missing sync_slave_with_master; Fixes random failures
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
  Added missing sync_slave_with_master; Fixes random failures
mysql-test/t/bug47671-master.opt:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/t/ctype_latin1_de-master.opt:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/t/ctype_ucs2_def-master.opt:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
sql-common/client.c:
  Fixed compiler warning
sql/item.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item.h:
  Renamed function to remove compiler warnings (with gcc)
sql/item_cmpfunc.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item_create.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item_create.h:
  Renamed function to remove compiler warnings (with gcc)
sql/item_sum.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item_sum.h:
  Renamed function to remove compiler warnings (with gcc)
sql/set_var.cc:
  Don't use bit_do_set() / bot_is_set() / bit_do_clear() as this generates compiler warnings
  (They are also of no use as we know the value can hold the bits)
sql/sql_yacc.yy:
  Renamed function to remove compiler warnings (with gcc)
storage/example/ha_example.h:
  Fixed old read_time() prototype
storage/maria/ma_search.c:
  Added extra variables to remove compiler warnings
storage/maria/maria_def.h:
  Added extra variables to remove compiler warnings
storage/myisam/ft_stopwords.c:
  Added cast to get rid of compiler warning
storage/xtradb/fil/fil0fil.c:
  Added cast to get rid of compiler warning
storage/xtradb/include/page0page.h:
  Added const to get rid of compiler warning
storage/xtradb/include/page0page.ic:
  Added const to get rid of compiler warning
support-files/compiler_warnings.supp:
  Added suppression of strict-aliasing
parent cbb1e6f1
......@@ -157,3 +157,4 @@ INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE t1;
--sync_slave_with_master
......@@ -2,7 +2,7 @@
[mysqld]
open-files-limit= 1024
local-infile
default-character-set= latin1
character-set-server= latin1
# Increase default connect_timeout to avoid intermittent
# disconnects when test servers are put under load see BUG#28359
......
......@@ -159,7 +159,7 @@ int main(int argc, char* const argv[] )
signal(SIGCHLD, handle_signal);
signal(SIGABRT, handle_abort);
sprintf(safe_process_name, "safe_process[%d]", own_pid);
sprintf(safe_process_name, "safe_process[%d]", (int) own_pid);
message("Started");
......
......@@ -3965,7 +3965,7 @@ sub mysqld_arguments ($$$$) {
}
}
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
mtr_add_arg($args, "%s--character-set-server-set=latin1", $prefix);
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
......
......@@ -165,10 +165,9 @@ USE bug42217_db;
DROP FUNCTION upgrade_del_func;
DROP FUNCTION upgrade_alter_func;
DROP DATABASE bug42217_db;
DROP USER 'create_rout_db'@'localhost';
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
USE mtr;
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
stop slave;
DROP USER 'create_rout_db'@'localhost';
######## BUG#49119 #######
### i) test case from the 'how to repeat section'
stop slave;
......
......@@ -209,12 +209,18 @@ USE bug42217_db;
DROP FUNCTION upgrade_del_func;
DROP FUNCTION upgrade_alter_func;
DROP DATABASE bug42217_db;
DROP USER 'create_rout_db'@'localhost';
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
sync_slave_with_master;
# Drop the user that was already dropped on the slave
connection slave;
USE mtr;
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
--disable_warnings
stop slave;
connection master;
DROP USER 'create_rout_db'@'localhost';
--enable_warnings
# BUG#49119: Master crashes when executing 'REVOKE ... ON
# {PROCEDURE|FUNCTION} FROM ...'
......
......@@ -45,3 +45,4 @@ select * from t1 order by id;
connection master;
drop table t1;
drop procedure test_procedure;
--sync_slave_with_master
......@@ -53,6 +53,7 @@ UPDATE t1 SET a=99 WHERE a = 0;
SHOW BINLOG EVENTS;
DROP TABLE t1;
--sync_slave_with_master
# BUG#17620: Replicate (Row Based) Fails when Query Cache enabled on
# slave
......
--default-character-set=utf8 --skip-character-set-client-handshake
--character-set-server=utf8 --skip-character-set-client-handshake
--default-character-set=latin1 --default-collation=latin1_german2_ci
--character-set-server=latin1 --default-collation=latin1_german2_ci
--default-collation=ucs2_unicode_ci --default-character-set=ucs2,latin1
--default-collation=ucs2_unicode_ci --character-set-server=ucs2,latin1
......@@ -1863,7 +1863,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
uint port, const char *unix_socket,ulong client_flag)
{
char buff[NAME_LEN+USERNAME_LENGTH+100];
char error_string[1024];
char *end,*host_info= NULL;
my_socket sock;
in_addr_t ip_addr;
......@@ -2304,6 +2303,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/* Do the SSL layering. */
struct st_mysql_options *options= &mysql->options;
struct st_VioSSLFd *ssl_fd;
char error_string[1024];
/*
Send client_flag, max_packet_size - unencrypted otherwise
......
......@@ -7010,7 +7010,7 @@ bool Item_cache_int::cache_value()
}
void Item_cache_int::store(Item *item, longlong val_arg)
void Item_cache_int::store_longlong(Item *item, longlong val_arg)
{
/* An explicit values is given, save it. */
value_cached= TRUE;
......
......@@ -3045,7 +3045,7 @@ class Item_cache_int: public Item_cache
Item_cache_int(enum_field_types field_type_arg):
Item_cache(field_type_arg), value(0) {}
void store(Item *item, longlong val_arg);
void store_longlong(Item *item, longlong val_arg);
double val_real();
longlong val_int();
String* val_str(String *str);
......
......@@ -879,7 +879,7 @@ get_time_value(THD *thd, Item ***item_arg, Item **cache_arg,
Item_cache_int *cache= new Item_cache_int();
/* Mark the cache as non-const to prevent re-caching. */
cache->set_used_tables(1);
cache->store(item, value);
cache->store_longlong(item, value);
*cache_arg= cache;
*item_arg= cache_arg;
}
......@@ -917,13 +917,13 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg,
cache->set_used_tables(1);
if (!(*a)->is_datetime())
{
cache->store((*a), const_value);
cache->store_longlong((*a), const_value);
a_cache= cache;
a= (Item **)&a_cache;
}
else
{
cache->store((*b), const_value);
cache->store_longlong((*b), const_value);
b_cache= cache;
b= (Item **)&b_cache;
}
......@@ -1145,7 +1145,7 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
Item_cache_int *cache= new Item_cache_int(MYSQL_TYPE_DATETIME);
/* Mark the cache as non-const to prevent re-caching. */
cache->set_used_tables(1);
cache->store(item, value);
cache->store_longlong(item, value);
*cache_arg= cache;
*item_arg= cache_arg;
}
......
This diff is collapsed.
......@@ -91,8 +91,9 @@ class Create_qfunc : public Create_func
@param item_list The list of arguments to the function, can be NULL
@return An item representing the parsed function call
*/
virtual Item* create(THD *thd, LEX_STRING db, LEX_STRING name,
bool use_explicit_name, List<Item> *item_list) = 0;
virtual Item *create_with_db(THD *thd, LEX_STRING db, LEX_STRING name,
bool use_explicit_name,
List<Item> *item_list) = 0;
protected:
/** Constructor. */
......
......@@ -642,7 +642,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
default:
DBUG_ASSERT(0);
};
setup(args[0], NULL);
setup_item(args[0], NULL);
/* MIN/MAX can return NULL for empty set indepedent of the used column */
maybe_null= 1;
unsigned_flag=item->unsigned_flag;
......@@ -676,7 +676,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
of the original MIN/MAX object and it is saved in this object's cache.
*/
void Item_sum_hybrid::setup(Item *item, Item *value_arg)
void Item_sum_hybrid::setup_item(Item *item, Item *value_arg)
{
value= Item_cache::get_cache(item);
value->setup(item);
......@@ -1646,7 +1646,7 @@ void Item_sum_hybrid::no_rows_in_result()
Item *Item_sum_min::copy_or_same(THD* thd)
{
Item_sum_min *item= new (thd->mem_root) Item_sum_min(thd, this);
item->setup(args[0], value);
item->setup_item(args[0], value);
return item;
}
......@@ -1669,7 +1669,7 @@ bool Item_sum_min::add()
Item *Item_sum_max::copy_or_same(THD* thd)
{
Item_sum_max *item= new (thd->mem_root) Item_sum_max(thd, this);
item->setup(args[0], value);
item->setup_item(args[0], value);
return item;
}
......
......@@ -858,7 +858,7 @@ class Item_sum_hybrid :public Item_sum
was_values(item->was_values)
{ }
bool fix_fields(THD *, Item **);
void setup(Item *item, Item *value_arg);
void setup_item(Item *item, Item *value_arg);
void clear();
double val_real();
longlong val_int();
......
......@@ -1263,16 +1263,16 @@ uchar *sys_var_set::value_ptr(THD *thd, enum_var_type type,
void sys_var_set_slave_mode::set_default(THD *thd, enum_var_type type)
{
slave_exec_mode_options= 0;
bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
slave_exec_mode_options= (ULL(1) << SLAVE_EXEC_MODE_STRICT);
}
bool sys_var_set_slave_mode::check(THD *thd, set_var *var)
{
bool rc= sys_var_set::check(thd, var);
if (!rc &&
bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_STRICT) == 1 &&
bit_is_set(var->save_result.ulong_value, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
test_all_bits(var->save_result.ulong_value,
((ULL(1) << SLAVE_EXEC_MODE_STRICT) |
(ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT))))
{
rc= true;
my_error(ER_SLAVE_AMBIGOUS_EXEC_MODE, MYF(0), "");
......@@ -1294,15 +1294,16 @@ void fix_slave_exec_mode(enum_var_type type)
DBUG_ENTER("fix_slave_exec_mode");
compile_time_assert(sizeof(slave_exec_mode_options) * CHAR_BIT
> SLAVE_EXEC_MODE_LAST_BIT - 1);
if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
if (test_all_bits(slave_exec_mode_options,
((ULL(1) << SLAVE_EXEC_MODE_STRICT) |
(ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT))))
{
sql_print_error("Ambiguous slave modes combination."
" STRICT will be used");
bit_do_clear(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT);
slave_exec_mode_options&= ~(ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT);
}
if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 0)
bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
if (!(slave_exec_mode_options & (ULL(1) << SLAVE_EXEC_MODE_IDEMPOTENT)))
slave_exec_mode_options|= (ULL(1)<< SLAVE_EXEC_MODE_STRICT);
DBUG_VOID_RETURN;
}
......
......@@ -8082,7 +8082,7 @@ function_call_generic:
builder= find_qualified_function_builder(thd);
DBUG_ASSERT(builder);
item= builder->create(thd, $1, $3, true, $5);
item= builder->create_with_db(thd, $1, $3, true, $5);
if (! ($$= item))
{
......
......@@ -155,7 +155,8 @@ class ha_example: public handler
/** @brief
This method will never be called if you do not implement indexes.
*/
virtual double read_time(ha_rows rows) { return (double) rows / 20.0+1; }
virtual double read_time(uint index, uint ranges, ha_rows rows)
{ return (double) rows / 20.0+1; }
/*
Everything below are methods that we implement in ha_example.cc.
......
......@@ -76,8 +76,8 @@ int _ma_search(register MARIA_HA *info, MARIA_KEY *key, uint32 nextflag,
bmove512(info->keyread_buff, page_buff, info->s->block_size);
/* Save position for a possible read next / previous */
info->int_keypos= info->keyread_buff + (ulonglong) info->int_keypos;
info->int_maxpos= info->keyread_buff + (ulonglong) info->int_maxpos;
info->int_keypos= info->keyread_buff + info->keypos_offset;
info->int_maxpos= info->keyread_buff + info->maxpos_offset;
info->int_keytree_version= key->keyinfo->version;
info->last_search_keypage= info->last_keypage;
info->page_changed= 0;
......@@ -214,8 +214,8 @@ static int _ma_search_no_save(register MARIA_HA *info, MARIA_KEY *key,
info->cur_row.trid= _ma_trid_from_key(&info->last_key);
/* Store offset to key */
info->int_keypos= (uchar*) (keypos - page.buff);
info->int_maxpos= (uchar*) (maxpos - page.buff);
info->keypos_offset= (uint) (keypos - page.buff);
info->maxpos_offset= (uint) (maxpos - page.buff);
info->int_nod_flag= nod_flag;
info->last_keypage= pos;
*res_page_link= page_link;
......
......@@ -506,8 +506,10 @@ struct st_maria_handler
uchar *first_mbr_key; /* Searhed spatial key */
uchar *rec_buff; /* Temp buffer for recordpack */
uchar *blob_buff; /* Temp buffer for blobs */
uchar *int_keypos, /* Save position for next/previous */
*int_maxpos; /* -""- */
uchar *int_keypos; /* Save position for next/previous */
uchar *int_maxpos; /* -""- */
uint keypos_offset; /* Tmp storage for offset int_keypos */
uint maxpos_offset; /* Tmp storage for offset int_maxpos */
uchar *update_field_data; /* Used by update in rows-in-block */
uint int_nod_flag; /* -""- */
uint32 int_keytree_version; /* -""- */
......
......@@ -44,9 +44,10 @@ static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
static int ft_add_stopword(const char *w)
{
FT_STOPWORD sw;
return !w ||
(((sw.len= (uint) strlen(sw.pos=(const uchar *)w)) >= ft_min_word_len) &&
(tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL));
return (!w ||
(((sw.len= (uint) strlen((char*) (sw.pos=(const uchar *)w))) >=
ft_min_word_len) &&
(tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL)));
}
int ft_init_stopwords()
......
......@@ -3168,7 +3168,7 @@ fil_open_single_table_tablespace(
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, id);
for (i = 0; (ulint) i < n_index; i++) {
if (offset / UNIV_PAGE_SIZE == root_page[i]) {
if ((ulint) (offset / UNIV_PAGE_SIZE) == root_page[i]) {
/* this is index root page */
mach_write_to_4(page + FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
+ FSEG_HDR_SPACE, id);
......
......@@ -517,7 +517,7 @@ UNIV_INLINE
rec_t*
page_rec_get_next(
/*==============*/
rec_t* rec); /*!< in: pointer to record */
const rec_t* rec); /*!< in: pointer to record */
/************************************************************//**
Gets the pointer to the next record on the page.
@return pointer to next record */
......
......@@ -731,7 +731,7 @@ UNIV_INLINE
rec_t*
page_rec_get_next(
/*==============*/
rec_t* rec) /*!< in: pointer to record */
const rec_t* rec) /*!< in: pointer to record */
{
return((rec_t*) page_rec_get_next_low(rec, page_rec_is_comp(rec)));
}
......
......@@ -65,6 +65,11 @@ db_vrfy.c : .*comparison is always false due to limited range of data type.*
#
/usr/share/aclocal/audiofile.m4 : .*
#
# Ignore strict-aliasing warnings (for now)
#
.*: break strict-aliasing rules
#
# Ignore all conversion warnings on windows 64
# (Is safe as we are not yet supporting strings >= 2G)
......
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