summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-02-06 17:14:05 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2018-02-07 20:12:12 +0000
commitd995dd2865b4dd5d01175594ed667cfe8ce41712 (patch)
treec5072261dd3a00d47d72e4f085822a68d7ec3ee5
parent7bcf5e2907db6a8f1178aca967c8d326be3e5e22 (diff)
downloadmariadb-git-d995dd2865b4dd5d01175594ed667cfe8ce41712.tar.gz
Windows : reenable warning C4805 (unsafe mix of types in bool operations)
-rw-r--r--cmake/os/Windows.cmake4
-rw-r--r--plugin/feedback/sender_thread.cc4
-rw-r--r--sql/log_event.cc2
-rw-r--r--sql/partition_element.h6
-rw-r--r--sql/sql_acl.cc4
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_db.cc2
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_select.cc2
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_time.cc2
-rw-r--r--sql/sql_type.cc2
-rw-r--r--sql/sql_union.cc2
-rw-r--r--sql/table.cc2
-rw-r--r--storage/innobase/dict/dict0dict.cc6
-rw-r--r--storage/innobase/handler/handler0alter.cc4
-rw-r--r--storage/innobase/include/btr0sea.h2
-rw-r--r--storage/innobase/include/dict0dict.h4
-rw-r--r--storage/innobase/include/dict0dict.ic4
-rw-r--r--storage/innobase/include/rem0rec.h2
-rw-r--r--storage/innobase/include/rem0rec.ic2
-rw-r--r--storage/innobase/include/sync0rw.h2
-rw-r--r--storage/innobase/lock/lock0lock.cc4
-rw-r--r--storage/innobase/srv/srv0start.cc2
-rw-r--r--storage/innobase/sync/sync0rw.cc6
-rw-r--r--storage/myisam/ha_myisam.cc2
-rw-r--r--storage/rocksdb/ha_rocksdb.cc8
27 files changed, 43 insertions, 43 deletions
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake
index afd56cd903a..fef4bbe201e 100644
--- a/cmake/os/Windows.cmake
+++ b/cmake/os/Windows.cmake
@@ -146,8 +146,8 @@ IF(MSVC)
ENDIF()
#TODO: update the code and remove the disabled warnings
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4805 /wd4291 /wd4996 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4291 /wd4996 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090")
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
diff --git a/plugin/feedback/sender_thread.cc b/plugin/feedback/sender_thread.cc
index 0463a70a383..92f186a1e2a 100644
--- a/plugin/feedback/sender_thread.cc
+++ b/plugin/feedback/sender_thread.cc
@@ -40,7 +40,7 @@ ulong interval= 60*60*24*7; ///< in seconds (one week)
*/
static int table_to_string(TABLE *table, String *result)
{
- bool res;
+ int res;
char buff1[MAX_FIELD_WIDTH], buff2[MAX_FIELD_WIDTH];
String str1(buff1, sizeof(buff1), system_charset_info);
String str2(buff2, sizeof(buff2), system_charset_info);
@@ -64,7 +64,7 @@ static int table_to_string(TABLE *table, String *result)
}
}
- res = res || result->append('\n');
+ res = res || (int)result->append('\n');
/*
Note, "|=" and not "||" - because we want to call ha_rnd_end()
diff --git a/sql/log_event.cc b/sql/log_event.cc
index cb4336afd77..7f85e953765 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -11577,7 +11577,7 @@ static int rows_event_stmt_cleanup(rpl_group_info *rgi, THD * thd)
already. So there should be no need to rollback the transaction.
*/
DBUG_ASSERT(! thd->transaction_rollback_request);
- error|= (error ? trans_rollback_stmt(thd) : trans_commit_stmt(thd));
+ error|= (int)(error ? trans_rollback_stmt(thd) : trans_commit_stmt(thd));
/*
Now what if this is not a transactional engine? we still need to
diff --git a/sql/partition_element.h b/sql/partition_element.h
index fdf2cb3900d..162c446a3c2 100644
--- a/sql/partition_element.h
+++ b/sql/partition_element.h
@@ -185,13 +185,13 @@ public:
// mixup
elem_type type()
{
- return (elem_type)(signed_flag << 1 | max_value);
+ return (elem_type)(int(signed_flag) << 1 | int(max_value));
}
void type(elem_type val)
{
- max_value= val & 1;
- signed_flag= val & 2;
+ max_value= (bool)(val & 1);
+ signed_flag= (bool)(val & 2);
}
partition_element()
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index b47dbef0dc5..cc4393008e6 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -7602,8 +7602,8 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
we need to modify the requested access rights depending on how the
sequence is used.
*/
- if (t_ref->sequence &
- (orig_want_access &
+ if (t_ref->sequence &&
+ (bool)(orig_want_access &
(SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL)))
{
/*
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 0d76e469a82..9c13629f27a 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -8303,7 +8303,7 @@ fill_record_n_invoke_before_triggers(THD *thd, TABLE *table,
List<Item> &values, bool ignore_errors,
enum trg_event_type event)
{
- bool result;
+ int result;
Table_triggers_list *triggers= table->triggers;
result= fill_record(thd, table, fields, values, ignore_errors,
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 114c06fdf2e..67910a3b618 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1653,7 +1653,7 @@ bool mysql_opt_change_db(THD *thd,
bool mysql_upgrade_db(THD *thd, const LEX_CSTRING *old_db)
{
- int error= 0, change_to_newdb= 0;
+ bool error= 0, change_to_newdb= 0;
char path[FN_REFLEN+16];
uint length;
Schema_specification_st create_info;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0eb1fed9eff..4c87dd27321 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -4964,7 +4964,7 @@ end_with_restore_list:
SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK |
OPTION_SETUP_TABLES_DONE) & ~OPTION_BUFFER_RESULT,
result, unit, select_lex);
- res|= thd->is_error();
+ res|= (int)(thd->is_error());
MYSQL_MULTI_DELETE_DONE(res, result->num_deleted());
if (res)
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 9cef3027e78..68f1f6068e6 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -4269,7 +4269,7 @@ err:
if (free_join)
{
THD_STAGE_INFO(thd, stage_end);
- err|= select_lex->cleanup();
+ err|= (int)(select_lex->cleanup());
DBUG_RETURN(err || thd->is_error());
}
DBUG_RETURN(join->error ? join->error: err);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index fb1f3cfb792..71c3b511b9c 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2803,7 +2803,7 @@ bool quick_rm_table(THD *thd, handlerton *base, const LEX_CSTRING *db,
const LEX_CSTRING *table_name, uint flags, const char *table_path)
{
char path[FN_REFLEN + 1];
- bool error= 0;
+ int error= 0;
DBUG_ENTER("quick_rm_table");
size_t path_length= table_path ?
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index 751a8926f33..95435c698f8 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -906,7 +906,7 @@ bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type,
{
long period, sign;
- sign= (interval.neg == ltime->neg ? 1 : -1);
+ sign= (interval.neg == (bool)ltime->neg ? 1 : -1);
switch (int_type) {
case INTERVAL_SECOND:
diff --git a/sql/sql_type.cc b/sql/sql_type.cc
index 57aecbd1e4c..d402db8d4e7 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -2746,7 +2746,7 @@ bool Type_handler_int_result::
Type_all_attributes *func,
Item **items, uint nitems) const
{
- uint unsigned_flag= items[0]->unsigned_flag;
+ bool unsigned_flag= items[0]->unsigned_flag;
for (uint i= 1; i < nitems; i++)
{
if (unsigned_flag != items[i]->unsigned_flag)
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 3be9dc4feb9..c9b011130a1 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1725,7 +1725,7 @@ err:
bool st_select_lex_unit::cleanup()
{
- int error= 0;
+ bool error= 0;
DBUG_ENTER("st_select_lex_unit::cleanup");
if (cleaned)
diff --git a/sql/table.cc b/sql/table.cc
index 5546c5b497f..1e3e5189739 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -6493,7 +6493,7 @@ void TABLE::mark_columns_needed_for_update()
for (KEY *k= key_info; k < end; k++)
{
KEY_PART_INFO *kpend= k->key_part + k->ext_key_parts;
- bool any_written= false, all_read= true;
+ int any_written= 0, all_read= 1;
for (KEY_PART_INFO *kp= k->key_part; kp < kpend; kp++)
{
int idx= kp->fieldnr - 1;
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 86a50e70eb3..4309ead2feb 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -895,7 +895,7 @@ dict_index_get_nth_col_or_prefix_pos(
@param[in] n column number
@param[in] is_virtual whether it is a virtual col
@return TRUE if contains the column or its prefix */
-ibool
+bool
dict_index_contains_col_or_prefix(
const dict_index_t* index,
ulint n,
@@ -926,11 +926,11 @@ dict_index_contains_col_or_prefix(
if (col == field->col) {
- return(TRUE);
+ return(true);
}
}
- return(FALSE);
+ return(false);
}
/********************************************************************//**
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 35623197106..6b947a3259f 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -4742,7 +4742,7 @@ prepare_inplace_alter_table_dict(
index_def_t* index_defs; /* index definitions */
dict_table_t* user_table;
dict_index_t* fts_index = NULL;
- ulint new_clustered = 0;
+ bool new_clustered = false;
dberr_t error;
ulint num_fts_index;
dict_add_v_col_t* add_v = NULL;
@@ -4819,7 +4819,7 @@ prepare_inplace_alter_table_dict(
fts_doc_id_col, add_fts_doc_id, add_fts_doc_id_idx,
old_table);
- new_clustered = DICT_CLUSTERED & index_defs[0].ind_type;
+ new_clustered = (DICT_CLUSTERED & index_defs[0].ind_type) != 0;
/* The primary index would be rebuilt if a FTS Doc ID
column is to be added, and the primary index definition
diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h
index cddf846438d..f32429800f8 100644
--- a/storage/innobase/include/btr0sea.h
+++ b/storage/innobase/include/btr0sea.h
@@ -285,7 +285,7 @@ struct btr_search_t{
ulint n_bytes; /*!< recommended prefix: number of bytes in
an incomplete field
@see BTR_PAGE_MAX_REC_SIZE */
- ibool left_side; /*!< TRUE or FALSE, depending on whether
+ bool left_side; /*!< true or false, depending on whether
the leftmost record of several records with
the same prefix should be indexed in the
hash index */
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 5d2598d3c12..74ea8daefc9 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -929,7 +929,7 @@ dict_index_get_min_size(
Check whether the table uses the compact page format.
@return TRUE if table uses the compact page format */
UNIV_INLINE
-ibool
+bool
dict_table_is_comp(
/*===============*/
const dict_table_t* table) /*!< in: table */
@@ -1275,7 +1275,7 @@ Returns TRUE if the index contains a column or a prefix of that column.
@param[in] n column number
@param[in] is_virtual whether it is a virtual col
@return TRUE if contains the column or its prefix */
-ibool
+bool
dict_index_contains_col_or_prefix(
/*==============================*/
const dict_index_t* index, /*!< in: index */
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index 4497d52ab6d..4190f8415a4 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -570,7 +570,7 @@ dict_table_get_sys_col_no(
Check whether the table uses the compact page format.
@return TRUE if table uses the compact page format */
UNIV_INLINE
-ibool
+bool
dict_table_is_comp(
/*===============*/
const dict_table_t* table) /*!< in: table */
@@ -581,7 +581,7 @@ dict_table_is_comp(
#error "DICT_TF_COMPACT must be 1"
#endif
- return(table->flags & DICT_TF_COMPACT);
+ return (table->flags & DICT_TF_COMPACT) != 0;
}
/************************************************************************
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index 062e4f8d8ab..da82361875c 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -367,7 +367,7 @@ rec_set_deleted_flag_new(
The following function tells if a new-style record is a node pointer.
@return TRUE if node pointer */
UNIV_INLINE
-ibool
+bool
rec_get_node_ptr_flag(
/*==================*/
const rec_t* rec) /*!< in: physical record */
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index cc66149945c..4784f221084 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -731,7 +731,7 @@ rec_set_deleted_flag_new(
The following function tells if a new-style record is a node pointer.
@return TRUE if node pointer */
UNIV_INLINE
-ibool
+bool
rec_get_node_ptr_flag(
/*==================*/
const rec_t* rec) /*!< in: physical record */
diff --git a/storage/innobase/include/sync0rw.h b/storage/innobase/include/sync0rw.h
index c9bc443fc55..b61553fc380 100644
--- a/storage/innobase/include/sync0rw.h
+++ b/storage/innobase/include/sync0rw.h
@@ -507,7 +507,7 @@ rw_lock_lock_word_decr(
/******************************************************************//**
Checks if the thread has locked the rw-lock in the specified mode, with
the pass value == 0. */
-ibool
+bool
rw_lock_own(
/*========*/
rw_lock_t* lock, /*!< in: rw-lock */
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 3d66e50cce9..8e0ce5b1302 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -5544,10 +5544,10 @@ lock_table_queue_validate(
Validates the lock queue on a single record.
@return TRUE if ok */
static
-ibool
+bool
lock_rec_queue_validate(
/*====================*/
- ibool locked_lock_trx_sys,
+ bool locked_lock_trx_sys,
/*!< in: if the caller holds
both the lock mutex and
trx_sys_t->lock. */
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 02a1519914b..882dbf335d8 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1415,7 +1415,7 @@ srv_prepare_to_delete_redo_log_files(
|| srv_log_file_size
!= srv_log_file_size_requested) {
if (srv_encrypt_log
- == log_sys->is_encrypted()) {
+ == (my_bool)log_sys->is_encrypted()) {
info << (srv_encrypt_log
? "Resizing encrypted"
: "Resizing");
diff --git a/storage/innobase/sync/sync0rw.cc b/storage/innobase/sync/sync0rw.cc
index 9996bd7262c..c3a0ed2284b 100644
--- a/storage/innobase/sync/sync0rw.cc
+++ b/storage/innobase/sync/sync0rw.cc
@@ -1011,7 +1011,7 @@ rw_lock_remove_debug_info(
Checks if the thread has locked the rw-lock in the specified mode, with
the pass value == 0.
@return TRUE if locked */
-ibool
+bool
rw_lock_own(
/*========*/
rw_lock_t* lock, /*!< in: rw-lock */
@@ -1034,12 +1034,12 @@ rw_lock_own(
rw_lock_debug_mutex_exit();
/* Found! */
- return(TRUE);
+ return(true);
}
}
rw_lock_debug_mutex_exit();
- return(FALSE);
+ return(false);
}
/** For collecting the debug information for a thread's rw-lock */
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index a52a306ce22..cd7df789858 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -938,7 +938,7 @@ void ha_myisam::setup_vcols_for_repair(HA_CHECK *param)
{
uint vf_end= (*vf)->offset(table->record[0]) + (*vf)->pack_length_in_rec();
set_if_bigger(new_vreclength, vf_end);
- indexed_vcols|= (*vf)->flags & PART_KEY_FLAG;
+ indexed_vcols|= ((*vf)->flags & PART_KEY_FLAG) != 0;
}
if (!indexed_vcols)
return;
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 479e290374e..58aba677c36 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -374,11 +374,11 @@ static my_bool rocksdb_pause_background_work = 0;
static mysql_mutex_t rdb_sysvars_mutex;
static void rocksdb_set_pause_background_work(
- my_core::THD *const thd MY_ATTRIBUTE((__unused__)),
- struct st_mysql_sys_var *const var MY_ATTRIBUTE((__unused__)),
- void *const var_ptr MY_ATTRIBUTE((__unused__)), const void *const save) {
+ my_core::THD *const,
+ struct st_mysql_sys_var *const,
+ void *const, const void *const save) {
RDB_MUTEX_LOCK_CHECK(rdb_sysvars_mutex);
- const bool pause_requested = *static_cast<const bool *>(save);
+ const my_bool pause_requested = *static_cast<const my_bool *>(save);
if (rocksdb_pause_background_work != pause_requested) {
if (pause_requested) {
rdb->PauseBackgroundWork();