Merge pull request #7919 from influxdata/js-7910-backport
Fix EvalType when a parenthesis expression is usedpull/7929/head
commit
9b0e696deb
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
- [#7877](https://github.com/influxdata/influxdb/issues/7877): Fix mapping of types when the measurement uses a regex
|
- [#7877](https://github.com/influxdata/influxdb/issues/7877): Fix mapping of types when the measurement uses a regex
|
||||||
- [#7888](https://github.com/influxdata/influxdb/pull/7888): Expand query dimensions from the subquery.
|
- [#7888](https://github.com/influxdata/influxdb/pull/7888): Expand query dimensions from the subquery.
|
||||||
|
- [#7910](https://github.com/influxdata/influxdb/issues/7910): Fix EvalType when a parenthesis expression is used.
|
||||||
|
|
||||||
## v1.2.0 [2017-01-24]
|
## v1.2.0 [2017-01-24]
|
||||||
|
|
||||||
|
|
|
@ -4490,7 +4490,7 @@ func EvalType(expr Expr, sources Sources, typmap TypeMapper) DataType {
|
||||||
return EvalType(expr.Args[0], sources, typmap)
|
return EvalType(expr.Args[0], sources, typmap)
|
||||||
}
|
}
|
||||||
case *ParenExpr:
|
case *ParenExpr:
|
||||||
return EvalType(expr, sources, typmap)
|
return EvalType(expr.Expr, sources, typmap)
|
||||||
case *NumberLiteral:
|
case *NumberLiteral:
|
||||||
return Float
|
return Float
|
||||||
case *IntegerLiteral:
|
case *IntegerLiteral:
|
||||||
|
|
|
@ -1136,6 +1136,16 @@ func TestEvalType(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: `value inside a parenthesis`,
|
||||||
|
in: `(value)`,
|
||||||
|
typ: influxql.Float,
|
||||||
|
data: EvalFixture{
|
||||||
|
"cpu": map[string]influxql.DataType{
|
||||||
|
"value": influxql.Float,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
} {
|
} {
|
||||||
sources := make([]influxql.Source, 0, len(tt.data))
|
sources := make([]influxql.Source, 0, len(tt.data))
|
||||||
for src := range tt.data {
|
for src := range tt.data {
|
||||||
|
|
Loading…
Reference in New Issue