Commit 7cae087e by Torkel Ödegaard

fix(influxdb_09): fixed handling of regex measurement in explore queries, fixes #2415

parent 4c7e5228
......@@ -44,7 +44,10 @@ function (_) {
}
if (measurement) {
query += ' FROM "' + measurement + '"';
if (!measurement.match('^/.*/') && !measurement.match(/^merge\(.*\)/)) {
measurement = '"' + measurement+ '"';
}
query += ' FROM ' + measurement;
}
if (withKey) {
......
......@@ -102,6 +102,12 @@ define([
expect(query).to.be('SHOW TAG KEYS FROM "cpu"');
});
it('should handle regex measurement in tag keys query', function() {
var builder = new InfluxQueryBuilder({ measurement: '/.*/', tags: [] });
var query = builder.buildExploreQuery('TAG_KEYS');
expect(query).to.be('SHOW TAG KEYS FROM /.*/');
});
it('should have no conditions in tags keys query given query with no measurement or tag', function() {
var builder = new InfluxQueryBuilder({ measurement: '', tags: [] });
var query = builder.buildExploreQuery('TAG_KEYS');
......
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