summaryrefslogtreecommitdiff
path: root/sql/lex_string.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/lex_string.h')
-rw-r--r--sql/lex_string.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/lex_string.h b/sql/lex_string.h
index 008e5f75812..e7a732346c4 100644
--- a/sql/lex_string.h
+++ b/sql/lex_string.h
@@ -76,12 +76,12 @@ static inline bool lex_string_cmp(CHARSET_INFO *charset, const LEX_CSTRING *a,
static inline bool cmp(const LEX_CSTRING *a, const LEX_CSTRING *b)
{
- return (a->length != b->length ||
- memcmp(a->str, b->str, a->length));
+ return a->length != b->length ||
+ (a->length && memcmp(a->str, b->str, a->length));
}
static inline bool cmp(const LEX_CSTRING a, const LEX_CSTRING b)
{
- return a.length != b.length || memcmp(a.str, b.str, a.length);
+ return a.length != b.length || (a.length && memcmp(a.str, b.str, a.length));
}
/*