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.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/lex_string.h b/sql/lex_string.h
index a5209165be0..ddda73b2200 100644
--- a/sql/lex_string.h
+++ b/sql/lex_string.h
@@ -34,8 +34,8 @@ 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));
}
/*