Skip to content

Commit

Permalink
Fix tests and add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
shantanualsi committed Sep 29, 2023
1 parent 758c1b0 commit f52e2be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* [10620](https://github.com/grafana/loki/pull/10620) **ashwanthgoli** Enable embedded cache if no other cache is explicitly enabled.
* [10655](https://github.com/grafana/loki/pull/10655) **chaudum** Remove legacy ingester shutdown handler `/ingester/flush_shutdown`.
* [10693](https://github.com/grafana/loki/pull/10693) **ashwanthgoli** Embedded cache: Updates the metric prefix from `querier_cache_` to `loki_embeddedcache_` and removes duplicate metrics.
* [10733](https://github.com/grafana/loki/pull/10733) **shantanualsi** Add support for case-insensitive logql funtions

##### Fixes

Expand Down
7 changes: 4 additions & 3 deletions pkg/logql/syntax/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ func (l *lexer) Lex(lval *exprSymType) int {
return 0
}

tokenText := strings.ToLower(l.TokenText())
tokenText := l.TokenText()
tokenTextLower := strings.ToLower(l.TokenText())
tokenNext := strings.ToLower(tokenText + string(l.Peek()))

if tok, ok := functionTokens[tokenNext]; ok {
Expand All @@ -227,7 +228,7 @@ func (l *lexer) Lex(lval *exprSymType) int {
}
}

if tok, ok := functionTokens[tokenText]; ok {
if tok, ok := functionTokens[tokenTextLower]; ok {
if !isFunction(l.Scanner) {
lval.str = tokenText
return IDENTIFIER
Expand All @@ -240,7 +241,7 @@ func (l *lexer) Lex(lval *exprSymType) int {
return tok
}

if tok, ok := tokens[tokenText]; ok {
if tok, ok := tokens[tokenTextLower]; ok {
return tok
}

Expand Down

0 comments on commit f52e2be

Please sign in to comment.