diff options
36 files changed, 178 insertions, 138 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 5d6018fd910..4fa0b21cdac 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -151,7 +151,7 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0, tty_password= 0, opt_nobeep=0, opt_reconnect=1, default_charset_used= 0, opt_secure_auth= 0, default_pager_set= 0, opt_sigint_ignore= 0, - show_warnings= 0, executing_query= 0, interrupted_query= 0, + show_warnings= 0, executing_query= 0, ignore_spaces= 0; static my_bool debug_info_flag, debug_check_flag, batch_abort_on_error; static my_bool column_types_flag; @@ -162,6 +162,7 @@ static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0; static uint my_end_arg; static char * opt_mysql_unix_port=0; static int connect_flag=CLIENT_INTERACTIVE; +static int interrupted_query= 0; static char *current_host,*current_db,*current_user=0,*opt_password=0, *current_prompt=0, *delimiter_str= 0, *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; @@ -3982,7 +3983,7 @@ static int com_connect(String *buffer, char *line) { char *tmp, buff[256]; - bool save_rehash= opt_rehash; + my_bool save_rehash= opt_rehash; int error; bzero(buff, sizeof(buff)); diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 018b07690e3..9e6a1513af6 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -1469,7 +1469,7 @@ static my_bool wait_pidfile(char *pidfile, time_t last_modified, struct stat *pidfile_status) { char buff[FN_REFLEN]; - int error= 1; + my_bool error= 1; uint count= 0; DBUG_ENTER("wait_pidfile"); diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 0a7bf9b556d..7e591fb4e5d 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -4727,11 +4727,11 @@ char *get_string(char **to_ptr, char **from_ptr, } -void set_reconnect(MYSQL* mysql, int val) +void set_reconnect(MYSQL* mysql, my_bool val) { my_bool reconnect= val; DBUG_ENTER("set_reconnect"); - DBUG_PRINT("info", ("val: %d", val)); + DBUG_PRINT("info", ("val: %d", (int) val)); #if MYSQL_VERSION_ID < 50000 mysql->reconnect= reconnect; #else @@ -8591,15 +8591,15 @@ void free_replace() typedef struct st_replace { - my_bool found; + int found; struct st_replace *next[256]; } REPLACE; typedef struct st_replace_found { - my_bool found; - char *replace_string; + int found; uint to_offset; int from_offset; + char *replace_string; } REPLACE_STRING; @@ -8631,7 +8631,7 @@ void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds, } /* Found a string that needs to be replaced */ - DBUG_PRINT("info", ("found: %d, to_offset: %d, from_offset: %d, string: %s", + DBUG_PRINT("info", ("found: %d, to_offset: %u, from_offset: %d, string: %s", rep_str->found, rep_str->to_offset, rep_str->from_offset, rep_str->replace_string)); diff --git a/extra/libevent/evbuffer.c b/extra/libevent/evbuffer.c index 6fe791380ea..432d75d1c53 100644 --- a/extra/libevent/evbuffer.c +++ b/extra/libevent/evbuffer.c @@ -75,7 +75,7 @@ bufferevent_add(struct event *ev, int timeout) */ void -bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now, +bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old __attribute__((unused)), size_t now, void *arg) { struct bufferevent *bufev = arg; /* diff --git a/extra/libevent/event.c b/extra/libevent/event.c index e96c1b6a3ab..2042c2de626 100644 --- a/extra/libevent/event.c +++ b/extra/libevent/event.c @@ -394,7 +394,8 @@ event_base_get_method(struct event_base *base) } static void -event_loopexit_cb(int fd, short what, void *arg) +event_loopexit_cb(int fd __attribute__((unused)), + short what __attribute__((unused)), void *arg) { struct event_base *base = arg; base->event_gotterm = 1; diff --git a/extra/libevent/signal.c b/extra/libevent/signal.c index 964ae37fed2..5eb9d3c606e 100644 --- a/extra/libevent/signal.c +++ b/extra/libevent/signal.c @@ -69,7 +69,7 @@ static void evsignal_handler(int sig); /* Callback for when the signal handler write a byte to our signaling socket */ static void -evsignal_cb(int fd, short what, void *arg) +evsignal_cb(int fd, short what __attribute__((unused)), void *arg __attribute__((unused))) { static char signals[100]; #ifdef WIN32 diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h index e32077b9c97..1ca619b8ed6 100644 --- a/sql/event_data_objects.h +++ b/sql/event_data_objects.h @@ -89,9 +89,9 @@ public: my_time_t execute_at; my_time_t starts; my_time_t ends; - my_bool starts_null; - my_bool ends_null; - my_bool execute_at_null; + bool starts_null; + bool ends_null; + bool execute_at_null; longlong expression; interval_type interval; diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 1349f6b5cba..d1fa971847b 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -610,7 +610,7 @@ Event_db_repository::open_event_table(THD *thd, enum thr_lock_type lock_type, bool Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, - my_bool create_if_not) + bool create_if_not) { int ret= 1; TABLE *table= NULL; diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h index ef778407d1e..7ff17558572 100644 --- a/sql/event_db_repository.h +++ b/sql/event_db_repository.h @@ -73,7 +73,7 @@ public: Event_db_repository(){} bool - create_event(THD *thd, Event_parse_data *parse_data, my_bool create_if_not); + create_event(THD *thd, Event_parse_data *parse_data, bool create_if_not); bool update_event(THD *thd, Event_parse_data *parse_data, LEX_STRING *new_dbname, diff --git a/sql/event_parse_data.h b/sql/event_parse_data.h index 8b42eb23937..01cdc685c46 100644 --- a/sql/event_parse_data.h +++ b/sql/event_parse_data.h @@ -70,9 +70,9 @@ public: my_time_t starts; my_time_t ends; my_time_t execute_at; - my_bool starts_null; - my_bool ends_null; - my_bool execute_at_null; + bool starts_null; + bool ends_null; + bool execute_at_null; sp_name *identifier; Item* item_expression; diff --git a/sql/events.cc b/sql/events.cc index 8bb7406b615..1b794edb5ec 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -917,7 +917,7 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */) */ bool -Events::init(my_bool opt_noacl_or_bootstrap) +Events::init(bool opt_noacl_or_bootstrap) { THD *thd; diff --git a/sql/events.h b/sql/events.h index 2bc87517748..a3c98d84f00 100644 --- a/sql/events.h +++ b/sql/events.h @@ -92,7 +92,7 @@ public: get_db_repository() { return db_repository; } static bool - init(my_bool opt_noacl); + init(bool opt_noacl); static void deinit(); diff --git a/sql/field.cc b/sql/field.cc index 62c7d31367d..446e88ab0cb 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1284,7 +1284,7 @@ static bool test_if_real(const char *str,int length, CHARSET_INFO *cs) This is used for printing bit_fields as numbers while debugging. */ -String *Field::val_int_as_str(String *val_buffer, my_bool unsigned_val) +String *Field::val_int_as_str(String *val_buffer, bool unsigned_val) { ASSERT_COLUMN_MARKED_FOR_READ; CHARSET_INFO *cs= &my_charset_bin; @@ -6855,7 +6855,7 @@ int Field_string::do_save_field_metadata(uchar *metadata_ptr) */ int Field_string::pack_cmp(const uchar *a, const uchar *b, uint length, - my_bool insert_or_update) + bool insert_or_update) { uint a_length, b_length; if (length > 255) @@ -6893,7 +6893,7 @@ int Field_string::pack_cmp(const uchar *a, const uchar *b, uint length, */ int Field_string::pack_cmp(const uchar *key, uint length, - my_bool insert_or_update) + bool insert_or_update) { uint row_length, local_key_length; uchar *end; @@ -7372,7 +7372,7 @@ Field_varstring::unpack(uchar *to, const uchar *from, int Field_varstring::pack_cmp(const uchar *a, const uchar *b, uint key_length_arg, - my_bool insert_or_update) + bool insert_or_update) { uint a_length, b_length; if (key_length_arg > 255) @@ -7393,7 +7393,7 @@ int Field_varstring::pack_cmp(const uchar *a, const uchar *b, int Field_varstring::pack_cmp(const uchar *b, uint key_length_arg, - my_bool insert_or_update) + bool insert_or_update) { uchar *a= ptr+ length_bytes; uint a_length= length_bytes == 1 ? (uint) *ptr : uint2korr(ptr); @@ -8124,7 +8124,7 @@ const uchar *Field_blob::unpack(uchar *to, /* Keys for blobs are like keys on varchars */ int Field_blob::pack_cmp(const uchar *a, const uchar *b, uint key_length_arg, - my_bool insert_or_update) + bool insert_or_update) { uint a_length, b_length; if (key_length_arg > 255) @@ -8145,7 +8145,7 @@ int Field_blob::pack_cmp(const uchar *a, const uchar *b, uint key_length_arg, int Field_blob::pack_cmp(const uchar *b, uint key_length_arg, - my_bool insert_or_update) + bool insert_or_update) { uchar *a; uint a_length, b_length; diff --git a/sql/field.h b/sql/field.h index 53cfb982e32..ca400caac59 100644 --- a/sql/field.h +++ b/sql/field.h @@ -64,9 +64,9 @@ private: */ enum_field_types field_type; /* Real field type*/ /* Flag indicating that the field is physically stored in the database */ - my_bool stored_in_db; + bool stored_in_db; /* Flag indicating that the field used in a partitioning expression */ - my_bool in_partitioning_expr; + bool in_partitioning_expr; public: /* The expression to compute the value of the virtual column */ @@ -217,7 +217,7 @@ public: This trickery is used to decrease a number of malloc calls. */ virtual String *val_str(String*,String *)=0; - String *val_int_as_str(String *val_buffer, my_bool unsigned_flag); + String *val_int_as_str(String *val_buffer, bool unsigned_flag); /* str_needs_quotes() returns TRUE if the value returned by val_str() needs to be quoted when used in constructing an SQL query. @@ -516,10 +516,10 @@ public: { return max_length;} virtual int pack_cmp(const uchar *a,const uchar *b, uint key_length_arg, - my_bool insert_or_update) + bool insert_or_update) { return cmp(a,b); } virtual int pack_cmp(const uchar *b, uint key_length_arg, - my_bool insert_or_update) + bool insert_or_update) { return cmp(ptr,b); } uint offset(uchar *record) { @@ -785,7 +785,7 @@ public: /* base class for float and double and decimal (old one) */ class Field_real :public Field_num { public: - my_bool not_fixed; + bool not_fixed; Field_real(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, @@ -1212,7 +1212,7 @@ public: NONE, field_name_arg, dec_arg, 0, 0) {} Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, - uint8 dec_arg, my_bool not_fixed_arg) + uint8 dec_arg, bool not_fixed_arg) :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, NONE, field_name_arg, dec_arg, 0, 0) {not_fixed= not_fixed_arg; } @@ -1303,7 +1303,7 @@ public: Field::set_default(); } /* Get TIMESTAMP field value as seconds since begging of Unix Epoch */ - inline long get_timestamp(my_bool *null_value) + inline long get_timestamp(bool *null_value) { if ((*null_value= is_null())) return 0; @@ -1590,8 +1590,8 @@ public: const Relay_log_info *rli, uint16 mflags); uint row_pack_length() { return (field_length + 1); } int pack_cmp(const uchar *a,const uchar *b,uint key_length, - my_bool insert_or_update); - int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update); + bool insert_or_update); + int pack_cmp(const uchar *b,uint key_length,bool insert_or_update); uint packed_col_length(const uchar *to, uint length); uint max_packed_col_length(uint max_length); uint size_of() const { return sizeof(*this); } @@ -1673,8 +1673,8 @@ public: const uchar *unpack_key(uchar* to, const uchar *from, uint max_length, bool low_byte_first); int pack_cmp(const uchar *a, const uchar *b, uint key_length, - my_bool insert_or_update); - int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update); + bool insert_or_update); + int pack_cmp(const uchar *b, uint key_length,bool insert_or_update); int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L); int key_cmp(const uchar *,const uchar*); int key_cmp(const uchar *str, uint length); @@ -1859,8 +1859,8 @@ public: const uchar *unpack_key(uchar* to, const uchar *from, uint max_length, bool low_byte_first); int pack_cmp(const uchar *a, const uchar *b, uint key_length, - my_bool insert_or_update); - int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update); + bool insert_or_update); + int pack_cmp(const uchar *b, uint key_length,bool insert_or_update); uint packed_col_length(const uchar *col_ptr, uint length); uint max_packed_col_length(uint max_length); void free() { value.free(); } @@ -2222,7 +2222,7 @@ class Copy_field :public Sql_alloc { public: uchar *from_ptr,*to_ptr; uchar *from_null_ptr,*to_null_ptr; - my_bool *null_row; + bool *null_row; uint from_bit,to_bit; uint from_length,to_length; Field *from_field,*to_field; diff --git a/sql/hash_filo.h b/sql/hash_filo.h index ab13d338695..8ddeeeb02fc 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -107,7 +107,7 @@ public: return entry; } - my_bool add(hash_filo_element *entry) + bool add(hash_filo_element *entry) { if (cache.records == size) { diff --git a/sql/item.cc b/sql/item.cc index 2edeb4c0ee0..ef9a6a3f62b 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -424,8 +424,8 @@ Item::Item(THD *thd, Item *item): with_sum_func(item->with_sum_func), fixed(item->fixed), is_autogenerated_name(item->is_autogenerated_name), - collation(item->collation), with_subselect(item->with_subselect), + collation(item->collation), cmp_context(item->cmp_context) { next= thd->free_list; // Put in free list @@ -2806,7 +2806,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) unsigned_flag= entry->unsigned_flag; if (limit_clause_param) { - my_bool unused; + bool unused; set_int(entry->val_int(&unused), MY_INT64_NUM_DECIMAL_DIGITS); item_type= Item::INT_ITEM; DBUG_RETURN(!unsigned_flag && value.integer < 0 ? 1 : 0); diff --git a/sql/item.h b/sql/item.h index 94a25d7eaea..5921bbbbe71 100644 --- a/sql/item.h +++ b/sql/item.h @@ -536,17 +536,17 @@ public: uint name_length; /* Length of name */ int8 marker; uint8 decimals; - my_bool maybe_null; /* If item may be null */ - my_bool null_value; /* if item is null */ - my_bool unsigned_flag; - my_bool with_sum_func; - my_bool fixed; /* If item fixed with fix_fields */ - my_bool is_autogenerated_name; /* indicate was name of this Item + bool maybe_null; /* If item may be null */ + bool null_value; /* if item is null */ + bool unsigned_flag; + bool with_sum_func; + bool fixed; /* If item fixed with fix_fields */ + bool is_autogenerated_name; /* indicate was name of this Item autogenerated or set by user */ - DTCollation collation; - my_bool with_subselect; /* If this item is a subselect or some + bool with_subselect; /* If this item is a subselect or some of its arguments is or contains a subselect */ + DTCollation collation; Item_result cmp_context; /* Comparison context */ // alloc & destruct is done as start of select using sql_alloc Item(); @@ -2649,7 +2649,7 @@ class Item_int_with_ref :public Item_int { Item *ref; public: - Item_int_with_ref(longlong i, Item *ref_arg, my_bool unsigned_arg) : + Item_int_with_ref(longlong i, Item *ref_arg, bool unsigned_arg) : Item_int(i), ref(ref_arg) { unsigned_flag= unsigned_arg; @@ -2883,7 +2883,7 @@ public: class Cached_item :public Sql_alloc { public: - my_bool null_value; + bool null_value; Cached_item() :null_value(0) {} virtual bool cmp(void)=0; virtual ~Cached_item(); /*line -e1509 */ diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index afde48b56f7..c45d6bef315 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -220,7 +220,7 @@ public: class Item_cache; -#define UNKNOWN ((my_bool)-1) +#define UNKNOWN (-1) /* @@ -249,7 +249,7 @@ protected: FALSE - result is FALSE TRUE - result is NULL */ - my_bool result_for_null_param; + int result_for_null_param; public: Item_in_optimizer(Item *a, Item_in_subselect *b): Item_bool_func(a, my_reinterpret_cast(Item *)(b)), cache(0), @@ -657,7 +657,7 @@ struct interval_range class Item_func_interval :public Item_int_func { Item_row *row; - my_bool use_decimal_comparison; + bool use_decimal_comparison; interval_range *intervals; public: Item_func_interval(Item_row *a) @@ -865,7 +865,7 @@ public: void value_to_item(uint pos, Item *item) { ((Item_int*) item)->value= ((packed_longlong*) base)[pos].val; - ((Item_int*) item)->unsigned_flag= (my_bool) + ((Item_int*) item)->unsigned_flag= (bool) ((packed_longlong*) base)[pos].unsigned_flag; } Item_result result_type() { return INT_RESULT; } diff --git a/sql/item_func.cc b/sql/item_func.cc index 3cb9d4724b9..5c1f40ef666 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3120,11 +3120,15 @@ void Item_udf_func::print(String *str, enum_query_type query_type) double Item_func_udf_float::val_real() { + double res; + my_bool tmp_null_value; DBUG_ASSERT(fixed == 1); DBUG_ENTER("Item_func_udf_float::val"); DBUG_PRINT("info",("result_type: %d arg_count: %d", args[0]->result_type(), arg_count)); - DBUG_RETURN(udf.val(&null_value)); + res= udf.val(&tmp_null_value); + null_value= tmp_null_value; + DBUG_RETURN(res); } @@ -3141,9 +3145,13 @@ String *Item_func_udf_float::val_str(String *str) longlong Item_func_udf_int::val_int() { + longlong res; + my_bool tmp_null_value; DBUG_ASSERT(fixed == 1); DBUG_ENTER("Item_func_udf_int::val_int"); - DBUG_RETURN(udf.val_int(&null_value)); + res= udf.val_int(&tmp_null_value); + null_value= tmp_null_value; + DBUG_RETURN(res); } @@ -3160,8 +3168,10 @@ String *Item_func_udf_int::val_str(String *str) longlong Item_func_udf_decimal::val_int() { - my_decimal dec_buf, *dec= udf.val_decimal(&null_value, &dec_buf); + my_bool tmp_null_value; longlong result; + my_decimal dec_buf, *dec= udf.val_decimal(&tmp_null_value, &dec_buf); + null_value= tmp_null_value; if (null_value) return 0; my_decimal2int(E_DEC_FATAL_ERROR, dec, unsigned_flag, &result); @@ -3171,8 +3181,10 @@ longlong Item_func_udf_decimal::val_int() double Item_func_udf_decimal::val_real() { - my_decimal dec_buf, *dec= udf.val_decimal(&null_value, &dec_buf); + my_bool tmp_null_value; double result; + my_decimal dec_buf, *dec= udf.val_decimal(&tmp_null_value, &dec_buf); + null_value= tmp_null_value; if (null_value) return 0.0; my_decimal2double(E_DEC_FATAL_ERROR, dec, &result); @@ -3182,18 +3194,24 @@ double Item_func_udf_decimal::val_real() my_decimal *Item_func_udf_decimal::val_decimal(my_decimal *dec_buf) { + my_decimal *res; + my_bool tmp_null_value; DBUG_ASSERT(fixed == 1); DBUG_ENTER("Item_func_udf_decimal::val_decimal"); DBUG_PRINT("info",("result_type: %d arg_count: %d", args[0]->result_type(), arg_count)); - DBUG_RETURN(udf.val_decimal(&null_value, dec_buf)); + res= udf.val_decimal(&tmp_null_value, dec_buf); + null_value= tmp_null_value; + DBUG_RETURN(res); } String *Item_func_udf_decimal::val_str(String *str) { - my_decimal dec_buf, *dec= udf.val_decimal(&null_value, &dec_buf); + my_bool tmp_null_value; + my_decimal dec_buf, *dec= udf.val_decimal(&tmp_null_value, &dec_buf); + null_value= tmp_null_value; if (null_value) return 0; if (str->length() < DECIMAL_MAX_STR_LENGTH) @@ -3954,7 +3972,7 @@ Item_func_set_user_var::update_hash(void *ptr, uint length, /** Get the value of a variable as a double. */ -double user_var_entry::val_real(my_bool *null_value) +double user_var_entry::val_real(bool *null_value) { if ((*null_value= (value == 0))) return 0.0; @@ -3983,7 +4001,7 @@ double user_var_entry::val_real(my_bool *null_value) /** Get the value of a variable as an integer. */ -longlong user_var_entry::val_int(my_bool *null_value) const +longlong user_var_entry::val_int(bool *null_value) const { if ((*null_value= (value == 0))) return LL(0); @@ -4015,7 +4033,7 @@ longlong user_var_entry::val_int(my_bool *null_value) const /** Get the value of a variable as a string. */ -String *user_var_entry::val_str(my_bool *null_value, String *str, +String *user_var_entry::val_str(bool *null_value, String *str, uint decimals) { if ((*null_value= (value == 0))) @@ -4048,7 +4066,7 @@ String *user_var_entry::val_str(my_bool *null_value, String *str, /** Get the value of a variable as a decimal. */ -my_decimal *user_var_entry::val_decimal(my_bool *null_value, my_decimal *val) +my_decimal *user_var_entry::val_decimal(bool *null_value, my_decimal *val) { if ((*null_value= (value == 0))) return 0; diff --git a/sql/item_func.h b/sql/item_func.h index b999782274a..8ad952ee85f 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1517,7 +1517,7 @@ class Item_func_get_system_var :public Item_func longlong cached_llval; double cached_dval; String cached_strval; - my_bool cached_null_value; + bool cached_null_value; query_id_t used_query_id; uchar cache_present; diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 6f94a08f1c1..48bfaab4e3a 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -30,7 +30,7 @@ class Item_bool_func2; class Item_subselect :public Item_result_field { - my_bool value_assigned; /* value already assigned to subselect */ + bool value_assigned; /* value already assigned to subselect */ protected: /* thread handler, will be assigned in fix_fields only */ THD *thd; @@ -432,9 +432,9 @@ protected: class subselect_single_select_engine: public subselect_engine { - my_bool prepared; /* simple subselect is prepared */ - my_bool optimized; /* simple subselect is optimized */ - my_bool executed; /* simple subselect is executed */ + bool prepared; /* simple subselect is prepared */ + bool optimized; /* simple subselect is optimized */ + bool executed; /* simple subselect is executed */ st_select_lex *select_lex; /* corresponding select_lex */ JOIN * join; /* corresponding JOIN structure */ public: diff --git a/sql/item_sum.cc b/sql/item_sum.cc index b3b07119066..7604fd98f86 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2637,8 +2637,10 @@ void Item_udf_sum::clear() bool Item_udf_sum::add() { + my_bool tmp_null_value; DBUG_ENTER("Item_udf_sum::add"); - udf.add(&null_value); + udf.add(&tmp_null_value); + null_value= tmp_null_value; DBUG_RETURN(0); } @@ -2674,11 +2676,15 @@ Item *Item_sum_udf_float::copy_or_same(THD* thd) double Item_sum_udf_float::val_real() { + my_bool tmp_null_value; + double res; DBUG_ASSERT(fixed == 1); DBUG_ENTER("Item_sum_udf_float::val"); DBUG_PRINT("info",("result_type: %d arg_count: %d", args[0]->result_type(), arg_count)); - DBUG_RETURN(udf.val(&null_value)); + res= udf.val(&tmp_null_value); + null_value= tmp_null_value; + DBUG_RETURN(res); } @@ -2714,12 +2720,16 @@ longlong Item_sum_udf_decimal::val_int() my_decimal *Item_sum_udf_decimal::val_decimal(my_decimal *dec_buf) { + my_decimal *res; + my_bool tmp_null_value; DBUG_ASSERT(fixed == 1); DBUG_ENTER("Item_func_udf_decimal::val_decimal"); DBUG_PRINT("info",("result_type: %d arg_count: %d", args[0]->result_type(), arg_count)); - DBUG_RETURN(udf.val_decimal(&null_value, dec_buf)); + res= udf.val_decimal(&tmp_null_value, dec_buf); + null_value= tmp_null_value; + DBUG_RETURN(res); } @@ -2736,11 +2746,15 @@ Item *Item_sum_udf_int::copy_or_same(THD* thd) longlong Item_sum_udf_int::val_int() { + my_bool tmp_null_value; + longlong res; DBUG_ASSERT(fixed == 1); DBUG_ENTER("Item_sum_udf_int::val_int"); DBUG_PRINT("info",("result_type: %d arg_count: %d", args[0]->result_type(), arg_count)); - DBUG_RETURN(udf.val_int(&null_value)); + res= udf.val_int(&tmp_null_value); + null_value= tmp_null_value; + DBUG_RETURN(res); } diff --git a/sql/parse_file.h b/sql/parse_file.h index 84647e45927..1e649657c57 100644 --- a/sql/parse_file.h +++ b/sql/parse_file.h @@ -89,12 +89,12 @@ class File_parser: public Sql_alloc { char *buff, *start, *end; LEX_STRING file_type; - my_bool content_ok; + bool content_ok; public: File_parser() :buff(0), start(0), end(0), content_ok(0) { file_type.str= 0; file_type.length= 0; } - my_bool ok() { return content_ok; } + bool ok() { return content_ok; } LEX_STRING *type() { return &file_type; } my_bool parse(uchar* base, MEM_ROOT *mem_root, struct File_option *parameters, uint required, diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h index 023879f84fa..d63432545e5 100644 --- a/sql/rpl_mi.h +++ b/sql/rpl_mi.h @@ -66,10 +66,10 @@ class Master_info : public Slave_reporting_capability char host[HOSTNAME_LENGTH+1]; char user[USERNAME_LENGTH+1]; char password[MAX_PASSWORD_LENGTH+1]; - my_bool ssl; // enables use of SSL connection if true + bool ssl; // enables use of SSL connection if true char ssl_ca[FN_REFLEN], ssl_capath[FN_REFLEN], ssl_cert[FN_REFLEN]; char ssl_cipher[FN_REFLEN], ssl_key[FN_REFLEN]; - my_bool ssl_verify_server_cert; + bool ssl_verify_server_cert; my_off_t master_log_pos; File fd; // we keep the file open, so we need to remember the file pointer diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h index 368a017da21..ecd11453e49 100644 --- a/sql/sp_rcontext.h +++ b/sql/sp_rcontext.h @@ -281,7 +281,7 @@ public: int close(THD *thd); - inline my_bool + inline bool is_open() { return test(server_side_cursor); diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h index 8807b40857e..b72ff62d592 100644 --- a/sql/sql_analyse.h +++ b/sql/sql_analyse.h @@ -71,7 +71,7 @@ class field_info :public Sql_alloc protected: ulong treemem, tree_elements, empty, nulls, min_length, max_length; uint room_in_tree; - my_bool found; + bool found; TREE tree; Item *item; analyse *pc; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 66a4f7694f9..b5998ee3821 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2341,7 +2341,8 @@ bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list, bool link_in) table->tablenr=thd->current_tablenr++; table->used_fields=0; table->const_table=0; - table->null_row= table->maybe_null= 0; + table->null_row= 0; + table->maybe_null= 0; table->force_index= table->force_index_order= table->force_index_group= 0; table->status=STATUS_NO_RECORD; DBUG_RETURN(FALSE); @@ -3007,7 +3008,8 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, table->tablenr=thd->current_tablenr++; table->used_fields=0; table->const_table=0; - table->null_row= table->maybe_null= 0; + table->null_row= 0; + table->maybe_null= 0; table->force_index= table->force_index_order= table->force_index_group= 0; table->status=STATUS_NO_RECORD; table->insert_values= 0; diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h index 58e19c1d1fa..5385acc934f 100644 --- a/sql/sql_bitmap.h +++ b/sql/sql_bitmap.h @@ -60,13 +60,13 @@ public: } void subtract(Bitmap& map2) { bitmap_subtract(&map, &map2.map); } void merge(Bitmap& map2) { bitmap_union(&map, &map2.map); } - my_bool is_set(uint n) const { return bitmap_is_set(&map, n); } - my_bool is_prefix(uint n) const { return bitmap_is_prefix(&map, n); } - my_bool is_clear_all() const { return bitmap_is_clear_all(&map); } - my_bool is_set_all() const { return bitmap_is_set_all(&map); } - my_bool is_subset(const Bitmap& map2) const { return bitmap_is_subset(&map, &map2.map); } - my_bool is_overlapping(const Bitmap& map2) const { return bitmap_is_overlapping(&map, &map2.map); } - my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); } + bool is_set(uint n) const { return bitmap_is_set(&map, n); } + bool is_prefix(uint n) const { return bitmap_is_prefix(&map, n); } + bool is_clear_all() const { return bitmap_is_clear_all(&map); } + bool is_set_all() const { return bitmap_is_set_all(&map); } + bool is_subset(const Bitmap& map2) const { return bitmap_is_subset(&map, &map2.map); } + bool is_overlapping(const Bitmap& map2) const { return bitmap_is_overlapping(&map, &map2.map); } + bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); } char *print(char *buf) const { char *s=buf; @@ -155,13 +155,13 @@ public: void intersect_extended(ulonglong map2) { map&= map2; } void subtract(Bitmap<64>& map2) { map&= ~map2.map; } void merge(Bitmap<64>& map2) { map|= map2.map; } - my_bool is_set(uint n) const { return test(map & (((ulonglong)1) << n)); } - my_bool is_prefix(uint n) const { return map == (((ulonglong)1) << n)-1; } - my_bool is_clear_all() const { return map == (ulonglong)0; } - my_bool is_set_all() const { return map == ~(ulonglong)0; } - my_bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); } - my_bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; } - my_bool operator==(const Bitmap<64>& map2) const { return map == map2.map; } + bool is_set(uint n) const { return test(map & (((ulonglong)1) << n)); } + bool is_prefix(uint n) const { return map == (((ulonglong)1) << n)-1; } + bool is_clear_all() const { return map == (ulonglong)0; } + bool is_set_all() const { return map == ~(ulonglong)0; } + bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); } + bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; } + bool operator==(const Bitmap<64>& map2) const { return map == map2.map; } char *print(char *buf) const { longlong2str(map,buf,16,1); return buf; } ulonglong to_ulonglong() const { return map; } class Iterator : public Table_map_iterator diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 302d5e95a28..45073737f14 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -740,7 +740,7 @@ inline void Query_cache_query::lock_writing() remove it. */ -my_bool Query_cache_query::try_lock_writing() +bool Query_cache_query::try_lock_writing() { DBUG_ENTER("Query_cache_block::try_lock_writing"); if (rw_trywrlock(&lock)!=0) diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 44fc3123b98..91666625a12 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -121,7 +121,7 @@ struct Query_cache_block block_type type; TABLE_COUNTER_TYPE n_tables; // number of tables in query - inline my_bool is_free(void) { return type == FREE; } + inline bool is_free(void) { return type == FREE; } void init(ulong length); void destroy(); inline uint headers_len(); @@ -162,7 +162,7 @@ struct Query_cache_query } void lock_writing(); void lock_reading(); - my_bool try_lock_writing(); + bool try_lock_writing(); void unlock_writing(); void unlock_reading(); }; @@ -312,7 +312,7 @@ protected: uint mem_bin_num, mem_bin_steps; // See at init_cache & find_bin - my_bool initialized; + bool initialized; /* Exclude/include from cyclic double linked list */ static void double_linked_list_exclude(Query_cache_block *point, diff --git a/sql/sql_class.h b/sql/sql_class.h index 2240236a0e5..bba4b779c95 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -295,6 +295,9 @@ struct system_variables When attempting to access a dynamic variable, if the session version is out of date, then the session version is updated and realloced if neccessary and bytes copied from global to make up for missing data. + + Note that one should use my_bool instead of bool here, as the variables + are used with my_getopt.c */ ulong dynamic_variables_version; char* dynamic_variables_ptr; @@ -1887,7 +1890,7 @@ public: bool no_warnings_for_error; /* no warnings on call to my_error() */ /* set during loop of derived table processing */ bool derived_tables_processing; - my_bool tablespace_op; /* This is TRUE in DISCARD/IMPORT TABLESPACE */ + bool tablespace_op; /* This is TRUE in DISCARD/IMPORT TABLESPACE */ sp_rcontext *spcont; // SP runtime context sp_cache *sp_proc_cache; @@ -2958,10 +2961,10 @@ class user_var_entry Item_result type; bool unsigned_flag; - double val_real(my_bool *null_value); - longlong val_int(my_bool *null_value) const; - String *val_str(my_bool *null_value, String *str, uint decimals); - my_decimal *val_decimal(my_bool *null_value, my_decimal *result); + double val_real(bool *null_value); + longlong val_int(bool *null_value) const; + String *val_str(bool *null_value, String *str, uint decimals); + my_decimal *val_decimal(bool *null_value, my_decimal *result); DTCollation collation; }; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index ea138807122..8399cec1a23 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3487,7 +3487,8 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, tmp_table.s->db_low_byte_first= test(create_info->db_type == myisam_hton || create_info->db_type == heap_hton); - tmp_table.null_row=tmp_table.maybe_null=0; + tmp_table.null_row= 0; + tmp_table.maybe_null= 0; while ((item=it++)) { diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 600c140c776..42a97cccc60 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2185,7 +2185,7 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len) lex->prepared_stmt_code.length)) && entry->value) { - my_bool is_var_null; + bool is_var_null; var_value= entry->val_str(&is_var_null, &str, NOT_FIXED_DEC); /* NULL value of variable checked early as entry->value so here diff --git a/sql/table.h b/sql/table.h index 9f6006c9adc..3770334046b 100644 --- a/sql/table.h +++ b/sql/table.h @@ -793,7 +793,7 @@ struct st_table { /* number of select if it is derived table */ uint derived_select_number; int current_lock; /* Type of lock on table */ - my_bool copy_blobs; /* copy_blobs when storing */ + bool copy_blobs; /* copy_blobs when storing */ /* 0 or JOIN_TYPE_{LEFT|RIGHT}. Currently this is only compared to 0. @@ -805,34 +805,34 @@ struct st_table { If true, the current table row is considered to have all columns set to NULL, including columns declared as "not null" (see maybe_null). */ - my_bool null_row; + bool null_row; /* TODO: Each of the following flags take up 8 bits. They can just as easily be put into one single unsigned long and instead of taking up 18 bytes, it would take up 4. */ - my_bool force_index; + bool force_index; /** Flag set when the statement contains FORCE INDEX FOR ORDER BY See TABLE_LIST::process_index_hints(). */ - my_bool force_index_order; + bool force_index_order; /** Flag set when the statement contains FORCE INDEX FOR GROUP BY See TABLE_LIST::process_index_hints(). */ - my_bool force_index_group; - my_bool distinct,const_table,no_rows; + bool force_index_group; + bool distinct,const_table,no_rows; /** If set, the optimizer has found that row retrieval should access index tree only. */ - my_bool key_read; - my_bool no_keyread; + bool key_read; + bool no_keyread; /* Placeholder for an open table which prevents other connections from taking name-locks on this table. Typically used with @@ -850,25 +850,25 @@ struct st_table { object associated with it (db_stat is always 0), but please do not rely on that. */ - my_bool open_placeholder; - my_bool locked_by_logger; - my_bool no_replicate; - my_bool locked_by_name; - my_bool fulltext_searched; - my_bool no_cache; + bool open_placeholder; + bool locked_by_logger; + bool no_replicate; + bool locked_by_name; + bool fulltext_searched; + bool no_cache; /* To signal that the table is associated with a HANDLER statement */ - my_bool open_by_handler; + bool open_by_handler; /* To indicate that a non-null value of the auto_increment field was provided by the user or retrieved from the current record. Used only in the MODE_NO_AUTO_VALUE_ON_ZERO mode. */ - my_bool auto_increment_field_not_null; - my_bool insert_or_update; /* Can be used by the handler */ - my_bool alias_name_used; /* true if table_name is alias */ - my_bool get_fields_in_item_tree; /* Signal to fix_field */ + bool auto_increment_field_not_null; + bool insert_or_update; /* Can be used by the handler */ + bool alias_name_used; /* true if table_name is alias */ + bool get_fields_in_item_tree; /* Signal to fix_field */ /* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */ - my_bool children_attached; + bool children_attached; REGINFO reginfo; /* field connections */ MEM_ROOT mem_root; diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 086cff67dab..061d303c2ec 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -4401,8 +4401,7 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, goto err; } } - share->state.state.data_file_length= share->state.state.data_file_length= - sort_param->filepos; + share->state.state.data_file_length= sort_param->filepos; /* Only whole records */ share->state.version= (ulong) time((time_t*) 0); /* diff --git a/strings/decimal.c b/strings/decimal.c index 631750cf219..a1c02cb68bd 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -346,7 +346,7 @@ int decimal2string(decimal_t *from, char *to, int *to_len, char *s=to; dec1 *buf, *buf0=from->buf, tmp; - DBUG_ASSERT(*to_len >= 2+from->sign); + DBUG_ASSERT(*to_len >= 2+ (int) from->sign); /* removing leading zeroes */ buf0= remove_leading_zeroes(from, &intg); @@ -1801,7 +1801,8 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac); int frac0=max(frac1, frac2), error; - dec1 *buf1, *buf2, *buf0, *stop1, *stop2, *start1, *start2, carry=0; + dec1 *buf1, *buf2, *buf0, *stop1, *stop2, *start1, *start2; + my_bool carry=0; /* let carry:=1 if from2 > from1 */ start1=buf1=from1->buf; stop1=buf1+intg1; @@ -1869,7 +1870,7 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) swap_variables(dec1 *,start1, start2); swap_variables(int,intg1,intg2); swap_variables(int,frac1,frac2); - to->sign= 1 - to->sign; + to->sign= !to->sign; } FIX_INTG_FRAC_ERROR(to->len, intg1, frac0, error); |