summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt4
-rw-r--r--include/config-win.h4
-rw-r--r--include/my_global.h2
-rw-r--r--sql/mysql_priv.h18
-rw-r--r--sql/procedure.h2
-rw-r--r--sql/sql_acl.cc6
-rw-r--r--sql/sql_acl.h6
-rw-r--r--sql/sql_analyse.cc2
-rw-r--r--sql/sql_analyse.h2
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_db.cc2
-rw-r--r--sql/sql_delete.cc4
-rw-r--r--sql/sql_load.cc2
-rw-r--r--sql/sql_parse.cc4
-rw-r--r--sql/sql_prepare.cc6
-rw-r--r--sql/sql_update.cc2
16 files changed, 35 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 341f8d08df2..4bdafc7f4a0 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,6 +104,10 @@ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
+#TODO: update the code and remove the disabled warnings
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805")
+
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996")
diff --git a/include/config-win.h b/include/config-win.h
index e0558ca4564..a53332a9c2e 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -158,14 +158,12 @@ typedef uint rf_SetTimer;
#define Socket_defined
#define my_socket SOCKET
-#define bool BOOL
#define SIGPIPE SIGINT
#define RETQSORTTYPE void
#define QSORT_TYPE_IS_VOID
#define RETSIGTYPE void
#define SOCKET_SIZE_TYPE int
#define my_socket_defined
-#define bool_defined
#define byte_defined
#define HUGE_PTR
#define STDCALL __stdcall /* Used by libmysql.dll */
@@ -472,4 +470,4 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_CHARSET_ujis 1
#define HAVE_CHARSET_utf8 1
#define HAVE_UCA_COLLATIONS 1
-
+#define HAVE_BOOL 1
diff --git a/include/my_global.h b/include/my_global.h
index bc96ad65aee..0d1518859c1 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1067,7 +1067,7 @@ typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
typedef int myf; /* Type of MyFlags in my_funcs */
typedef char my_bool; /* Small bool */
-#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
+#if !defined(bool) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
typedef char bool; /* Ordinary boolean values 0 1 */
#endif
/* Macros for converting *constants* to the right type */
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 9bdf6e2a1d5..6dd07b2ede7 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -741,8 +741,8 @@ inline bool check_some_routine_access(THD *thd, const char *db,
bool multi_update_precheck(THD *thd, TABLE_LIST *tables);
bool multi_delete_precheck(THD *thd, TABLE_LIST *tables);
-bool mysql_multi_update_prepare(THD *thd);
-bool mysql_multi_delete_prepare(THD *thd);
+int mysql_multi_update_prepare(THD *thd);
+int mysql_multi_delete_prepare(THD *thd);
bool mysql_insert_select_prepare(THD *thd);
bool update_precheck(THD *thd, TABLE_LIST *tables);
bool delete_precheck(THD *thd, TABLE_LIST *tables);
@@ -978,7 +978,7 @@ bool setup_connection_thread_globals(THD *thd);
bool login_connection(THD *thd);
void end_connection(THD *thd);
-bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
+int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent);
bool mysql_upgrade_db(THD *thd, LEX_STRING *old_db);
@@ -1022,7 +1022,7 @@ void init_max_user_conn(void);
void init_update_queries(void);
void free_max_user_conn(void);
pthread_handler_t handle_bootstrap(void *arg);
-bool mysql_execute_command(THD *thd);
+int mysql_execute_command(THD *thd);
bool do_command(THD *thd);
bool dispatch_command(enum enum_server_command command, THD *thd,
char* packet, uint packet_length);
@@ -1198,7 +1198,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
int check_that_all_fields_are_given_values(THD *thd, TABLE *entry,
TABLE_LIST *table_list);
void prepare_triggers_for_insert_stmt(TABLE *table);
-bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds);
+int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds);
bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
SQL_LIST *order, ha_rows rows, ulonglong options,
bool reset_auto_increment);
@@ -1472,14 +1472,14 @@ void wait_for_condition(THD *thd, pthread_mutex_t *mutex,
pthread_cond_t *cond);
int open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags);
/* open_and_lock_tables with optional derived handling */
-bool open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived);
+int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived);
/* simple open_and_lock_tables without derived handling */
-inline bool simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables)
+inline int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables)
{
return open_and_lock_tables_derived(thd, tables, FALSE);
}
/* open_and_lock_tables with derived handling */
-inline bool open_and_lock_tables(THD *thd, TABLE_LIST *tables)
+inline int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
{
return open_and_lock_tables_derived(thd, tables, TRUE);
}
@@ -1708,7 +1708,7 @@ inline TABLE_LIST *find_table_in_local_list(TABLE_LIST *table,
bool eval_const_cond(COND *cond);
/* sql_load.cc */
-bool mysql_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list,
+int mysql_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list,
List<Item> &fields_vars, List<Item> &set_fields,
List<Item> &set_values_list,
enum enum_duplicates handle_duplicates, bool ignore,
diff --git a/sql/procedure.h b/sql/procedure.h
index 4578fcb87f1..ceb586766b1 100644
--- a/sql/procedure.h
+++ b/sql/procedure.h
@@ -144,7 +144,7 @@ public:
virtual int send_row(List<Item> &fields)=0;
virtual bool change_columns(List<Item> &fields)=0;
virtual void update_refs(void) {}
- virtual bool end_of_records() { return 0; }
+ virtual int end_of_records() { return 0; }
};
Procedure *setup_procedure(THD *thd,ORDER *proc_param,select_result *result,
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 9d38efb6464..9f01b033de8 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1521,7 +1521,7 @@ bool acl_check_host(const char *host, const char *ip)
1 ERROR ; In this case the error is sent to the client.
*/
-bool check_change_password(THD *thd, const char *host, const char *user,
+int check_change_password(THD *thd, const char *host, const char *user,
char *new_password, uint new_password_len)
{
if (!initialized)
@@ -2922,7 +2922,7 @@ table_error:
TRUE error
*/
-bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
+int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
List <LEX_USER> &user_list,
List <LEX_COLUMN> &columns, ulong rights,
bool revoke_grant)
@@ -6087,7 +6087,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
< 0 Error. Error message not yet sent.
*/
-bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
+int sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
bool is_proc)
{
Security_context *sctx= thd->security_ctx;
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index a279c26c2e4..9ae17a4bf02 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -222,13 +222,13 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, const char *passwd,
bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
char *ip, char *db);
bool acl_check_host(const char *host, const char *ip);
-bool check_change_password(THD *thd, const char *host, const char *user,
+int check_change_password(THD *thd, const char *host, const char *user,
char *password, uint password_len);
bool change_password(THD *thd, const char *host, const char *user,
char *password);
bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &user_list,
ulong rights, bool revoke);
-bool mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list,
+int mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list,
List <LEX_COLUMN> &column_list, ulong rights,
bool revoke);
bool mysql_routine_grant(THD *thd, TABLE_LIST *table, bool is_proc,
@@ -264,7 +264,7 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
const char *db, const char *table);
bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
bool is_proc);
-bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
+int sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
bool is_proc);
bool check_routine_level_acl(THD *thd, const char *db, const char *name,
bool is_proc);
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 490cc5e28c1..9ca6e0a0a2b 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -682,7 +682,7 @@ int analyse::send_row(List<Item> & /* field_list */)
} // analyse::send_row
-bool analyse::end_of_records()
+int analyse::end_of_records()
{
field_info **f = f_info;
char buff[MAX_FIELD_WIDTH];
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h
index 827b6f4b217..8807b40857e 100644
--- a/sql/sql_analyse.h
+++ b/sql/sql_analyse.h
@@ -350,7 +350,7 @@ public:
virtual bool change_columns(List<Item> &fields);
virtual int send_row(List<Item> &field_list);
virtual void end_group(void) {}
- virtual bool end_of_records(void);
+ virtual int end_of_records(void);
friend Procedure *proc_analyse_init(THD *thd, ORDER *param,
select_result *result,
List<Item> &field_list);
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 01e0009ad0d..48d1e470e7f 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4865,7 +4865,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type,
the third argument set appropriately.
*/
-bool open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived)
+int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived)
{
uint counter;
bool need_reopen;
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index d03ac7921ac..59e34b4d5ba 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -606,7 +606,7 @@ CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name)
*/
-bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
+int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
bool silent)
{
char path[FN_REFLEN+16];
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 990f7713561..9b66684a463 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -411,7 +411,7 @@ cleanup:
FALSE OK
TRUE error
*/
-bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
+int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
{
Item *fake_conds= 0;
SELECT_LEX *select_lex= &thd->lex->select_lex;
@@ -474,7 +474,7 @@ extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b)
TRUE Error
*/
-bool mysql_multi_delete_prepare(THD *thd)
+int mysql_multi_delete_prepare(THD *thd)
{
LEX *lex= thd->lex;
TABLE_LIST *aux_tables= (TABLE_LIST *)lex->auxiliary_table_list.first;
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 4d5dc8e6f06..a96d6f23a22 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -110,7 +110,7 @@ static bool write_execute_load_query_log_event(THD *thd,
TRUE - error / FALSE - success
*/
-bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
+int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
List<Item> &fields_vars, List<Item> &set_fields,
List<Item> &set_values,
enum enum_duplicates handle_duplicates, bool ignore,
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 1125127c852..ce6218d86e3 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1856,10 +1856,10 @@ bool sp_process_definer(THD *thd)
TRUE Error
*/
-bool
+int
mysql_execute_command(THD *thd)
{
- bool res= FALSE;
+ int res= FALSE;
bool need_start_waiting= FALSE; // have protection against global read lock
int up_result= 0;
LEX *lex= thd->lex;
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index a027ffe9daa..933810a3fff 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1415,7 +1415,7 @@ error:
*/
static bool select_like_stmt_test(Prepared_statement *stmt,
- bool (*specific_prepare)(THD *thd),
+ int (*specific_prepare)(THD *thd),
ulong setup_tables_done_option)
{
DBUG_ENTER("select_like_stmt_test");
@@ -1452,7 +1452,7 @@ static bool select_like_stmt_test(Prepared_statement *stmt,
static bool
select_like_stmt_test_with_open(Prepared_statement *stmt,
TABLE_LIST *tables,
- bool (*specific_prepare)(THD *thd),
+ int (*specific_prepare)(THD *thd),
ulong setup_tables_done_option)
{
DBUG_ENTER("select_like_stmt_test_with_open");
@@ -1638,7 +1638,7 @@ error:
uses local tables lists.
*/
-static bool mysql_insert_select_prepare_tester(THD *thd)
+static int mysql_insert_select_prepare_tester(THD *thd)
{
SELECT_LEX *first_select= &thd->lex->select_lex;
TABLE_LIST *second_table= ((TABLE_LIST*)first_select->table_list.first)->
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 7c9ead7591c..550ff76b47a 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -930,7 +930,7 @@ static table_map get_table_map(List<Item> *items)
TRUE Error
*/
-bool mysql_multi_update_prepare(THD *thd)
+int mysql_multi_update_prepare(THD *thd)
{
LEX *lex= thd->lex;
TABLE_LIST *table_list= lex->query_tables;