mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
wip
This commit is contained in:
parent
62fc9479b2
commit
e1689e1300
4 changed files with 8 additions and 6 deletions
|
@ -19,6 +19,8 @@ according to [these docs](https://docs.victoriametrics.com/victorialogs/quicksta
|
|||
|
||||
## tip
|
||||
|
||||
* FEATURE: disallow unescaped `!` char in [LogsQL](https://docs.victoriametrics.com/victorialogs/logsql/) queries, since it permits writing incorrect query, which may look like correct one. For example, `foo!:bar` instead of `foo:!bar`.
|
||||
|
||||
## [v0.18.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.18.0-victorialogs)
|
||||
|
||||
Released at 2024-06-06
|
||||
|
|
|
@ -671,7 +671,7 @@ func parseGenericFilter(lex *lexer, fieldName string) (filter, error) {
|
|||
}
|
||||
|
||||
func getCompoundPhrase(lex *lexer, allowColon bool) (string, error) {
|
||||
stopTokens := []string{"*", ",", "(", ")", "[", "]", "|", ""}
|
||||
stopTokens := []string{"*", ",", "(", ")", "[", "]", "|", "!", ""}
|
||||
if lex.isKeyword(stopTokens...) {
|
||||
return "", fmt.Errorf("compound phrase cannot start with '%s'", lex.token)
|
||||
}
|
||||
|
@ -688,7 +688,7 @@ func getCompoundPhrase(lex *lexer, allowColon bool) (string, error) {
|
|||
|
||||
func getCompoundSuffix(lex *lexer, allowColon bool) string {
|
||||
s := ""
|
||||
stopTokens := []string{"*", ",", "(", ")", "[", "]", "|", ""}
|
||||
stopTokens := []string{"*", ",", "(", ")", "[", "]", "|", "!", ""}
|
||||
if !allowColon {
|
||||
stopTokens = append(stopTokens, ":")
|
||||
}
|
||||
|
@ -700,7 +700,7 @@ func getCompoundSuffix(lex *lexer, allowColon bool) string {
|
|||
}
|
||||
|
||||
func getCompoundToken(lex *lexer) (string, error) {
|
||||
stopTokens := []string{",", "(", ")", "[", "]", "|", ""}
|
||||
stopTokens := []string{",", "(", ")", "[", "]", "|", "!", ""}
|
||||
if lex.isKeyword(stopTokens...) {
|
||||
return "", fmt.Errorf("compound token cannot start with '%s'", lex.token)
|
||||
}
|
||||
|
|
|
@ -926,8 +926,8 @@ func TestParseQuerySuccess(t *testing.T) {
|
|||
f("foo-bar+baz*", `"foo-bar+baz"*`)
|
||||
f("foo- bar", `foo- bar`)
|
||||
f("foo -bar", `foo -bar`)
|
||||
f("foo!bar", `"foo!bar"`)
|
||||
f("foo:aa!bb:cc", `foo:"aa!bb:cc"`)
|
||||
f("foo!bar", `foo !bar`)
|
||||
f("foo:aa!bb:cc", `foo:aa !bb:cc`)
|
||||
f(`foo:bar:baz`, `foo:"bar:baz"`)
|
||||
f(`foo:(bar baz:xxx)`, `foo:bar foo:"baz:xxx"`)
|
||||
f(`foo:(_time:abc or not z)`, `foo:"_time:abc" or !foo:z`)
|
||||
|
|
|
@ -703,7 +703,7 @@ func parseMathExprFieldName(lex *lexer) (*mathExpr, error) {
|
|||
}
|
||||
|
||||
func getCompoundMathToken(lex *lexer) (string, error) {
|
||||
stopTokens := []string{"=", "+", "-", "*", "/", "%", "^", ",", ")", "|", ""}
|
||||
stopTokens := []string{"=", "+", "-", "*", "/", "%", "^", ",", ")", "|", "!", ""}
|
||||
if lex.isKeyword(stopTokens...) {
|
||||
return "", fmt.Errorf("compound token cannot start with '%s'", lex.token)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue