Remove use of dialect.LikeStr (#104460)
* Fix TestIntegrationUpdatingProvisionionedDashboards* tests when running on Spanner by fixing case-insensitive search for dashboard title. * Fix use of case-insensitive LIKE when running on Spanner. * Fix use of LikeStr in anonstore. * Fix use of LikeStr in ngalert/store and org/orgimpl. * Fix use of LikeStr in queryhistory search. * Fix use of LikeStr in serviceaccounts. * Fix use of LikeStr in serviceaccounts. * Fix use of LikeStr in services/team. * Remove LikeStr method.
This commit is contained in:
@@ -285,8 +285,8 @@ func (s *AnonDBStore) SearchDevices(ctx context.Context, query *SearchDeviceQuer
|
||||
sess.Where("d.updated_at BETWEEN ? AND ?", query.From.UTC(), query.To.UTC())
|
||||
|
||||
if query.Query != "" {
|
||||
queryWithWildcards := "%" + strings.ReplaceAll(query.Query, "\\", "") + "%"
|
||||
sess.Where("d.client_ip "+s.sqlStore.GetDialect().LikeStr()+" ?", queryWithWildcards)
|
||||
sql, param := s.sqlStore.GetDialect().LikeOperator("d.client_ip", true, strings.ReplaceAll(query.Query, "\\", ""), true)
|
||||
sess.Where(sql, param)
|
||||
}
|
||||
|
||||
// get total
|
||||
|
||||
Reference in New Issue
Block a user