diff options
author | unknown <gkodinov/kgeorge@macbook.gmz> | 2008-03-21 17:23:17 +0200 |
---|---|---|
committer | unknown <gkodinov/kgeorge@macbook.gmz> | 2008-03-21 17:23:17 +0200 |
commit | cebb6727b3c8593283f81182d06c45ca69cc0304 (patch) | |
tree | d2f43f2618b402fbb8989716aacea8b5cb8eb442 /sql | |
parent | f20fe94b55727fbc69b1cb86af5dc96f216bdd87 (diff) | |
download | mariadb-git-cebb6727b3c8593283f81182d06c45ca69cc0304.tar.gz |
Bug #26461: Intrinsic data type bool (1 byte) redefined to BOOL (4 bytes)
The bool data type was redefined to BOOL (4 bytes on windows).
Removed the #define and fixed some of the warnings that were uncovered
by this.
Note that the fix also disables 2 warnings :
4800 : 'type' : forcing value to bool 'true' or 'false' (performance warning)
4805: 'operation' : unsafe mix of type 'type' and type 'type' in operation
These warnings will be handled in a separate bug, as they are performance related or bogus.
Fixed to int the return type of functions that return more than
2 distinct values.
CMakeLists.txt:
Bug #26461: disable the C4800 and C4805 warnings temporarily
include/config-win.h:
Bug #26461:
- no need for this define for Windows.
- windows C++ compilers have a bool type
include/my_global.h:
Bug #26461: removed bool_defined (no longer needed)
sql/handler.h:
Bug #26461: bool functions must return boolean values
sql/mysql_priv.h:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/procedure.h:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_acl.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_acl.h:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_analyse.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_analyse.h:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_base.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_db.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_delete.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_load.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_parse.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_prepare.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_update.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/handler.h | 2 | ||||
-rw-r--r-- | sql/mysql_priv.h | 14 | ||||
-rw-r--r-- | sql/procedure.h | 2 | ||||
-rw-r--r-- | sql/sql_acl.cc | 6 | ||||
-rw-r--r-- | sql/sql_acl.h | 6 | ||||
-rw-r--r-- | sql/sql_analyse.cc | 2 | ||||
-rw-r--r-- | sql/sql_analyse.h | 2 | ||||
-rw-r--r-- | sql/sql_base.cc | 2 | ||||
-rw-r--r-- | sql/sql_db.cc | 2 | ||||
-rw-r--r-- | sql/sql_delete.cc | 4 | ||||
-rw-r--r-- | sql/sql_load.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 4 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 6 | ||||
-rw-r--r-- | sql/sql_update.cc | 2 |
14 files changed, 28 insertions, 28 deletions
diff --git a/sql/handler.h b/sql/handler.h index 74c09d2d9ee..aa3377c3868 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -815,7 +815,7 @@ public: { return HA_ADMIN_NOT_IMPLEMENTED; } /* end of the list of admin commands */ - virtual bool check_and_repair(THD *thd) { return HA_ERR_WRONG_COMMAND; } + virtual bool check_and_repair(THD *thd) { return TRUE; } virtual int dump(THD* thd, int fd = -1) { return HA_ERR_WRONG_COMMAND; } virtual int disable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; } virtual int enable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 59ec18e1a3d..0b488900ac5 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -597,8 +597,8 @@ bool check_merge_table_access(THD *thd, char *db, bool check_some_routine_access(THD *thd, const char *db, const char *name, bool is_proc); 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); @@ -691,7 +691,7 @@ struct Query_cache_query_flags uint build_table_path(char *buff, size_t bufflen, const char *db, const char *table, const char *ext); -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); void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, ushort flags); @@ -731,7 +731,7 @@ pthread_handler_t handle_one_connection(void *arg); pthread_handler_t handle_bootstrap(void *arg); void end_thread(THD *thd,bool put_in_cache); void flush_thread_cache(); -bool mysql_execute_command(THD *thd); +int mysql_execute_command(THD *thd); bool dispatch_command(enum enum_server_command command, THD *thd, char* packet, uint packet_length); void log_slow_statement(THD *thd); @@ -862,7 +862,7 @@ void prepare_triggers_for_insert_stmt(THD *thd, TABLE *table, enum_duplicates duplic); void mark_fields_used_by_triggers_for_insert_stmt(THD *thd, TABLE *table, enum_duplicates duplic); -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); @@ -1106,7 +1106,7 @@ int init_ftfuncs(THD *thd, SELECT_LEX* select, bool no_order); void wait_for_refresh(THD *thd); int open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags); int simple_open_n_lock_tables(THD *thd,TABLE_LIST *tables); -bool open_and_lock_tables(THD *thd,TABLE_LIST *tables); +int open_and_lock_tables(THD *thd,TABLE_LIST *tables); bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags); int lock_tables(THD *thd, TABLE_LIST *tables, uint counter, bool *need_reopen); TABLE *open_temporary_table(THD *thd, const char *path, const char *db, @@ -1177,7 +1177,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 850d5c74db4..f1fb433a6ee 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 e9504f423ad..e773f754e18 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1382,7 +1382,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) @@ -2763,7 +2763,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) @@ -5805,7 +5805,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 b2007ccdf47..1efcd2e3b6b 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -183,13 +183,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, @@ -225,7 +225,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 95a7fb3d34d..2e90d00f8aa 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -683,7 +683,7 @@ int analyse::send_row(List<Item> &field_list __attribute__((unused))) } // 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 21a37209e89..2a4226b2d95 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> &fields); 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 c9f20b3d71b..533b0070fee 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -3046,7 +3046,7 @@ int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables) The lock will automaticaly be freed by close_thread_tables() */ -bool open_and_lock_tables(THD *thd, TABLE_LIST *tables) +int open_and_lock_tables(THD *thd, TABLE_LIST *tables) { uint counter; bool need_reopen; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 91b0c02d23b..e25ede1be03 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -449,7 +449,7 @@ bool load_db_opt_by_name(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 a28a39a769d..af895c172ff 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -370,7 +370,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; @@ -433,7 +433,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 d687ceff393..4da3c19bb3c 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 8bdbd812529..98e04e45bdd 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2500,10 +2500,10 @@ static void reset_one_shot_variables(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 18cfd8d7dfc..220b9a0bcd8 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1403,7 +1403,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"); @@ -1441,7 +1441,7 @@ static bool select_like_stmt_test(Prepared_statement *stmt, static bool select_like_stmt_test_with_open_n_lock(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_n_lock"); @@ -1630,7 +1630,7 @@ error: because mysql_handle_derived 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 84349a40977..541704cfaf1 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -716,7 +716,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; |