diff options
author | unknown <kostja@bodhi.local> | 2007-03-27 20:27:58 +0400 |
---|---|---|
committer | unknown <kostja@bodhi.local> | 2007-03-27 20:27:58 +0400 |
commit | 66fcdd5403ba20a9f9f760c545fe49a297188f96 (patch) | |
tree | 79502174ae5e635dfaa0b061d041bc77080973ac | |
parent | d9b8e466bf8258f94ed69a7771d9098d3185fa11 (diff) | |
download | mariadb-git-66fcdd5403ba20a9f9f760c545fe49a297188f96.tar.gz |
Change find_type family to accept const TYPELIB*.
include/mysql_h.ic:
Change find_type family to accept const TYPELIB*.
This sort of change can not break the ABI.
-rw-r--r-- | include/mysql_h.ic | 2 | ||||
-rw-r--r-- | include/typelib.h | 3 | ||||
-rw-r--r-- | mysys/typelib.c | 2 | ||||
-rw-r--r-- | sql/mysql_priv.h | 6 | ||||
-rw-r--r-- | sql/strfunc.cc | 6 |
5 files changed, 12 insertions, 7 deletions
diff --git a/include/mysql_h.ic b/include/mysql_h.ic index 44c51b34c1d..7d16a886fd8 100644 --- a/include/mysql_h.ic +++ b/include/mysql_h.ic @@ -638,7 +638,7 @@ extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from); # 415 "mysql_com.h" extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st); # 30 "typelib.h" -extern int find_type(char * x, TYPELIB * typelib, unsigned int); +extern int find_type(char * x, const TYPELIB * typelib, unsigned int); # 429 "mysql_com.h" extern void get_salt_from_password(unsigned char * res, char const * password); # 422 "mysql_com.h" diff --git a/include/typelib.h b/include/typelib.h index 75d170e59d3..79d3acd2d64 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -26,7 +26,8 @@ typedef struct st_typelib { /* Different types saved here */ unsigned int *type_lengths; } TYPELIB; -extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name); +extern int find_type(const char *x, const TYPELIB *typelib, + unsigned int full_name); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); diff --git a/mysys/typelib.c b/mysys/typelib.c index 4fab6f20493..97b03b72b24 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -42,7 +42,7 @@ >0 Offset+1 in typelib for matched string */ -int find_type(my_string x, TYPELIB *typelib, uint full_name) +int find_type(const char *x, const TYPELIB *typelib, uint full_name) { int find,pos,findpos; reg1 my_string i; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 608fb697d4f..81c82cf3ac8 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1561,8 +1561,10 @@ extern bool check_reserved_words(LEX_STRING *name); /* strfunc.cc */ ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs, char **err_pos, uint *err_len, bool *set_warning); -uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match); -uint find_type2(TYPELIB *lib, const char *find, uint length, CHARSET_INFO *cs); +uint find_type(const TYPELIB *lib, const char *find, uint length, + bool part_match); +uint find_type2(const TYPELIB *lib, const char *find, uint length, + CHARSET_INFO *cs); void unhex_type2(TYPELIB *lib); uint check_word(TYPELIB *lib, const char *val, const char *end, const char **end_of_word); diff --git a/sql/strfunc.cc b/sql/strfunc.cc index 71b52a5145d..9ffc5fd127f 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -104,7 +104,8 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, > 0 position in TYPELIB->type_names +1 */ -uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match) +uint find_type(const TYPELIB *lib, const char *find, uint length, + bool part_match) { uint found_count=0, found_pos=0; const char *end= find+length; @@ -144,7 +145,8 @@ uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match) >0 Offset+1 in typelib for matched string */ -uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) +uint find_type2(const TYPELIB *typelib, const char *x, uint length, + CHARSET_INFO *cs) { int pos; const char *j; |