This commit is contained in:
Aliaksandr Valialkin 2024-05-01 10:42:39 +02:00
parent efe5ec623c
commit d7def4aa2d
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB
2 changed files with 2 additions and 2 deletions

View file

@ -815,7 +815,7 @@ func TestParseQuerySuccess(t *testing.T) {
f(`foo|fields *`, `foo | fields *`)
f(`foo | fields bar`, `foo | fields bar`)
f(`foo|FIELDS bar,Baz , "a,b|c"`, `foo | fields bar, Baz, "a,b|c"`)
f(`foo | Fields x.y:z/a, _b$c`, `foo | fields "x.y:z/a", "_b$c"`)
f(`foo | Fields x.y, "abc:z/a", _b$c`, `foo | fields x.y, "abc:z/a", "_b$c"`)
// multiple fields pipes
f(`foo | fields bar | fields baz, abc`, `foo | fields bar | fields baz, abc`)

View file

@ -512,7 +512,7 @@ func parseFieldName(lex *lexer) (string, error) {
if lex.isKeyword(",", "(", ")", "[", "]", "|", "") {
return "", fmt.Errorf("unexpected token: %q", lex.token)
}
token := getCompoundToken(lex)
token := getCompoundPhrase(lex, true)
return token, nil
}