fix(predicate): add some other values
parent
5bc1d755a9
commit
c17a3b97ef
|
@ -176,12 +176,17 @@ func (p *parser) parseTagRuleNode() (TagRuleNode, error) {
|
|||
scanRegularTagValue:
|
||||
tok, pos, lit = p.scanIgnoreWhitespace()
|
||||
switch tok {
|
||||
case influxql.SUB:
|
||||
n.Value = "-"
|
||||
goto scanRegularTagValue
|
||||
case influxql.IDENT:
|
||||
fallthrough
|
||||
case influxql.DURATIONVAL:
|
||||
fallthrough
|
||||
case influxql.NUMBER:
|
||||
fallthrough
|
||||
case influxql.INTEGER:
|
||||
n.Value = lit
|
||||
n.Value += lit
|
||||
return *n, nil
|
||||
case influxql.TRUE:
|
||||
n.Value = "true"
|
||||
|
|
|
@ -85,6 +85,22 @@ func TestParseTagRule(t *testing.T) {
|
|||
str: ` abc = "opq"`,
|
||||
node: TagRuleNode{Tag: influxdb.Tag{Key: "abc", Value: "opq"}},
|
||||
},
|
||||
{
|
||||
str: `abc=0x1231`,
|
||||
node: TagRuleNode{Tag: influxdb.Tag{Key: "abc", Value: "0x1231"}},
|
||||
},
|
||||
{
|
||||
str: `abc=2d`,
|
||||
node: TagRuleNode{Tag: influxdb.Tag{Key: "abc", Value: "2d"}},
|
||||
},
|
||||
{
|
||||
str: `abc=-5i`,
|
||||
node: TagRuleNode{Tag: influxdb.Tag{Key: "abc", Value: "-5i"}},
|
||||
},
|
||||
{
|
||||
str: `abc= -1221`,
|
||||
node: TagRuleNode{Tag: influxdb.Tag{Key: "abc", Value: "-1221"}},
|
||||
},
|
||||
{
|
||||
str: ` abc != "opq"`,
|
||||
err: &influxdb.Error{
|
||||
|
|
Loading…
Reference in New Issue