Skip to content

Commit

Permalink
Merge pull request #320 from actiontech/319-issue
Browse files Browse the repository at this point in the history
fix: when values of in condition is empty, do not add ()
  • Loading branch information
taolx0 authored Oct 22, 2024
2 parents 4b5364d + 0414908 commit 582a66d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/dms/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func gormWhereCondition(condition pkgConst.FilterCondition) (string, interface{}
condition.Value = fmt.Sprintf("%%%s%%", condition.Value)
case pkgConst.FilterOperatorIn:
values, ok := condition.Value.([]string)
if ok {
if ok && len(values) > 0 {
return fmt.Sprintf("%s %s (%s)", condition.Field, condition.Operator, strings.Join(values, ",")), nil
}
}
Expand Down

0 comments on commit 582a66d

Please sign in to comment.