Change NULL filters to filter empty strings as well (#1137)

This commit is contained in:
InfiniteTF
2021-03-01 01:48:25 +01:00
committed by GitHub
parent 144cd6e4f2
commit 7e0db2aad4
2 changed files with 5 additions and 0 deletions

View File

@@ -90,6 +90,10 @@ func (qb *queryBuilder) handleStringCriterionInput(c *models.StringCriterionInpu
}
qb.addWhere(column + " NOT regexp ?")
qb.addArg(c.Value)
case models.CriterionModifierIsNull:
qb.addWhere("(" + column + " IS NULL OR TRIM(" + column + ") = '')")
case models.CriterionModifierNotNull:
qb.addWhere("(" + column + " IS NOT NULL AND TRIM(" + column + ") != '')")
default:
clause, count := getSimpleCriterionClause(modifier, "?")
qb.addWhere(column + " " + clause)