diff options
author | Sergei Golubchik <serg@mariadb.org> | 2014-11-19 09:13:38 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2014-12-04 10:41:51 +0100 |
commit | 2ae7541bcf93985302bc7efb2629e6f623ccfc64 (patch) | |
tree | d0b14c1dba4bffc2ae82f2d51f1f9ef4ebf7035a /sql | |
parent | 0d30423900dd3a384f061c32f6ec3de9c11cdde9 (diff) | |
download | mariadb-git-2ae7541bcf93985302bc7efb2629e6f623ccfc64.tar.gz |
cleanup: s/const CHARSET_INFO/CHARSET_INFO/
as CHARSET_INFO is already const, using const on it
is redundant and results in compiler warnings (on Windows)
Diffstat (limited to 'sql')
-rw-r--r-- | sql/field.cc | 2 | ||||
-rw-r--r-- | sql/field.h | 2 | ||||
-rw-r--r-- | sql/filesort.cc | 6 | ||||
-rw-r--r-- | sql/item_strfunc.cc | 2 | ||||
-rw-r--r-- | sql/item_timefunc.h | 2 | ||||
-rw-r--r-- | sql/mdl.cc | 2 | ||||
-rw-r--r-- | sql/mdl.h | 2 | ||||
-rw-r--r-- | sql/sql_acl.cc | 3 | ||||
-rw-r--r-- | sql/sql_explain.cc | 8 | ||||
-rw-r--r-- | sql/sql_partition.cc | 6 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/sql_string.h | 8 |
12 files changed, 22 insertions, 23 deletions
diff --git a/sql/field.cc b/sql/field.cc index 4fef2b996c5..7467aa63a26 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5517,7 +5517,7 @@ void Field_time::sql_type(String &res) const res.set_ascii(STRING_WITH_LEN("time")); return; } - const CHARSET_INFO *cs= res.charset(); + CHARSET_INFO *cs= res.charset(); res.length(cs->cset->snprintf(cs, (char*) res.ptr(), res.alloced_length(), "time(%d)", decimals())); } diff --git a/sql/field.h b/sql/field.h index b4b94bfa712..dabb6c6b0e0 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1583,7 +1583,7 @@ public: enum Derivation derivation(void) const { return DERIVATION_NUMERIC; } uint repertoire(void) const { return MY_REPERTOIRE_NUMERIC; } CHARSET_INFO *charset(void) const { return &my_charset_numeric; } - const CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; } + CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; } bool binary() const { return true; } enum Item_result cmp_type () const { return TIME_RESULT; } uint is_equal(Create_field *new_field); diff --git a/sql/filesort.cc b/sql/filesort.cc index 509a7f8e9b3..569e1d37e0c 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -988,7 +988,7 @@ static void make_sortkey(register Sort_param *param, switch (sort_field->result_type) { case STRING_RESULT: { - const CHARSET_INFO *cs=item->collation.collation; + CHARSET_INFO *cs=item->collation.collation; char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' '); if (maybe_null) @@ -1863,8 +1863,8 @@ static uint sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) { - reg2 uint length; - const CHARSET_INFO *cs; + uint length; + CHARSET_INFO *cs; *multi_byte_charset= 0; length=0; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 875d9470dac..f3f3edae3b4 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3041,7 +3041,7 @@ String *Item_func_space::val_str(String *str) { uint tot_length; longlong count= args[0]->val_int(); - const CHARSET_INFO *cs= collation.collation; + CHARSET_INFO *cs= collation.collation; if (args[0]->null_value) goto err; // string and/or delim are null diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 839a5a4845d..8438119ddc6 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -523,7 +523,7 @@ public: return cached_field_type == MYSQL_TYPE_STRING ? STRING_RESULT : TIME_RESULT; } - const CHARSET_INFO *charset_for_protocol() const + CHARSET_INFO *charset_for_protocol() const { /* Can return TIME, DATE, DATETIME or VARCHAR depending on arguments. diff --git a/sql/mdl.cc b/sql/mdl.cc index 09c26cf4c34..ec2dea0676f 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -793,7 +793,7 @@ void MDL_map::init() } -my_hash_value_type mdl_hash_function(const CHARSET_INFO *cs, +my_hash_value_type mdl_hash_function(CHARSET_INFO *cs, const uchar *key, size_t length) { MDL_key *mdl_key= (MDL_key*) (key - offsetof(MDL_key, m_ptr)); diff --git a/sql/mdl.h b/sql/mdl.h index 44e692b97a0..4cefaa8d6c3 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -416,7 +416,7 @@ private: private: MDL_key(const MDL_key &); /* not implemented */ MDL_key &operator=(const MDL_key &); /* not implemented */ - friend my_hash_value_type mdl_hash_function(const CHARSET_INFO *, + friend my_hash_value_type mdl_hash_function(CHARSET_INFO *, const uchar *, size_t); }; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 4e872c1960c..0eabc4fe281 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -11284,8 +11284,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio) } static bool -read_client_connect_attrs(char **ptr, char *end, - const CHARSET_INFO *from_cs) +read_client_connect_attrs(char **ptr, char *end, CHARSET_INFO *from_cs) { size_t length; char *ptr_save= *ptr; diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index 59f38f7f167..0ad6a4d89ea 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -207,7 +207,7 @@ void Explain_query::print_explain_json(select_result_sink *output, bool is_analy writer.end_object(); - const CHARSET_INFO *cs= system_charset_info; + CHARSET_INFO *cs= system_charset_info; List<Item> item_list; String *buf= &writer.output; item_list.push_back(new Item_string(buf->ptr(), buf->length(), cs)); @@ -416,7 +416,7 @@ int Explain_union::print_explain(Explain_query *query, uint8 explain_flags, bool is_analyze) { - //const CHARSET_INFO *cs= system_charset_info; + //CHARSET_INFO *cs= system_charset_info; char table_name_buffer[SAFE_NAME_LEN]; /* print all UNION children, in order */ @@ -762,7 +762,7 @@ void Explain_table_access::push_extra(enum explain_extra_tag extra_tag) void Explain_table_access::fill_key_str(String *key_str, bool is_json) const { - const CHARSET_INFO *cs= system_charset_info; + CHARSET_INFO *cs= system_charset_info; bool is_hj= (type == JT_HASH || type == JT_HASH_NEXT || type == JT_HASH_RANGE || type == JT_HASH_INDEX_MERGE); const char *hash_key_prefix= "#hash#"; @@ -882,7 +882,7 @@ int Explain_table_access::print_explain(select_result_sink *output, uint8 explai uint select_id, const char *select_type, bool using_temporary, bool using_filesort) { - //const CHARSET_INFO *cs= system_charset_info; + //CHARSET_INFO *cs= system_charset_info; List<Item> item_list; Item *item_null= new Item_null(); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index b307c60d317..555ee2a3f40 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -195,7 +195,7 @@ static int cmp_rec_and_tuple_prune(part_column_list_val *val, item New converted item */ -Item* convert_charset_partition_constant(Item *item, const CHARSET_INFO *cs) +Item* convert_charset_partition_constant(Item *item, CHARSET_INFO *cs) { THD *thd= current_thd; Name_resolution_context *context= &thd->lex->current_select->context; @@ -2222,7 +2222,7 @@ static int add_column_list_values(File fptr, partition_info *part_info, else { String *res; - const CHARSET_INFO *field_cs; + CHARSET_INFO *field_cs; bool need_cs_check= FALSE; Item_result result_type= STRING_RESULT; @@ -4292,7 +4292,7 @@ bool mysql_unpack_partition(THD *thd, { bool result= TRUE; partition_info *part_info; - const CHARSET_INFO *old_character_set_client= + CHARSET_INFO *old_character_set_client= thd->variables.character_set_client; LEX *old_lex= thd->lex; LEX lex; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 531f968fd8c..d81202ea18d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -23289,7 +23289,7 @@ void JOIN_TAB::save_explain_data(Explain_table_access *eta, table_map prefix_tab bool distinct, JOIN_TAB *first_top_tab) { int quick_type; - const CHARSET_INFO *cs= system_charset_info; + CHARSET_INFO *cs= system_charset_info; JOIN_TAB *tab= this; THD *thd=join->thd; diff --git a/sql/sql_string.h b/sql/sql_string.h index dff2a457044..7f6aed9f804 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -35,9 +35,9 @@ typedef struct st_mem_root MEM_ROOT; int sortcmp(const String *a,const String *b, CHARSET_INFO *cs); String *copy_if_not_alloced(String *a,String *b,uint32 arg_length); inline uint32 copy_and_convert(char *to, uint32 to_length, - const CHARSET_INFO *to_cs, + CHARSET_INFO *to_cs, const char *from, uint32 from_length, - const CHARSET_INFO *from_cs, uint *errors) + CHARSET_INFO *from_cs, uint *errors) { return my_convert(to, to_length, to_cs, from, from_length, from_cs, errors); } @@ -575,11 +575,11 @@ class StringBuffer : public String public: StringBuffer() : String(buff, buff_sz, &my_charset_bin) { length(0); } - explicit StringBuffer(const CHARSET_INFO *cs) : String(buff, buff_sz, cs) + explicit StringBuffer(CHARSET_INFO *cs) : String(buff, buff_sz, cs) { length(0); } - StringBuffer(const char *str, size_t length, const CHARSET_INFO *cs) + StringBuffer(const char *str, size_t length, CHARSET_INFO *cs) : String(buff, buff_sz, cs) { set(str, length, cs); |