diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-11-02 12:55:46 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-11-02 12:55:46 +0100 |
commit | 90b43902b0e67bcd4c6a5f08d7d76c93df74d4c8 (patch) | |
tree | abea3216f5299f3cb53c92e6a79e37daa883b78a /sql | |
parent | 7714adaef85cb7d83b1624db2198aec40ddefa24 (diff) | |
download | mariadb-git-90b43902b0e67bcd4c6a5f08d7d76c93df74d4c8.tar.gz |
compilation warnings on Windows
Diffstat (limited to 'sql')
38 files changed, 176 insertions, 176 deletions
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 53f9727f489..807b5cf603e 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -200,7 +200,7 @@ mysql_event_fill_row(THD *thd, TABLE *table, Event_parse_data *et, sp_head *sp, - ulong sql_mode, + ulonglong sql_mode, my_bool is_update) { CHARSET_INFO *scs= system_charset_info; @@ -651,7 +651,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data, int ret= 1; TABLE *table= NULL; sp_head *sp= thd->lex->sphead; - ulong saved_mode= thd->variables.sql_mode; + ulonglong saved_mode= thd->variables.sql_mode; /* Take a savepoint to release only the lock on mysql.event table at the end but keep the global read lock and @@ -768,7 +768,7 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data, CHARSET_INFO *scs= system_charset_info; TABLE *table= NULL; sp_head *sp= thd->lex->sphead; - ulong saved_mode= thd->variables.sql_mode; + ulonglong saved_mode= thd->variables.sql_mode; /* Take a savepoint to release only the lock on mysql.event table at the end but keep the global read lock and @@ -1052,7 +1052,7 @@ Event_db_repository::load_named_event(THD *thd, LEX_STRING dbname, LEX_STRING name, Event_basic *etn) { bool ret; - ulong saved_mode= thd->variables.sql_mode; + ulonglong saved_mode= thd->variables.sql_mode; Open_tables_backup open_tables_backup; TABLE_LIST event_table; diff --git a/sql/field.cc b/sql/field.cc index bf4cb3e4ff9..bdbf48751bb 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1759,7 +1759,7 @@ uint Field::fill_cache_field(CACHE_FIELD *copy) } -bool Field::get_date(MYSQL_TIME *ltime,uint fuzzydate) +bool Field::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) { char buff[40]; String tmp(buff,sizeof(buff),&my_charset_bin),*res; @@ -4251,7 +4251,7 @@ my_decimal *Field_real::val_decimal(my_decimal *decimal_value) } -bool Field_real::get_date(MYSQL_TIME *ltime,uint fuzzydate) +bool Field_real::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) { ASSERT_COLUMN_MARKED_FOR_READ; double nr= val_real(); @@ -4637,7 +4637,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) } -bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate) +bool Field_timestamp::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { THD *thd= table->in_use; thd->time_zone_used= 1; @@ -5182,7 +5182,7 @@ String *Field_time::val_str(String *val_buffer, DATE_FORMAT(time, "%l.%i %p") */ -bool Field_time::get_date(MYSQL_TIME *ltime, uint fuzzydate) +bool Field_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { THD *thd= table->in_use; if (!(fuzzydate & (TIME_FUZZY_DATE|TIME_TIME_ONLY))) @@ -5300,7 +5300,7 @@ String *Field_time_hires::val_str(String *str, return str; } -bool Field_time_hires::get_date(MYSQL_TIME *ltime, uint fuzzydate) +bool Field_time_hires::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { uint32 len= pack_length(); longlong packed= read_bigendian(ptr, len); @@ -5480,7 +5480,7 @@ String *Field_year::val_str(String *val_buffer, } -bool Field_year::get_date(MYSQL_TIME *ltime,uint fuzzydate) +bool Field_year::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) { int tmp= (int) ptr[0]; if (tmp || field_length != 4) @@ -5651,7 +5651,7 @@ String *Field_newdate::val_str(String *val_buffer, } -bool Field_newdate::get_date(MYSQL_TIME *ltime,uint fuzzydate) +bool Field_newdate::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) { uint32 tmp=(uint32) uint3korr(ptr); ltime->day= tmp & 31; @@ -5771,7 +5771,7 @@ String *Field_datetime::val_str(String *val_buffer, return val_buffer; } -bool Field_datetime::get_date(MYSQL_TIME *ltime, uint fuzzydate) +bool Field_datetime::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { longlong tmp=Field_datetime::val_int(); uint32 part1,part2; @@ -5887,7 +5887,7 @@ String *Field_datetime_hires::val_str(String *str, return str; } -bool Field_datetime_hires::get_date(MYSQL_TIME *ltime, uint fuzzydate) +bool Field_datetime_hires::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { ulonglong packed= read_bigendian(ptr, Field_datetime_hires::pack_length()); unpack_time(sec_part_unshift(packed, dec), ltime); diff --git a/sql/field.h b/sql/field.h index 728eb6f3f49..f685bac11ad 100644 --- a/sql/field.h +++ b/sql/field.h @@ -526,7 +526,7 @@ public: } void copy_from_tmp(int offset); uint fill_cache_field(struct st_cache_field *copy); - virtual bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + virtual bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); bool get_time(MYSQL_TIME *ltime) { return get_date(ltime, TIME_TIME_ONLY); } virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; } virtual CHARSET_INFO *charset_for_protocol(void) const @@ -792,7 +792,7 @@ public: Item_result result_type () const { return REAL_RESULT; } int store_decimal(const my_decimal *); int store_time_dec(MYSQL_TIME *ltime, uint dec); - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); my_decimal *val_decimal(my_decimal *); uint32 max_display_length() { return field_length; } uint size_of() const { return sizeof(*this); } @@ -1257,7 +1257,7 @@ public: { int4store(ptr,timestamp); } - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); timestamp_auto_set_type get_auto_set_type() const; uchar *pack(uchar *to, const uchar *from, uint max_length __attribute__((unused))) @@ -1327,7 +1327,7 @@ public: double val_real(void); longlong val_int(void); String *val_str(String*,String *); - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); bool send_binary(Protocol *protocol); uint32 max_display_length() { return field_length; } void sql_type(String &str) const; @@ -1420,7 +1420,7 @@ public: uint32 pack_length() const { return 3; } void sql_type(String &str) const; bool zero_pack() const { return 1; } - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); }; @@ -1443,7 +1443,7 @@ public: double val_real(void); longlong val_int(void); String *val_str(String*,String *); - bool get_date(MYSQL_TIME *ltime, uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); bool send_binary(Protocol *protocol); int cmp(const uchar *,const uchar *); void sort_string(uchar *buff,uint length); @@ -1476,7 +1476,7 @@ public: double val_real(void); String *val_str(String*,String *); int reset(void); - bool get_date(MYSQL_TIME *ltime, uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); bool send_binary(Protocol *protocol); int cmp(const uchar *,const uchar *); void sort_string(uchar *buff,uint length); @@ -1507,7 +1507,7 @@ public: uint32 pack_length() const { return 8; } void sql_type(String &str) const; bool zero_pack() const { return 1; } - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); uchar *pack(uchar* to, const uchar *from, uint max_length __attribute__((unused))) { @@ -1548,7 +1548,7 @@ public: void sort_string(uchar *buff,uint length); uint32 pack_length() const; void sql_type(String &str) const; - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); uchar *pack(uchar *to, const uchar *from, uint max_length) { return Field::pack(to, from, max_length); } const uchar *unpack(uchar* to, const uchar *from, uint param_data) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index c5540976f93..eefc24c3103 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3323,7 +3323,7 @@ int ha_partition::write_row(uchar * buf) my_bitmap_map *old_map; THD *thd= ha_thd(); timestamp_auto_set_type saved_timestamp_type= table->timestamp_field_type; - ulong saved_sql_mode= thd->variables.sql_mode; + ulonglong saved_sql_mode= thd->variables.sql_mode; bool saved_auto_inc_field_not_null= table->auto_increment_field_not_null; #ifdef NOT_NEEDED uchar *rec0= m_rec0; diff --git a/sql/handler.cc b/sql/handler.cc index 1aeb818b65d..7fc5aea48fa 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4084,9 +4084,9 @@ int ha_init_key_cache(const char *name, KEY_CACHE *key_cache, void *unused mysql_mutex_lock(&LOCK_global_system_variables); size_t tmp_buff_size= (size_t) key_cache->param_buff_size; uint tmp_block_size= (uint) key_cache->param_block_size; - uint division_limit= key_cache->param_division_limit; - uint age_threshold= key_cache->param_age_threshold; - uint partitions= key_cache->param_partitions; + uint division_limit= (uint)key_cache->param_division_limit; + uint age_threshold= (uint)key_cache->param_age_threshold; + uint partitions= (uint)key_cache->param_partitions; mysql_mutex_unlock(&LOCK_global_system_variables); DBUG_RETURN(!init_key_cache(key_cache, tmp_block_size, @@ -4110,8 +4110,8 @@ int ha_resize_key_cache(KEY_CACHE *key_cache) mysql_mutex_lock(&LOCK_global_system_variables); size_t tmp_buff_size= (size_t) key_cache->param_buff_size; long tmp_block_size= (long) key_cache->param_block_size; - uint division_limit= key_cache->param_division_limit; - uint age_threshold= key_cache->param_age_threshold; + uint division_limit= (uint)key_cache->param_division_limit; + uint age_threshold= (uint)key_cache->param_age_threshold; mysql_mutex_unlock(&LOCK_global_system_variables); DBUG_RETURN(!resize_key_cache(key_cache, tmp_block_size, tmp_buff_size, @@ -4131,8 +4131,8 @@ int ha_change_key_cache_param(KEY_CACHE *key_cache) if (key_cache->key_cache_inited) { mysql_mutex_lock(&LOCK_global_system_variables); - uint division_limit= key_cache->param_division_limit; - uint age_threshold= key_cache->param_age_threshold; + uint division_limit= (uint)key_cache->param_division_limit; + uint age_threshold= (uint)key_cache->param_age_threshold; mysql_mutex_unlock(&LOCK_global_system_variables); change_key_cache_param(key_cache, division_limit, age_threshold); } @@ -4152,9 +4152,9 @@ int ha_repartition_key_cache(KEY_CACHE *key_cache) mysql_mutex_lock(&LOCK_global_system_variables); size_t tmp_buff_size= (size_t) key_cache->param_buff_size; long tmp_block_size= (long) key_cache->param_block_size; - uint division_limit= key_cache->param_division_limit; - uint age_threshold= key_cache->param_age_threshold; - uint partitions= key_cache->param_partitions; + uint division_limit= (uint)key_cache->param_division_limit; + uint age_threshold= (uint)key_cache->param_age_threshold; + uint partitions= (uint)key_cache->param_partitions; mysql_mutex_unlock(&LOCK_global_system_variables); DBUG_RETURN(!repartition_key_cache(key_cache, tmp_block_size, tmp_buff_size, diff --git a/sql/item.cc b/sql/item.cc index 0d4b25f4440..f443ca7ec18 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1181,7 +1181,7 @@ bool Item_string::eq(const Item *item, bool binary_cmp) const As a extra convenience the time structure is reset on error or NULL values! */ -bool Item::get_date(MYSQL_TIME *ltime,uint fuzzydate) +bool Item::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) { if (field_type() == MYSQL_TYPE_TIME) fuzzydate|= TIME_TIME_ONLY; @@ -2467,7 +2467,7 @@ String *Item_field::str_result(String *str) return result_field->val_str(str,&str_value); } -bool Item_field::get_date(MYSQL_TIME *ltime,uint fuzzydate) +bool Item_field::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) { if ((null_value=field->is_null()) || field->get_date(ltime,fuzzydate)) { @@ -2477,7 +2477,7 @@ bool Item_field::get_date(MYSQL_TIME *ltime,uint fuzzydate) return 0; } -bool Item_field::get_date_result(MYSQL_TIME *ltime,uint fuzzydate) +bool Item_field::get_date_result(MYSQL_TIME *ltime, ulonglong fuzzydate) { if (result_field->is_null() || result_field->get_date(ltime,fuzzydate)) { @@ -3395,7 +3395,7 @@ int Item_param::save_in_field(Field *field, bool no_conversions) } -bool Item_param::get_date(MYSQL_TIME *res, uint fuzzydate) +bool Item_param::get_date(MYSQL_TIME *res, ulonglong fuzzydate) { if (state == TIME_VALUE) { @@ -4217,7 +4217,7 @@ String* Item_ref_null_helper::val_str(String* s) } -bool Item_ref_null_helper::get_date(MYSQL_TIME *ltime, uint fuzzydate) +bool Item_ref_null_helper::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { return (owner->was_null|= null_value= (*ref)->get_date(ltime, fuzzydate)); } @@ -7176,7 +7176,7 @@ bool Item_ref::is_null() } -bool Item_ref::get_date(MYSQL_TIME *ltime,uint fuzzydate) +bool Item_ref::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) { return (null_value=(*ref)->get_date_result(ltime,fuzzydate)); } @@ -7313,7 +7313,7 @@ bool Item_direct_ref::is_null() } -bool Item_direct_ref::get_date(MYSQL_TIME *ltime,uint fuzzydate) +bool Item_direct_ref::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) { return (null_value=(*ref)->get_date(ltime,fuzzydate)); } @@ -7675,7 +7675,7 @@ bool Item_cache_wrapper::is_null() Get the date value of the possibly cached item */ -bool Item_cache_wrapper::get_date(MYSQL_TIME *ltime, uint fuzzydate) +bool Item_cache_wrapper::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { Item *cached_value; DBUG_ENTER("Item_cache_wrapper::get_date"); @@ -8734,7 +8734,7 @@ bool Item_cache_temporal::cache_value() } -bool Item_cache_temporal::get_date(MYSQL_TIME *ltime, uint fuzzydate) +bool Item_cache_temporal::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { ErrConvInteger str(value); diff --git a/sql/item.h b/sql/item.h index cda2ab73c4a..c3bdc5042c8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1021,11 +1021,11 @@ public: /* Called for items that really have to be split */ void split_sum_func2(THD *thd, Item **ref_pointer_array, List<Item> &fields, Item **ref, bool skip_registered); - virtual bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + virtual bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); bool get_time(MYSQL_TIME *ltime) { return get_date(ltime, TIME_TIME_ONLY | TIME_FUZZY_DATE); } bool get_seconds(ulonglong *sec, ulong *sec_part); - virtual bool get_date_result(MYSQL_TIME *ltime,uint fuzzydate) + virtual bool get_date_result(MYSQL_TIME *ltime, ulonglong fuzzydate) { return get_date(ltime,fuzzydate); } /* The method allows to determine nullness of a complex expression @@ -2018,8 +2018,8 @@ public: longlong val_int_endpoint(bool left_endp, bool *incl_endp); Field *get_tmp_table_field() { return result_field; } Field *tmp_table_field(TABLE *t_arg) { return result_field; } - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); - bool get_date_result(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); + bool get_date_result(MYSQL_TIME *ltime,ulonglong fuzzydate); bool is_null() { return field->is_null(); } void update_null_value(); Item *get_tmp_table_item(THD *thd); @@ -2201,7 +2201,7 @@ public: longlong val_int(); my_decimal *val_decimal(my_decimal*); String *val_str(String*); - bool get_date(MYSQL_TIME *tm, uint fuzzydate); + bool get_date(MYSQL_TIME *tm, ulonglong fuzzydate); int save_in_field(Field *field, bool no_conversions); void set_null(); @@ -2817,7 +2817,7 @@ public: bool val_bool(); String *val_str(String* tmp); bool is_null(); - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); double val_result(); longlong val_int_result(); String *str_result(String* tmp); @@ -2953,7 +2953,7 @@ public: my_decimal *val_decimal(my_decimal *); bool val_bool(); bool is_null(); - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); virtual Ref_Type ref_type() { return DIRECT_REF; } }; @@ -3041,7 +3041,7 @@ public: my_decimal *val_decimal(my_decimal *); bool val_bool(); bool is_null(); - bool get_date(MYSQL_TIME *ltime, uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); bool send(Protocol *protocol, String *buffer); void save_org_in_field(Field *field) { @@ -3253,7 +3253,7 @@ public: String* val_str(String* s); my_decimal *val_decimal(my_decimal *); bool val_bool(); - bool get_date(MYSQL_TIME *ltime, uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); virtual void print(String *str, enum_query_type query_type); table_map used_tables() const; }; @@ -3877,7 +3877,7 @@ public: Item_cache_temporal(enum_field_types field_type_arg); String* val_str(String *str); bool cache_value(); - bool get_date(MYSQL_TIME *ltime, uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); int save_in_field(Field *field, bool no_conversions); void store_packed(longlong val_arg); /* diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c0d3b14b71b..aa11a2ae8eb 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -3141,7 +3141,7 @@ double Item_func_coalesce::real_op() } -bool Item_func_coalesce::get_date(MYSQL_TIME *ltime,uint fuzzydate) +bool Item_func_coalesce::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) { DBUG_ASSERT(fixed == 1); null_value= 0; diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 67035384cf7..ef12364ae68 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -744,7 +744,7 @@ public: const char *func_name() const { return "coalesce"; } table_map not_null_tables() const { return 0; } enum_field_types field_type() const { return cached_field_type; } - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); }; diff --git a/sql/item_func.cc b/sql/item_func.cc index bbfa3b74c5e..c9d3a506c94 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2725,7 +2725,7 @@ void Item_func_min_max::fix_length_and_dec() 0 Otherwise */ -bool Item_func_min_max::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_func_min_max::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { longlong UNINIT_VAR(min_max); DBUG_ASSERT(fixed == 1); diff --git a/sql/item_func.h b/sql/item_func.h index 5477c27b13d..8e9fbd9af5c 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -970,7 +970,7 @@ public: longlong val_int(); String *val_str(String *); my_decimal *val_decimal(my_decimal *); - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); void fix_length_and_dec(); enum Item_result result_type () const { return cmp_type; } enum_field_types field_type() const { return cached_field_type; } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index a0e5b42767f..27b4a46ce34 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -4399,7 +4399,7 @@ null: } -bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { DYNAMIC_COLUMN_VALUE val; char buff[STRING_BUFFER_USUAL_SIZE]; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index b15179e641b..69800e7e674 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -1025,7 +1025,7 @@ public: double val_real(); my_decimal *val_decimal(my_decimal *); bool get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp); - bool get_date(MYSQL_TIME *ltime,uint fuzzydate); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); void print(String *str, enum_query_type query_type); }; diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 2bda3bbab00..79e792281d3 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -105,7 +105,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, timestamp_type cached_timestamp_type, const char **sub_pattern_end, const char *date_time_type, - uint fuzzy_date) + ulonglong fuzzy_date) { int weekday= 0, yearday= 0, daypart= 0; int week_number= -1; @@ -1499,7 +1499,7 @@ double Item_temporal_func::val_real() } -bool Item_func_from_days::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_func_from_days::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { longlong value=args[0]->val_int(); if (args[0]->null_value) @@ -1557,7 +1557,7 @@ void Item_func_curdate_utc::store_now_in_TIME(MYSQL_TIME *now_time) bool Item_func_curdate::get_date(MYSQL_TIME *res, - uint fuzzy_date __attribute__((unused))) + ulonglong fuzzy_date __attribute__((unused))) { *res=ltime; return 0; @@ -1576,7 +1576,7 @@ bool Item_func_curtime::fix_fields(THD *thd, Item **items) } bool Item_func_curtime::get_date(MYSQL_TIME *res, - uint fuzzy_date __attribute__((unused))) + ulonglong fuzzy_date __attribute__((unused))) { *res= ltime; return 0; @@ -1667,7 +1667,7 @@ void Item_func_now_utc::store_now_in_TIME(MYSQL_TIME *now_time) bool Item_func_now::get_date(MYSQL_TIME *res, - uint fuzzy_date __attribute__((unused))) + ulonglong fuzzy_date __attribute__((unused))) { *res= ltime; return 0; @@ -1689,13 +1689,13 @@ void Item_func_sysdate_local::store_now_in_TIME(MYSQL_TIME *now_time) bool Item_func_sysdate_local::get_date(MYSQL_TIME *res, - uint fuzzy_date __attribute__((unused))) + ulonglong fuzzy_date __attribute__((unused))) { store_now_in_TIME(res); return 0; } -bool Item_func_sec_to_time::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_func_sec_to_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { DBUG_ASSERT(fixed == 1); bool sign; @@ -1922,7 +1922,7 @@ void Item_func_from_unixtime::fix_length_and_dec() bool Item_func_from_unixtime::get_date(MYSQL_TIME *ltime, - uint fuzzy_date __attribute__((unused))) + ulonglong fuzzy_date __attribute__((unused))) { bool sign; ulonglong sec; @@ -1952,7 +1952,7 @@ void Item_func_convert_tz::fix_length_and_dec() bool Item_func_convert_tz::get_date(MYSQL_TIME *ltime, - uint fuzzy_date __attribute__((unused))) + ulonglong fuzzy_date __attribute__((unused))) { my_time_t my_time_tmp; String str; @@ -2045,7 +2045,7 @@ void Item_date_add_interval::fix_length_and_dec() /* Here arg[1] is a Item_interval object */ -bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { INTERVAL interval; @@ -2411,7 +2411,7 @@ void Item_char_typecast::fix_length_and_dec() } -bool Item_time_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_time_typecast::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { if (get_arg0_time(ltime)) return 1; @@ -2428,7 +2428,7 @@ bool Item_time_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) } -bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_date_typecast::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { if (get_arg0_date(ltime, TIME_FUZZY_DATE)) return 1; @@ -2449,7 +2449,7 @@ bool Item_date_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) } -bool Item_datetime_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_datetime_typecast::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { if (get_arg0_date(ltime, fuzzy_date & ~TIME_TIME_ONLY)) return 1; @@ -2494,7 +2494,7 @@ bool Item_datetime_typecast::get_date(MYSQL_TIME *ltime, uint fuzzy_date) 0099-12-31 */ -bool Item_func_makedate::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_func_makedate::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { DBUG_ASSERT(fixed == 1); long daynr= (long) args[1]->val_int(); @@ -2559,7 +2559,7 @@ void Item_func_add_time::fix_length_and_dec() Result: Time value or datetime value */ -bool Item_func_add_time::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_func_add_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { DBUG_ASSERT(fixed == 1); MYSQL_TIME l_time1, l_time2; @@ -2664,7 +2664,7 @@ void Item_func_add_time::print(String *str, enum_query_type query_type) Result: Time value */ -bool Item_func_timediff::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_func_timediff::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { DBUG_ASSERT(fixed == 1); longlong seconds; @@ -2727,7 +2727,7 @@ bool Item_func_timediff::get_date(MYSQL_TIME *ltime, uint fuzzy_date) Result: Time value */ -bool Item_func_maketime::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_func_maketime::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { DBUG_ASSERT(fixed == 1); bool overflow= 0; @@ -3110,7 +3110,7 @@ void Item_func_str_to_date::fix_length_and_dec() } -bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { DATE_TIME_FORMAT date_time_format; char val_buff[64], format_buff[64]; @@ -3143,7 +3143,7 @@ bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date) } -bool Item_func_last_day::get_date(MYSQL_TIME *ltime, uint fuzzy_date) +bool Item_func_last_day::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE) || (ltime->month == 0)) diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 239f7e92bba..d9e58857c9d 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -498,7 +498,7 @@ public: String *val_str(String *str); longlong val_int(); double val_real(); - bool get_date(MYSQL_TIME *res, uint fuzzy_date) { DBUG_ASSERT(0); return 1; } + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date) { DBUG_ASSERT(0); return 1; } my_decimal *val_decimal(my_decimal *decimal_value) { return val_decimal_from_date(decimal_value); } Field *tmp_table_field(TABLE *table) @@ -543,7 +543,7 @@ public: Item_timefunc::fix_length_and_dec(); maybe_null= false; } - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); /* Abstract method that defines which time zone is used for conversion. Converts time current time in my_time_t representation to broken-down @@ -583,7 +583,7 @@ class Item_func_curdate :public Item_datefunc public: Item_func_curdate() :Item_datefunc() {} void fix_length_and_dec(); - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0; bool check_vcol_func_processor(uchar *int_arg) { @@ -625,7 +625,7 @@ public: Item_temporal_func::fix_length_and_dec(); maybe_null= false; } - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); virtual void store_now_in_TIME(MYSQL_TIME *now_time)=0; bool check_vcol_func_processor(uchar *int_arg) { @@ -664,7 +664,7 @@ public: bool const_item() const { return 0; } const char *func_name() const { return "sysdate"; } void store_now_in_TIME(MYSQL_TIME *now_time); - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); void update_used_tables() { Item_func_now::update_used_tables(); @@ -679,7 +679,7 @@ class Item_func_from_days :public Item_datefunc public: Item_func_from_days(Item *a) :Item_datefunc(a) {} const char *func_name() const { return "from_days"; } - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); bool check_partition_func_processor(uchar *int_arg) {return FALSE;} bool check_vcol_func_processor(uchar *int_arg) { return FALSE;} bool check_valid_arguments_processor(uchar *int_arg) @@ -713,7 +713,7 @@ class Item_func_from_unixtime :public Item_temporal_func Item_func_from_unixtime(Item *a) :Item_temporal_func(a) {} const char *func_name() const { return "from_unixtime"; } void fix_length_and_dec(); - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); }; @@ -746,7 +746,7 @@ class Item_func_convert_tz :public Item_temporal_func Item_temporal_func(a, b, c), from_tz_cached(0), to_tz_cached(0) {} const char *func_name() const { return "convert_tz"; } void fix_length_and_dec(); - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); void cleanup(); }; @@ -755,7 +755,7 @@ class Item_func_sec_to_time :public Item_timefunc { public: Item_func_sec_to_time(Item *item) :Item_timefunc(item) {} - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); void fix_length_and_dec() { decimals= args[0]->decimals; @@ -776,7 +776,7 @@ public: const char *func_name() const { return "date_add_interval"; } void fix_length_and_dec(); enum_field_types field_type() const { return cached_field_type; } - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); bool eq(const Item *item, bool binary_cmp) const; void print(String *str, enum_query_type query_type); }; @@ -873,7 +873,7 @@ class Item_date_typecast :public Item_temporal_typecast public: Item_date_typecast(Item *a) :Item_temporal_typecast(a) {} const char *func_name() const { return "cast_as_date"; } - bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date); const char *cast_type() const { return "date"; } enum_field_types field_type() const { return MYSQL_TYPE_DATE; } }; @@ -885,7 +885,7 @@ public: Item_time_typecast(Item *a, uint dec_arg) :Item_temporal_typecast(a) { decimals= dec_arg; } const char *func_name() const { return "cast_as_time"; } - bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date); const char *cast_type() const { return "time"; } enum_field_types field_type() const { return MYSQL_TYPE_TIME; } }; @@ -899,7 +899,7 @@ public: const char *func_name() const { return "cast_as_datetime"; } const char *cast_type() const { return "datetime"; } enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } - bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date); }; @@ -909,7 +909,7 @@ public: Item_func_makedate(Item *a,Item *b) :Item_temporal_func(a,b) {} const char *func_name() const { return "makedate"; } enum_field_types field_type() const { return MYSQL_TYPE_DATE; } - bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date); }; @@ -924,7 +924,7 @@ public: :Item_temporal_func(a, b), is_date(type_arg) { sign= neg_arg ? -1 : 1; } enum_field_types field_type() const { return cached_field_type; } void fix_length_and_dec(); - bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date); void print(String *str, enum_query_type query_type); const char *func_name() const { return "add_time"; } }; @@ -940,7 +940,7 @@ public: decimals= max(args[0]->decimals, args[1]->decimals); Item_timefunc::fix_length_and_dec(); } - bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date); }; class Item_func_maketime :public Item_timefunc @@ -950,7 +950,7 @@ public: :Item_timefunc(a, b, c) {} const char *func_name() const { return "maketime"; } - bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date); }; @@ -1024,7 +1024,7 @@ public: Item_func_str_to_date(Item *a, Item *b) :Item_temporal_func(a, b), const_item(false) {} - bool get_date(MYSQL_TIME *ltime, uint fuzzy_date); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date); const char *func_name() const { return "str_to_date"; } enum_field_types field_type() const { return cached_field_type; } void fix_length_and_dec(); @@ -1036,7 +1036,7 @@ class Item_func_last_day :public Item_datefunc public: Item_func_last_day(Item *a) :Item_datefunc(a) {} const char *func_name() const { return "last_day"; } - bool get_date(MYSQL_TIME *res, uint fuzzy_date); + bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date); }; diff --git a/sql/log.cc b/sql/log.cc index 133ea907ea0..d7d7bf0f7b7 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1334,7 +1334,7 @@ bool LOGGER::general_log_print(THD *thd, enum enum_server_command command, return general_log_write(thd, command, message_buff, message_buff_len); } -void LOGGER::init_error_log(uint error_log_printer) +void LOGGER::init_error_log(ulonglong error_log_printer) { if (error_log_printer & LOG_NONE) { @@ -1357,7 +1357,7 @@ void LOGGER::init_error_log(uint error_log_printer) } } -void LOGGER::init_slow_log(uint slow_log_printer) +void LOGGER::init_slow_log(ulonglong slow_log_printer) { if (slow_log_printer & LOG_NONE) { @@ -1382,7 +1382,7 @@ void LOGGER::init_slow_log(uint slow_log_printer) } } -void LOGGER::init_general_log(uint general_log_printer) +void LOGGER::init_general_log(ulonglong general_log_printer) { if (general_log_printer & LOG_NONE) { @@ -1495,9 +1495,9 @@ bool Log_to_csv_event_handler::init() return 0; } -int LOGGER::set_handlers(uint error_log_printer, - uint slow_log_printer, - uint general_log_printer) +int LOGGER::set_handlers(ulonglong error_log_printer, + ulonglong slow_log_printer, + ulonglong general_log_printer) { /* error log table is not supported yet */ DBUG_ASSERT(error_log_printer < LOG_TABLE); diff --git a/sql/log.h b/sql/log.h index c85e643d4e9..3ec7ee96a12 100644 --- a/sql/log.h +++ b/sql/log.h @@ -818,12 +818,12 @@ public: const char *query, uint query_length); /* we use this function to setup all enabled log event handlers */ - int set_handlers(uint error_log_printer, - uint slow_log_printer, - uint general_log_printer); - void init_error_log(uint error_log_printer); - void init_slow_log(uint slow_log_printer); - void init_general_log(uint general_log_printer); + int set_handlers(ulonglong error_log_printer, + ulonglong slow_log_printer, + ulonglong general_log_printer); + void init_error_log(ulonglong error_log_printer); + void init_slow_log(ulonglong slow_log_printer); + void init_general_log(ulonglong general_log_printer); void deactivate_log_handler(THD* thd, uint log_type); bool activate_log_handler(THD* thd, uint log_type); MYSQL_QUERY_LOG *get_slow_log_file_handler() const diff --git a/sql/log_event.cc b/sql/log_event.cc index 49383778b58..c9e92cc264b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2875,7 +2875,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, else cache_type= Log_event::EVENT_STMT_CACHE; DBUG_ASSERT(cache_type != Log_event::EVENT_INVALID_CACHE); - DBUG_PRINT("info",("Query_log_event has flags2: %lu sql_mode: %lu", + DBUG_PRINT("info",("Query_log_event has flags2: %lu sql_mode: %llu", (ulong) flags2, sql_mode)); } #endif /* MYSQL_CLIENT */ @@ -8222,7 +8222,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) Don't allow generation of auto_increment value when processing rows event by setting 'MODE_NO_AUTO_VALUE_ON_ZERO'. */ - ulong saved_sql_mode= thd->variables.sql_mode; + ulonglong saved_sql_mode= thd->variables.sql_mode; thd->variables.sql_mode= MODE_NO_AUTO_VALUE_ON_ZERO; // row processing loop diff --git a/sql/log_event.h b/sql/log_event.h index 48c781a04fb..be83995f331 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -690,7 +690,7 @@ typedef struct st_print_event_info bool flags2_inited; uint32 flags2; bool sql_mode_inited; - ulong sql_mode; /* must be same as THD.variables.sql_mode */ + ulonglong sql_mode; /* must be same as THD.variables.sql_mode */ ulong auto_increment_increment, auto_increment_offset; bool charset_inited; char charset[6]; // 3 variables, each of them storable in 2 bytes @@ -1754,7 +1754,7 @@ public: uint32 flags2; /* In connections sql_mode is 32 bits now but will be 64 bits soon */ - ulong sql_mode; + ulonglong sql_mode; ulong auto_increment_increment, auto_increment_offset; char charset[6]; uint time_zone_len; /* 0 means uninited */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b2b066230bc..6d90c2e88b8 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -474,9 +474,9 @@ ulong slave_exec_mode_options; ulonglong slave_type_conversions_options; ulong thread_cache_size=0; ulong binlog_cache_size=0; -ulonglong max_binlog_cache_size=0; +ulong max_binlog_cache_size=0; ulong binlog_stmt_cache_size=0; -ulonglong max_binlog_stmt_cache_size=0; +ulong max_binlog_stmt_cache_size=0; ulong query_cache_size=0; ulong refresh_version; /* Increments on each reload */ query_id_t global_query_id; @@ -2209,7 +2209,7 @@ static void network_init(void) extra_ip_sock= activate_tcp_port(mysqld_extra_port); } -#ifdef __NT__ +#ifdef _WIN32 /* create named pipe */ if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap && opt_enable_named_pipe) @@ -5106,6 +5106,7 @@ int mysqld_main(int argc, char **argv) } #endif mysqld_exit(0); + return 0; } #endif /* !EMBEDDED_LIBRARY */ diff --git a/sql/mysqld.h b/sql/mysqld.h index 281082e2d7e..cd3d7c37b37 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -166,7 +166,7 @@ extern ulong what_to_log,flush_time; extern ulong max_prepared_stmt_count, prepared_stmt_count; extern ulong open_files_limit; extern ulong binlog_cache_size, binlog_stmt_cache_size; -extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size; +extern ulong max_binlog_cache_size, max_binlog_stmt_cache_size; extern ulong max_binlog_size, max_relay_log_size; extern ulong opt_binlog_rows_event_max_size; extern ulong rpl_recovery_rank, thread_cache_size; diff --git a/sql/partition_info.cc b/sql/partition_info.cc index baea5c2c086..98b8e79dc6d 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -2088,7 +2088,7 @@ bool partition_info::fix_column_value_functions(THD *thd, { uchar *val_ptr; uint len= field->pack_length(); - ulong save_sql_mode; + ulonglong save_sql_mode; bool save_got_warning; if (!(column_item= get_column_item(column_item, diff --git a/sql/set_var.h b/sql/set_var.h index d34b1db8b71..2c345f3af5f 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -305,8 +305,8 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list); bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type); -ulong expand_sql_mode(ulonglong sql_mode); -bool sql_mode_string_representation(THD *thd, ulong sql_mode, LEX_STRING *ls); +ulonglong expand_sql_mode(ulonglong sql_mode); +bool sql_mode_string_representation(THD *thd, ulonglong sql_mode, LEX_STRING *ls); extern sys_var *Sys_autocommit_ptr; diff --git a/sql/sp.cc b/sql/sp.cc index 6071a60a64f..24f7ed4ba90 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -42,11 +42,11 @@ create_string(THD *thd, String *buf, st_sp_chistics *chistics, const LEX_STRING *definer_user, const LEX_STRING *definer_host, - ulong sql_mode); + ulonglong sql_mode); static int db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp, - ulong sql_mode, const char *params, const char *returns, + ulonglong sql_mode, const char *params, const char *returns, const char *body, st_sp_chistics &chistics, const char *definer, longlong created, longlong modified, Stored_program_creation_ctx *creation_ctx); @@ -541,7 +541,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp) char buff[65]; String str(buff, sizeof(buff), &my_charset_bin); bool saved_time_zone_used= thd->time_zone_used; - ulong sql_mode, saved_mode= thd->variables.sql_mode; + ulonglong sql_mode, saved_mode= thd->variables.sql_mode; Open_tables_backup open_tables_state_backup; Stored_program_creation_ctx *creation_ctx; @@ -715,11 +715,11 @@ Silence_deprecated_warning::handle_condition( @retval 0 error */ -static sp_head *sp_compile(THD *thd, String *defstr, ulong sql_mode, +static sp_head *sp_compile(THD *thd, String *defstr, ulonglong sql_mode, Stored_program_creation_ctx *creation_ctx) { sp_head *sp; - ulong old_sql_mode= thd->variables.sql_mode; + ulonglong old_sql_mode= thd->variables.sql_mode; ha_rows old_select_limit= thd->variables.select_limit; sp_rcontext *old_spcont= thd->spcont; Silence_deprecated_warning warning_handler; @@ -760,7 +760,7 @@ static sp_head *sp_compile(THD *thd, String *defstr, ulong sql_mode, static int db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp, - ulong sql_mode, const char *params, const char *returns, + ulonglong sql_mode, const char *params, const char *returns, const char *body, st_sp_chistics &chistics, const char *definer, longlong created, longlong modified, Stored_program_creation_ctx *creation_ctx) @@ -923,7 +923,7 @@ sp_create_routine(THD *thd, int type, sp_head *sp) int ret; TABLE *table; char definer[USER_HOST_BUFF_SIZE]; - ulong saved_mode= thd->variables.sql_mode; + ulonglong saved_mode= thd->variables.sql_mode; MDL_key::enum_mdl_namespace mdl_type= type == TYPE_ENUM_FUNCTION ? MDL_key::FUNCTION : MDL_key::PROCEDURE; @@ -2079,7 +2079,6 @@ int sp_cache_routine(THD *thd, int type, sp_name *name, Returns TRUE on success, FALSE on (alloc) failure. */ static bool - create_string(THD *thd, String *buf, int type, const char *db, ulong dblen, @@ -2090,9 +2089,9 @@ create_string(THD *thd, String *buf, st_sp_chistics *chistics, const LEX_STRING *definer_user, const LEX_STRING *definer_host, - ulong sql_mode) + ulonglong sql_mode) { - ulong old_sql_mode= thd->variables.sql_mode; + ulonglong old_sql_mode= thd->variables.sql_mode; /* Make some room to begin with */ if (buf->alloc(100 + dblen + 1 + namelen + paramslen + returnslen + bodylen + chistics->comment.length + 10 /* length of " DEFINER= "*/ + diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 6e17c974c2c..078c3111819 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1194,7 +1194,7 @@ sp_head::execute(THD *thd, bool merge_da_on_success) sp_rcontext *ctx= thd->spcont; bool err_status= FALSE; uint ip= 0; - ulong save_sql_mode; + ulonglong save_sql_mode; bool save_abort_on_warning; Query_arena *old_arena; /* per-instruction arena */ @@ -2476,7 +2476,7 @@ sp_head::do_cont_backpatch() void sp_head::set_info(longlong created, longlong modified, - st_sp_chistics *chistics, ulong sql_mode) + st_sp_chistics *chistics, ulonglong sql_mode) { m_created= created; m_modified= modified; diff --git a/sql/sp_head.h b/sql/sp_head.h index 4d5e2dd95ab..780e05076c1 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -172,7 +172,7 @@ public: const char *m_tmp_query; ///< Temporary pointer to sub query string st_sp_chistics *m_chistics; - ulong m_sql_mode; ///< For SHOW CREATE and execution + ulonglong m_sql_mode; ///< For SHOW CREATE and execution LEX_STRING m_qname; ///< db.name bool m_explicit_name; ///< Prepend the db name? */ LEX_STRING m_db; @@ -394,7 +394,7 @@ public: Create_field *field_def); void set_info(longlong created, longlong modified, - st_sp_chistics *chistics, ulong sql_mode); + st_sp_chistics *chistics, ulonglong sql_mode); void set_definer(const char *definer, uint definerlen); void set_definer(const LEX_STRING *user_name, const LEX_STRING *host_name); diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 650c9d4e458..0fb8204856e 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -740,7 +740,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; char tmp_name[SAFE_NAME_LEN+1]; int password_length; - ulong old_sql_mode= thd->variables.sql_mode; + ulonglong old_sql_mode= thd->variables.sql_mode; DBUG_ENTER("acl_load"); thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH; @@ -4307,7 +4307,7 @@ static my_bool grant_load(THD *thd, TABLE_LIST *tables) bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; MEM_ROOT **save_mem_root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC); - ulong old_sql_mode= thd->variables.sql_mode; + ulonglong old_sql_mode= thd->variables.sql_mode; DBUG_ENTER("grant_load"); thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH; @@ -6541,7 +6541,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list) List_iterator <LEX_USER> user_list(list); TABLE_LIST tables[GRANT_TABLES]; bool some_users_deleted= FALSE; - ulong old_sql_mode= thd->variables.sql_mode; + ulonglong old_sql_mode= thd->variables.sql_mode; bool save_binlog_row_based; DBUG_ENTER("mysql_drop_user"); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 9e2279d71ea..c32556c1b59 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1422,7 +1422,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) DBUG_PRINT("qcache", ("\ long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \ CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \ -sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \ +sql mode: 0x%llx, sort len: %lu, conncat len: %lu, div_precision: %lu, \ def_week_frmt: %lu, in_trans: %d, autocommit: %d", (int)flags.client_long_flag, (int)flags.client_protocol_41, @@ -1824,7 +1824,7 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length) DBUG_PRINT("qcache", ("\ long %d, 4.1: %d, bin_proto: %d, more results %d, pkt_nr: %d, \ CS client: %u, CS result: %u, CS conn: %u, limit: %lu, TZ: 0x%lx, \ -sql mode: 0x%lx, sort len: %lu, conncat len: %lu, div_precision: %lu, \ +sql mode: 0x%llx, sort len: %lu, conncat len: %lu, div_precision: %lu, \ def_week_frmt: %lu, in_trans: %d, autocommit: %d", (int)flags.client_long_flag, (int)flags.client_protocol_41, diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 13efcfd85e9..4701b9eae5c 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -537,7 +537,7 @@ struct Query_cache_query_flags uint collation_connection_num; ha_rows limit; Time_zone *time_zone; - ulong sql_mode; + ulonglong sql_mode; ulong max_sort_length; ulong group_concat_max_len; ulong default_week_format; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 96ca4c10390..6b5f4a335d5 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1656,7 +1656,7 @@ bool mysql_upgrade_db(THD *thd, LEX_STRING *old_db) /* Lock the old name, the new name will be locked by mysql_create_db().*/ if (lock_schema_name(thd, old_db->str)) - DBUG_RETURN(-1); + DBUG_RETURN(1); /* Let's remember if we should do "USE newdb" afterwards. diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index a1c016b204e..8b2884b7f35 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1880,7 +1880,7 @@ public: enum_duplicates dup; my_time_t start_time; ulong start_time_sec_part; - ulong sql_mode; + ulonglong sql_mode; bool auto_increment_field_not_null; bool query_start_used, ignore, log_query, query_start_sec_part_used; bool stmt_depends_on_first_successful_insert_id_in_prev_stmt; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a5ef2c4b7fc..9d6be2a805d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7137,7 +7137,7 @@ copy_data_between_tables(THD *thd, TABLE *from,TABLE *to, List<Item> all_fields; ha_rows examined_rows; bool auto_increment_field_copied= 0; - ulong save_sql_mode= thd->variables.sql_mode; + ulonglong save_sql_mode= thd->variables.sql_mode; ulonglong prev_insert_id, time_to_report_progress; List_iterator<Create_field> it(create); Create_field *def; diff --git a/sql/sql_time.cc b/sql/sql_time.cc index ce50fdb345b..4db7fd9cbbb 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -245,7 +245,7 @@ to_ascii(CHARSET_INFO *cs, wc < 128) { src+= cnvres; - *dst++= wc; + *dst++= static_cast<char>(wc); } *dst= '\0'; return dst - dst0; @@ -255,7 +255,7 @@ to_ascii(CHARSET_INFO *cs, /* Character set-aware version of str_to_time() */ timestamp_type str_to_time(CHARSET_INFO *cs, const char *str,uint length, - MYSQL_TIME *l_time, ulong fuzzydate, int *warning) + MYSQL_TIME *l_time, ulonglong fuzzydate, int *warning) { char cnv[32]; if ((cs->state & MY_CS_NONASCII) != 0) @@ -270,7 +270,7 @@ str_to_time(CHARSET_INFO *cs, const char *str,uint length, /* Character set-aware version of str_to_datetime() */ timestamp_type str_to_datetime(CHARSET_INFO *cs, const char *str, uint length, - MYSQL_TIME *l_time, uint flags, int *was_cut) + MYSQL_TIME *l_time, ulonglong flags, int *was_cut) { char cnv[32]; if ((cs->state & MY_CS_NONASCII) != 0) @@ -293,7 +293,7 @@ timestamp_type str_to_datetime(CHARSET_INFO *cs, timestamp_type str_to_datetime_with_warn(CHARSET_INFO *cs, const char *str, uint length, MYSQL_TIME *l_time, - ulong flags) + ulonglong flags) { int was_cut; THD *thd= current_thd; @@ -324,7 +324,7 @@ str_to_datetime_with_warn(CHARSET_INFO *cs, @returns 0 for success, 1 for a failure */ static bool number_to_time_with_warn(bool neg, ulonglong nr, ulong sec_part, - MYSQL_TIME *ltime, ulong fuzzydate, + MYSQL_TIME *ltime, ulonglong fuzzydate, const ErrConv *str, const char *field_name) { @@ -356,7 +356,7 @@ static bool number_to_time_with_warn(bool neg, ulonglong nr, ulong sec_part, bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime, - ulong fuzzydate, const char *field_name) + ulonglong fuzzydate, const char *field_name) { const ErrConvDouble str(value); bool neg= value < 0; @@ -375,7 +375,7 @@ bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime, bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime, - ulong fuzzydate, const char *field_name) + ulonglong fuzzydate, const char *field_name) { const ErrConvDecimal str(value); ulonglong nr; @@ -387,7 +387,7 @@ bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime, bool int_to_datetime_with_warn(longlong value, MYSQL_TIME *ltime, - ulong fuzzydate, const char *field_name) + ulonglong fuzzydate, const char *field_name) { const ErrConvInteger str(value); bool neg= value < 0; diff --git a/sql/sql_time.h b/sql/sql_time.h index 937d10f5b74..df3ca9a14c7 100644 --- a/sql/sql_time.h +++ b/sql/sql_time.h @@ -36,18 +36,18 @@ ulong convert_month_to_period(ulong month); void get_date_from_daynr(long daynr,uint *year, uint *month, uint *day); my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, uint *error_code); bool str_to_time_with_warn(CHARSET_INFO *cs, const char *str, uint length, - MYSQL_TIME *l_time, ulong fuzzydate); + MYSQL_TIME *l_time, ulonglong fuzzydate); timestamp_type str_to_datetime_with_warn(CHARSET_INFO *cs, const char *str, uint length, MYSQL_TIME *l_time, - ulong flags); + ulonglong flags); bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime, - ulong fuzzydate, + ulonglong fuzzydate, const char *name); bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime, - ulong fuzzydate, + ulonglong fuzzydate, const char *name); bool int_to_datetime_with_warn(longlong value, MYSQL_TIME *ltime, - ulong fuzzydate, + ulonglong fuzzydate, const char *name); void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, @@ -87,11 +87,11 @@ bool parse_date_time_format(timestamp_type format_type, DATE_TIME_FORMAT *date_time_format); /* Character set-aware version of str_to_time() */ timestamp_type str_to_time(CHARSET_INFO *cs, const char *str,uint length, - MYSQL_TIME *l_time, ulong fuzzydate, int *warning); + MYSQL_TIME *l_time, ulonglong fuzzydate, int *warning); /* Character set-aware version of str_to_datetime() */ timestamp_type str_to_datetime(CHARSET_INFO *cs, const char *str, uint length, - MYSQL_TIME *l_time, uint flags, int *was_cut); + MYSQL_TIME *l_time, ulonglong flags, int *was_cut); /* convenience wrapper */ inline bool parse_date_time_format(timestamp_type format_type, diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 526bc9f65bd..868e803fb99 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1348,7 +1348,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, List_iterator_fast<LEX_STRING> it_db_cl_name(triggers->db_cl_names); LEX *old_lex= thd->lex, lex; sp_rcontext *save_spcont= thd->spcont; - ulong save_sql_mode= thd->variables.sql_mode; + ulonglong save_sql_mode= thd->variables.sql_mode; LEX_STRING *on_table_name; thd->lex= &lex; @@ -1848,7 +1848,7 @@ Table_triggers_list::change_table_name_in_triggers(THD *thd, { char path_buff[FN_REFLEN]; LEX_STRING *def, *on_table_name, new_def; - ulong save_sql_mode= thd->variables.sql_mode; + ulonglong save_sql_mode= thd->variables.sql_mode; List_iterator_fast<LEX_STRING> it_def(definitions_list); List_iterator_fast<LEX_STRING> it_on_table_name(on_table_names_list); List_iterator_fast<ulonglong> it_mode(definition_modes_list); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index cb1c57ea0ba..c09b39c2450 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1225,7 +1225,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, view_select= &lex->select_lex; view_select->select_number= ++thd->select_number; - ulong saved_mode= thd->variables.sql_mode; + ulonglong saved_mode= thd->variables.sql_mode; /* switch off modes which can prevent normal parsing of VIEW - MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing + MODE_PIPES_AS_CONCAT affect expression parsing diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 88a1b2f6da6..4acd0cf8861 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1040,20 +1040,20 @@ static Sys_var_ulong Sys_max_allowed_packet( BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_max_allowed_packet)); -static Sys_var_ulonglong Sys_max_binlog_cache_size( +static Sys_var_ulong Sys_max_binlog_cache_size( "max_binlog_cache_size", "Sets the total size of the transactional cache", GLOBAL_VAR(max_binlog_cache_size), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(IO_SIZE, ULONGLONG_MAX), - DEFAULT((ULONGLONG_MAX/IO_SIZE)*IO_SIZE), + VALID_RANGE(IO_SIZE, ULONG_MAX), + DEFAULT((ULONG_MAX/IO_SIZE)*IO_SIZE), BLOCK_SIZE(IO_SIZE)); -static Sys_var_ulonglong Sys_max_binlog_stmt_cache_size( +static Sys_var_ulong Sys_max_binlog_stmt_cache_size( "max_binlog_stmt_cache_size", "Sets the total size of the statement cache", GLOBAL_VAR(max_binlog_stmt_cache_size), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(IO_SIZE, ULONGLONG_MAX), - DEFAULT((ULONGLONG_MAX/IO_SIZE)*IO_SIZE), + VALID_RANGE(IO_SIZE, ULONG_MAX), + DEFAULT((ULONG_MAX/IO_SIZE)*IO_SIZE), BLOCK_SIZE(IO_SIZE)); static bool fix_max_binlog_size(sys_var *self, THD *thd, enum_var_type type) @@ -1977,7 +1977,7 @@ static Sys_var_ulong Sys_sort_buffer( VALID_RANGE(MIN_SORT_MEMORY, ULONG_MAX), DEFAULT(MAX_SORT_MEMORY), BLOCK_SIZE(1)); -export ulong expand_sql_mode(ulonglong sql_mode) +export ulonglong expand_sql_mode(ulonglong sql_mode) { if (sql_mode & MODE_ANSI) { @@ -2064,7 +2064,7 @@ static const char *sql_mode_names[]= "PAD_CHAR_TO_FULL_LENGTH", 0 }; -export bool sql_mode_string_representation(THD *thd, ulong sql_mode, +export bool sql_mode_string_representation(THD *thd, ulonglong sql_mode, LEX_STRING *ls) { set_to_string(thd, ls, sql_mode, sql_mode_names); diff --git a/sql/sys_vars.h b/sql/sys_vars.h index d2a1e2360b6..b06a3eeae2d 100644 --- a/sql/sys_vars.h +++ b/sql/sys_vars.h @@ -154,12 +154,12 @@ public: } bool session_update(THD *thd, set_var *var) { - session_var(thd, T)= var->save_result.ulonglong_value; + session_var(thd, T)= static_cast<T>(var->save_result.ulonglong_value); return false; } bool global_update(THD *thd, set_var *var) { - global_var(T)= var->save_result.ulonglong_value; + global_var(T)= static_cast<T>(var->save_result.ulonglong_value); return false; } bool check_update_type(Item_result type) @@ -276,12 +276,12 @@ public: } bool session_update(THD *thd, set_var *var) { - session_var(thd, ulong)= var->save_result.ulonglong_value; + session_var(thd, ulong)= static_cast<ulong>(var->save_result.ulonglong_value); return false; } bool global_update(THD *thd, set_var *var) { - global_var(ulong)= var->save_result.ulonglong_value; + global_var(ulong)= static_cast<ulong>(var->save_result.ulonglong_value); return false; } void session_save_default(THD *thd, set_var *var) @@ -324,12 +324,12 @@ public: } bool session_update(THD *thd, set_var *var) { - session_var(thd, my_bool)= var->save_result.ulonglong_value; + session_var(thd, my_bool)= var->save_result.ulonglong_value != 0; return false; } bool global_update(THD *thd, set_var *var) { - global_var(my_bool)= var->save_result.ulonglong_value; + global_var(my_bool)= var->save_result.ulonglong_value != 0; return false; } void session_save_default(THD *thd, set_var *var) @@ -651,7 +651,7 @@ public: const char *comment, int flag_args, ptrdiff_t off, size_t size, CMD_LINE getopt, ulonglong min_val, ulonglong max_val, ulonglong def_val, - ulonglong block_size, PolyLock *lock, + uint block_size, PolyLock *lock, enum binlog_status_enum binlog_status_arg, on_check_function on_check_func, keycache_update_function on_update_func, @@ -1410,7 +1410,7 @@ public: Sys_var_session_special(const char *name_arg, const char *comment, int flag_args, CMD_LINE getopt, - ulonglong min_val, ulonglong max_val, ulonglong block_size, + ulonglong min_val, ulonglong max_val, uint block_size, PolyLock *lock, enum binlog_status_enum binlog_status_arg, on_check_function on_check_func, session_special_update_function update_func_arg, |