Skip match to not add empty searches (#1522)

This commit is contained in:
Tomas Touceda 2021-07-30 16:18:38 -03:00 committed by GitHub
parent 11351a4253
commit 18037ab4bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -536,7 +536,7 @@ func isChildForeignKeyError(err error) bool {
//
// The input columns must be sanitized if they are provided by the user.
func searchLike(sql string, params []interface{}, match string, columns ...string) (string, []interface{}) {
if len(columns) == 0 {
if len(columns) == 0 || len(match) == 0 {
return sql, params
}