Merge branch 'develop' into fix/remove-fe-owner

This commit is contained in:
Chintan Sudani 2023-03-31 12:10:11 +05:30 committed by GitHub
commit c9db4c9051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -173,9 +173,9 @@ func parseLogQuery(query string) ([]string, error) {
searchString := strings.TrimSpace(strings.Split(v, op)[1])
operatorRemovedTokens := strings.Split(operatorRegex.ReplaceAllString(v, " "), " ")
searchCol := strings.ToLower(operatorRemovedTokens[0])
if searchCol == AND || searchCol == OR {
searchCol = strings.ToLower(operatorRemovedTokens[1])
searchCol := operatorRemovedTokens[0]
if strings.ToLower(searchCol) == AND || strings.ToLower(searchCol) == OR {
searchCol = operatorRemovedTokens[1]
}
col := searchCol
if strings.ToLower(searchCol) == "fulltext" {

View File

@ -97,6 +97,11 @@ var correctQueriesTest = []struct {
`id.userid in (100) and id_userid gt 50`,
[]string{`id.userid IN (100) `, `and id_userid > 50 `},
},
{
`filters with case sensitive key name`,
`userIdentifier in ('user') and userIdentifier contains 'user'`,
[]string{`userIdentifier IN ('user') `, `AND userIdentifier ILIKE '%user%' `},
},
}
func TestParseLogQueryCorrect(t *testing.T) {