From 9a3a005c916479faef417f8e9437f2bf1b38ecdd Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 8 Dec 2021 10:19:42 +0000 Subject: add where clause integration test to dmap1, all mapreduce token fields are lower case --- internal/mapr/token.go | 4 ++-- internal/mapr/wherecondition.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'internal') diff --git a/internal/mapr/token.go b/internal/mapr/token.go index 6ac7631..bbf4890 100644 --- a/internal/mapr/token.go +++ b/internal/mapr/token.go @@ -37,7 +37,7 @@ func tokenize(queryStr string) []token { commasStripped := strings.Replace(part, ",", " ", -1) for _, tokenStr := range strings.Fields(commasStripped) { token := token{ - str: tokenStr, + str: strings.ToLower(tokenStr), isBareword: true, } tokens = append(tokens, token) @@ -71,7 +71,7 @@ func tokensConsume(tokens []token) ([]token, []token) { stripped := t.str[1 : length-1] //dlog.Common.Trace("stripped", stripped) t := token{ - str: stripped, + str: strings.ToLower(stripped), isBareword: t.isBareword, } consumed = append(consumed, t) diff --git a/internal/mapr/wherecondition.go b/internal/mapr/wherecondition.go index 280dcfb..c2dd2a1 100644 --- a/internal/mapr/wherecondition.go +++ b/internal/mapr/wherecondition.go @@ -54,6 +54,7 @@ func (wc *whereCondition) String() string { func makeWhereConditions(tokens []token) (where []whereCondition, err error) { parse := func(tokens []token) (whereCondition, []token, error) { + var wc whereCondition if len(tokens) < 3 { err := errors.New(invalidQuery + "Not enough arguments in 'where' clause") -- cgit v1.2.3