mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(influxdb_09): fixed handling of regex measurement in explore queries, fixes #2415
This commit is contained in:
parent
4c7e52288d
commit
7cae087eb9
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user