Commit 3bbc86bc by Torkel Ödegaard

Merge pull request #4719 from nlf/master

dont quote numbers for influxdb, closes #4163
parents 8b656f15 b6de656c
...@@ -152,7 +152,9 @@ export default class InfluxQuery { ...@@ -152,7 +152,9 @@ export default class InfluxQuery {
if (interpolate) { if (interpolate) {
value = this.templateSrv.replace(value, this.scopedVars); value = this.templateSrv.replace(value, this.scopedVars);
} }
if (isNaN(+value)) {
value = "'" + value.replace('\\', '\\\\') + "'"; value = "'" + value.replace('\\', '\\\\') + "'";
}
} else if (interpolate){ } else if (interpolate){
value = this.templateSrv.replace(value, this.scopedVars, 'regex'); value = this.templateSrv.replace(value, this.scopedVars, 'regex');
} }
......
...@@ -25,8 +25,8 @@ function (_) { ...@@ -25,8 +25,8 @@ function (_) {
} }
} }
// quote value unless regex // quote value unless regex or number
if (operator !== '=~' && operator !== '!~') { if (operator !== '=~' && operator !== '!~' && isNaN(+value)) {
value = "'" + value + "'"; value = "'" + value + "'";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment