Currently LIKE type Admin Grid Filters won't properly work when we use " _ " or " % " in the search query. Both will be treated as "wildcards" by MySQL since not properly escaped.
Below is example of SQL used when we put " % " in Filter Search:
SELECT COUNT AS count
FROM News
LEFT JOIN CategoryItems ON CategoryItems.ItemResourceId = News.ResourceId
LEFT JOIN Category ON Category.CategoryId = CategoryItems.CategoryId
LEFT JOIN Images img ON img.ResourceId = News.ResourceId AND img.DefaultImg = 1
LEFT JOIN PermCache perm ON perm.CategoryId = CategoryItems.CategoryId
LEFT JOIN PortalUser u ON News.CreatedById = u.PortalUserId
LEFT JOIN NewsCustomData cust ON News.ResourceId = cust.ResourceId
WHERE ((PrimaryCat = 1) AND (perm.PermId = 1)) AND (((`News`.`Title` LIKE "%%%")))
LIMIT 0,1
- relates to
-
INP-342 SQL Fatal when using Double-quotes in Text Filters in Grids
- Closed