influxdb: check for invalid program-flow (#37474)

pull/37742/head
Gábor Farkas 4 years ago committed by GitHub
parent 707d3536f0
commit 476a227505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      public/app/plugins/datasource/influxdb/datasource.ts

@ -182,10 +182,12 @@ export default class InfluxDatasource extends DataSourceWithBackend<InfluxQuery,
return true;
}
/**
* Only applied on flux queries
*/
applyTemplateVariables(query: InfluxQuery, scopedVars: ScopedVars): Record<string, any> {
// this only works in flux-mode, it should not be called in non-flux-mode
if (!this.isFlux) {
throw new Error('applyTemplateVariables called in influxql-mode. this should never happen');
}
return {
...query,
query: this.templateSrv.replace(query.query ?? '', scopedVars), // The raw query text

Loading…
Cancel
Save