summaryrefslogtreecommitdiff
path: root/sql/lex_string.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-03-30 15:42:38 +0200
committerSergei Golubchik <serg@mariadb.org>2018-04-10 13:12:36 +0200
commit0dcb47cae93b8b25a1c1bd7ca31e0d2432df89f3 (patch)
tree66a8cc27516523dfe018550d8cdd8bf6c94bb1ce /sql/lex_string.h
parent479bd5a6fe9966397ad40ab0a997b4d1901d8805 (diff)
downloadmariadb-git-0dcb47cae93b8b25a1c1bd7ca31e0d2432df89f3.tar.gz
change lex_string_eq to return what it says
the function xxx_eq(a,b) returns true if two elements are equal and false if they are not.
Diffstat (limited to 'sql/lex_string.h')
-rw-r--r--sql/lex_string.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/sql/lex_string.h b/sql/lex_string.h
index 9df84f67b6a..64c90bd2ac9 100644
--- a/sql/lex_string.h
+++ b/sql/lex_string.h
@@ -21,9 +21,8 @@
typedef struct st_mysql_const_lex_string LEX_CSTRING;
/* Functions to compare if two lex strings are equal */
-inline bool lex_string_cmp(CHARSET_INFO *charset,
- const LEX_CSTRING *a,
- const LEX_CSTRING *b)
+static inline bool lex_string_cmp(CHARSET_INFO *charset, const LEX_CSTRING *a,
+ const LEX_CSTRING *b)
{
return my_strcasecmp(charset, a->str, b->str);
}
@@ -31,7 +30,7 @@ inline bool lex_string_cmp(CHARSET_INFO *charset,
/*
Compare to LEX_CSTRING's and return 0 if equal
*/
-inline bool cmp(const LEX_CSTRING *a, const LEX_CSTRING *b)
+static inline bool cmp(const LEX_CSTRING *a, const LEX_CSTRING *b)
{
return (a->length != b->length ||
memcmp(a->str, b->str, a->length));
@@ -41,12 +40,11 @@ inline bool cmp(const LEX_CSTRING *a, const LEX_CSTRING *b)
Compare if two LEX_CSTRING are equal. Assumption is that
character set is ASCII (like for plugin names)
*/
-inline bool lex_string_eq(const LEX_CSTRING *a,
- const LEX_CSTRING *b)
+static inline bool lex_string_eq(const LEX_CSTRING *a, const LEX_CSTRING *b)
{
if (a->length != b->length)
- return 1; /* Different */
- return strcasecmp(a->str, b->str) != 0;
+ return 0; /* Different */
+ return strcasecmp(a->str, b->str) == 0;
}
#endif /* LEX_STRING_INCLUDED */