summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 46bd2f6a2b7..74857a94471 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -6118,6 +6118,25 @@ public:
}
};
+/* 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)
+{
+ return my_strcasecmp(charset, a->str, b->str);
+}
+
+/*
+ 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)
+{
+ if (a->length != b->length)
+ return 1; /* Different */
+ return strcasecmp(a->str, b->str) != 0;
+}
#endif /* MYSQL_SERVER */