Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 526e176

Browse files
authored
Fixing nil rhs branch in InfixOp (#211)
1 parent 7494707 commit 526e176

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

quesma/queryparser/query_parser.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package queryparser
33
import (
44
"encoding/json"
55
"fmt"
6-
"github.com/k0kubun/pp"
7-
"github.com/relvacode/iso8601"
86
"mitmproxy/quesma/clickhouse"
97
"mitmproxy/quesma/logger"
108
"mitmproxy/quesma/model"
@@ -16,6 +14,9 @@ import (
1614
"strconv"
1715
"strings"
1816
"unicode"
17+
18+
"github.com/k0kubun/pp"
19+
"github.com/relvacode/iso8601"
1920
)
2021

2122
type QueryMap = map[string]interface{}
@@ -555,7 +556,9 @@ func (cw *ClickhouseQueryTranslator) parseMatch(queryMap QueryMap, matchPhrase b
555556
cw.AddTokenToHighlight(vUnNested)
556557

557558
// so far we assume that only strings can be ORed here
558-
return model.NewSimpleQuery(model.NewSimpleStatement(strconv.Quote(fieldName)+" == "+sprint(vUnNested)), true)
559+
statement := model.NewSimpleStatement(strconv.Quote(fieldName) + " == " + sprint(vUnNested))
560+
statement.WhereStatement = wc.NewInfixOp(wc.NewColumnRef(fieldName), "==", wc.NewLiteral(sprint(vUnNested)))
561+
return model.NewSimpleQuery(statement, true)
559562
}
560563

561564
// unreachable unless something really weird happens

0 commit comments

Comments
 (0)