MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:kgeorge Date:March 21 2008 3:23pm
Subject:bk commit into 5.0 tree (gkodinov:1.2598) BUG#26461
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gkodinov.  When gkodinov does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-03-21 17:23:17+02:00, gkodinov@stripped +17 -0
  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@stripped, 2008-03-21 17:23:13+02:00, gkodinov@stripped +4 -0
    Bug #26461: disable the C4800 and C4805 warnings temporarily

  include/config-win.h@stripped, 2008-03-21 17:23:13+02:00, gkodinov@stripped +1 -3
    Bug #26461: 
     - no need for this define for Windows.
     - windows C++ compilers have a bool type

  include/my_global.h@stripped, 2008-03-21 17:23:13+02:00, gkodinov@stripped +1 -1
    Bug #26461: removed bool_defined (no longer needed)

  sql/handler.h@stripped, 2008-03-21 17:23:13+02:00, gkodinov@stripped +1 -1
    Bug #26461: bool functions must return boolean values

  sql/mysql_priv.h@stripped, 2008-03-21 17:23:13+02:00, gkodinov@stripped +7 -7
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/procedure.h@stripped, 2008-03-21 17:23:13+02:00, gkodinov@stripped +1 -1
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_acl.cc@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +3 -3
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_acl.h@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +3 -3
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_analyse.cc@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +1 -1
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_analyse.h@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +1 -1
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_base.cc@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +1 -1
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_db.cc@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +1 -1
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_delete.cc@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +2 -2
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_load.cc@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +1 -1
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_parse.cc@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +2 -2
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_prepare.cc@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +3 -3
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

  sql/sql_update.cc@stripped, 2008-03-21 17:23:14+02:00, gkodinov@stripped +1 -1
    Bug #26461: fixed return type of functions that return more than
    2 distinct values.

diff -Nrup a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt	2007-11-02 21:16:44 +02:00
+++ b/CMakeLists.txt	2008-03-21 17:23:13 +02:00
@@ -78,6 +78,10 @@ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CM
 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 -Nrup a/include/config-win.h b/include/config-win.h
--- a/include/config-win.h	2007-10-23 16:48:54 +03:00
+++ b/include/config-win.h	2008-03-21 17:23:13 +02:00
@@ -157,14 +157,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 */
@@ -457,4 +455,4 @@ inline double ulonglong2double(ulonglong
 #define HAVE_CHARSET_ujis 1
 #define HAVE_CHARSET_utf8 1
 #define HAVE_UCA_COLLATIONS 1
-
+#define HAVE_BOOL 1
diff -Nrup a/include/my_global.h b/include/my_global.h
--- a/include/my_global.h	2007-11-30 02:37:04 +02:00
+++ b/include/my_global.h	2008-03-21 17:23:13 +02:00
@@ -980,7 +980,7 @@ typedef int		myf;	/* Type of MyFlags in 
 typedef char		byte;	/* Smallest addressable unit */
 #endif
 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 -Nrup a/sql/handler.h b/sql/handler.h
--- a/sql/handler.h	2007-08-02 03:39:10 +03:00
+++ b/sql/handler.h	2008-03-21 17:23:13 +02:00
@@ -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 -Nrup a/sql/mysql_priv.h b/sql/mysql_priv.h
--- a/sql/mysql_priv.h	2008-02-29 11:55:49 +02:00
+++ b/sql/mysql_priv.h	2008-03-21 17:23:13 +02:00
@@ -597,8 +597,8 @@ bool check_merge_table_access(THD *thd, 
 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(
 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(TH
                                       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* s
 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_l
 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 -Nrup a/sql/procedure.h b/sql/procedure.h
--- a/sql/procedure.h	2006-12-30 22:02:07 +02:00
+++ b/sql/procedure.h	2008-03-21 17:23:13 +02:00
@@ -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 -Nrup a/sql/sql_acl.cc b/sql/sql_acl.cc
--- a/sql/sql_acl.cc	2008-02-17 13:35:07 +02:00
+++ b/sql/sql_acl.cc	2008-03-21 17:23:14 +02:00
@@ -1382,7 +1382,7 @@ bool acl_check_host(const char *host, co
       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, cons
     < 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 -Nrup a/sql/sql_acl.h b/sql/sql_acl.h
--- a/sql/sql_acl.h	2007-09-27 12:15:18 +03:00
+++ b/sql/sql_acl.h	2008-03-21 17:23:14 +02:00
@@ -183,13 +183,13 @@ int acl_getroot(THD *thd, USER_RESOURCES
 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
                                      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 -Nrup a/sql/sql_analyse.cc b/sql/sql_analyse.cc
--- a/sql/sql_analyse.cc	2007-02-06 15:18:40 +02:00
+++ b/sql/sql_analyse.cc	2008-03-21 17:23:14 +02:00
@@ -683,7 +683,7 @@ int analyse::send_row(List<Item> &field_
 } // analyse::send_row
 
 
-bool analyse::end_of_records()
+int analyse::end_of_records()
 {
   field_info **f = f_info;
   char buff[MAX_FIELD_WIDTH];
diff -Nrup a/sql/sql_analyse.h b/sql/sql_analyse.h
--- a/sql/sql_analyse.h	2006-12-30 22:02:07 +02:00
+++ b/sql/sql_analyse.h	2008-03-21 17:23:14 +02:00
@@ -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 -Nrup a/sql/sql_base.cc b/sql/sql_base.cc
--- a/sql/sql_base.cc	2008-02-22 10:30:16 +02:00
+++ b/sql/sql_base.cc	2008-03-21 17:23:14 +02:00
@@ -3046,7 +3046,7 @@ int simple_open_n_lock_tables(THD *thd, 
     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 -Nrup a/sql/sql_db.cc b/sql/sql_db.cc
--- a/sql/sql_db.cc	2007-07-05 01:20:30 +03:00
+++ b/sql/sql_db.cc	2008-03-21 17:23:14 +02:00
@@ -449,7 +449,7 @@ bool load_db_opt_by_name(THD *thd, const
 
 */
 
-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 -Nrup a/sql/sql_delete.cc b/sql/sql_delete.cc
--- a/sql/sql_delete.cc	2007-10-29 15:20:54 +02:00
+++ b/sql/sql_delete.cc	2008-03-21 17:23:14 +02:00
@@ -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* ar
     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 -Nrup a/sql/sql_load.cc b/sql/sql_load.cc
--- a/sql/sql_load.cc	2007-10-29 15:20:55 +02:00
+++ b/sql/sql_load.cc	2008-03-21 17:23:14 +02:00
@@ -110,7 +110,7 @@ static bool write_execute_load_query_log
     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 -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc	2008-03-12 09:54:54 +02:00
+++ b/sql/sql_parse.cc	2008-03-21 17:23:14 +02:00
@@ -2500,10 +2500,10 @@ static void reset_one_shot_variables(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 -Nrup a/sql/sql_prepare.cc b/sql/sql_prepare.cc
--- a/sql/sql_prepare.cc	2008-02-21 23:28:21 +02:00
+++ b/sql/sql_prepare.cc	2008-03-21 17:23:14 +02:00
@@ -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(Prepar
 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 -Nrup a/sql/sql_update.cc b/sql/sql_update.cc
--- a/sql/sql_update.cc	2007-11-06 13:27:43 +02:00
+++ b/sql/sql_update.cc	2008-03-21 17:23:14 +02:00
@@ -716,7 +716,7 @@ static table_map get_table_map(List<Item
     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;
Thread
bk commit into 5.0 tree (gkodinov:1.2598) BUG#26461kgeorge23 Mar