diff --git a/sql/v2/expression/like_expression.go b/sql/v2/expression/like_expression.go index b34829d7b..01734852a 100644 --- a/sql/v2/expression/like_expression.go +++ b/sql/v2/expression/like_expression.go @@ -48,6 +48,10 @@ func matchString(text, pattern string) bool { lastWildcardIdx := -1 lastMatchIdx := 0 + if patternLen == 0 { + return patternLen == textLen + } + for textIdx < textLen { if patternIdx < patternLen-1 && pattern[patternIdx] == '\\' && ((pattern[patternIdx+1] == '_' || pattern[patternIdx+1] == '%') &&