fix(predicate/parser): updated case statement for NotEqual on deleteWithPredicate API (#15799)

* fix(predicate/parser): updated case statement for NotEqual on deleteWithPredicate API
pull/15845/head
Ariel Salem 2019-11-07 12:24:38 -08:00 committed by GitHub
parent 238842cb79
commit 591f2870d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 14 deletions

View File

@ -77,13 +77,7 @@ func (p *parser) parseLogicalNode() (Node, error) {
for {
tok, pos, _ := p.scanIgnoreWhitespace()
switch tok {
case influxql.NUMBER:
fallthrough
case influxql.INTEGER:
fallthrough
case influxql.NAME:
fallthrough
case influxql.IDENT:
case influxql.NUMBER, influxql.INTEGER, influxql.NAME, influxql.IDENT:
p.unscan()
tr, err := p.parseTagRuleNode()
if err != nil {
@ -181,7 +175,8 @@ func (p *parser) parseTagRuleNode() (TagRuleNode, error) {
n.Operator = influxdb.Equal
goto scanRegularTagValue
case influxql.NEQ:
fallthrough
n.Operator = influxdb.NotEqual
goto scanRegularTagValue
case influxql.EQREGEX:
fallthrough
case influxql.NEQREGEX:

View File

@ -117,11 +117,8 @@ func TestParseTagRule(t *testing.T) {
node: TagRuleNode{Tag: influxdb.Tag{Key: "abc", Value: "-1221"}},
},
{
str: ` abc != "opq"`,
err: &influxdb.Error{
Code: influxdb.EInvalid,
Msg: `operator: "!=" at position: 5 is not supported yet`,
},
str: ` abc != "opq"`,
node: TagRuleNode{Tag: influxdb.Tag{Key: "abc", Value: "opq"}, Operator: influxdb.NotEqual},
},
{
str: `abc=123`,

View File

@ -13,7 +13,9 @@ describe('Bucket Selector', () => {
expect(isSystemBucket(`naming_${SYSTEM}`)).toEqual(false)
expect(isSystemBucket('SYSTEM')).toEqual(false)
})
it('should sort the bucket names alphabetically', () => {
// skipping this test for now as it's flakey. Issue has been raise:
// https://github.com/influxdata/influxdb/issues/15798
it.skip('should sort the bucket names alphabetically', () => {
const buckets: Bucket[] = [
{
id: '7902bd683453c00c',