summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/maintainer.cmake2
-rw-r--r--sql/gcalc_tools.cc2
-rw-r--r--sql/gcalc_tools.h16
-rw-r--r--sql/handler.h8
-rw-r--r--sql/sql_class.h4
-rw-r--r--sql/sql_lex.h12
6 files changed, 21 insertions, 23 deletions
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index 8dbe7a6df47..5a1d186cf58 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -22,6 +22,8 @@ ENDIF()
SET(MY_WARNING_FLAGS
-Wall
-Wdeclaration-after-statement
+ -Wenum-compare
+ -Wenum-conversion
-Wextra
-Wformat-security
-Wno-format-truncation
diff --git a/sql/gcalc_tools.cc b/sql/gcalc_tools.cc
index 307f063fb43..25c80a7a796 100644
--- a/sql/gcalc_tools.cc
+++ b/sql/gcalc_tools.cc
@@ -132,7 +132,7 @@ int Gcalc_function::count_internal(const char *cur_func, uint set_type,
int mask= (c_op & op_not) ? 1:0;
uint n_ops= c_op & ~(op_any | op_not | v_mask);
uint n_shape= c_op & ~(op_any | op_not | v_mask); /* same as n_ops */
- value v_state= (value) (c_op & v_mask);
+ op_type v_state= (op_type) (c_op & v_mask);
int result= 0;
const char *sav_cur_func= cur_func;
diff --git a/sql/gcalc_tools.h b/sql/gcalc_tools.h
index e625b355d95..bb1f473e180 100644
--- a/sql/gcalc_tools.h
+++ b/sql/gcalc_tools.h
@@ -52,17 +52,15 @@ private:
int count_internal(const char *cur_func, uint set_type,
const char **end);
public:
- enum value
- {
- v_empty= 0x0000000,
- v_find_t= 0x1000000,
- v_find_f= 0x2000000,
- v_t_found= 0x3000000,
- v_f_found= 0x4000000,
- v_mask= 0x7000000
- };
enum op_type
{
+ v_empty= 0x00000000,
+ v_find_t= 0x01000000,
+ v_find_f= 0x02000000,
+ v_t_found= 0x03000000,
+ v_f_found= 0x04000000,
+ v_mask= 0x07000000,
+
op_not= 0x80000000,
op_shape= 0x00000000,
op_union= 0x10000000,
diff --git a/sql/handler.h b/sql/handler.h
index 47da1b938d7..cd999f30bc0 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -2636,10 +2636,10 @@ public:
double import_cost; /* cost of remote operations */
double mem_cost; /* cost of used memory */
- enum { IO_COEFF=1 };
- enum { CPU_COEFF=1 };
- enum { MEM_COEFF=1 };
- enum { IMPORT_COEFF=1 };
+ static const int IO_COEFF=1;
+ static const int CPU_COEFF=1;
+ static const int MEM_COEFF=1;
+ static const int IMPORT_COEFF=1;
Cost_estimate()
{
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 19466b3de90..0301eeec093 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -5133,8 +5133,8 @@ my_eof(THD *thd)
inline date_conv_mode_t sql_mode_for_dates(THD *thd)
{
- static_assert((date_conv_mode_t::KNOWN_MODES &
- time_round_mode_t::KNOWN_MODES) == 0,
+ static_assert((ulonglong(date_conv_mode_t::KNOWN_MODES) &
+ ulonglong(time_round_mode_t::KNOWN_MODES)) == 0,
"date_conv_mode_t and time_round_mode_t must use different "
"bit values");
static_assert(MODE_NO_ZERO_DATE == date_mode_t::NO_ZERO_DATE &&
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 3db50222a27..09e0df2edca 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1995,8 +1995,7 @@ public:
@retval nonzero if the statement is a row injection
*/
inline bool is_stmt_row_injection() const {
- return binlog_stmt_flags &
- (1U << (BINLOG_STMT_UNSAFE_COUNT + BINLOG_STMT_TYPE_ROW_INJECTION));
+ return binlog_stmt_flags & (1U << BINLOG_STMT_TYPE_ROW_INJECTION);
}
/**
@@ -2006,8 +2005,7 @@ public:
*/
inline void set_stmt_row_injection() {
DBUG_ENTER("set_stmt_row_injection");
- binlog_stmt_flags|=
- (1U << (BINLOG_STMT_UNSAFE_COUNT + BINLOG_STMT_TYPE_ROW_INJECTION));
+ binlog_stmt_flags|= (1U << BINLOG_STMT_TYPE_ROW_INJECTION);
DBUG_VOID_RETURN;
}
@@ -2283,7 +2281,7 @@ private:
The statement is a row injection (i.e., either a BINLOG
statement or a row event executed by the slave SQL thread).
*/
- BINLOG_STMT_TYPE_ROW_INJECTION = 0,
+ BINLOG_STMT_TYPE_ROW_INJECTION = BINLOG_STMT_UNSAFE_COUNT,
/** The last element of this enumeration type. */
BINLOG_STMT_TYPE_COUNT
@@ -2297,8 +2295,8 @@ private:
- The low BINLOG_STMT_UNSAFE_COUNT bits indicate the types of
unsafeness that the current statement has.
- - The next BINLOG_STMT_TYPE_COUNT bits indicate if the statement
- is of some special type.
+ - The next BINLOG_STMT_TYPE_COUNT-BINLOG_STMT_TYPE_COUNT bits indicate if
+ the statement is of some special type.
This must be a member of LEX, not of THD: each stored procedure
needs to remember its unsafeness state between calls and each