diff --git a/pkg/tsdb/mysql/macros.go b/pkg/tsdb/mysql/macros.go index 5577819d784..0c57be1ddd1 100644 --- a/pkg/tsdb/mysql/macros.go +++ b/pkg/tsdb/mysql/macros.go @@ -9,7 +9,7 @@ import ( //const rsString = `(?:"([^"]*)")`; const rsIdentifier = `([_a-zA-Z0-9]+)` -const sExpr = `\$` + rsIdentifier + `\((.*)\)` +const sExpr = `\$` + rsIdentifier + `\(([^\)]*)\)` type SqlMacroEngine interface { Interpolate(sql string) (string, error) diff --git a/pkg/tsdb/mysql/macros_test.go b/pkg/tsdb/mysql/macros_test.go index a1af3caf62d..6fc84fa3b1e 100644 --- a/pkg/tsdb/mysql/macros_test.go +++ b/pkg/tsdb/mysql/macros_test.go @@ -19,6 +19,15 @@ func TestMacroEngine(t *testing.T) { So(sql, ShouldEqual, "select UNIX_TIMESTAMP(time_column) as time_sec") }) + Convey("interpolate __time function wrapped in aggregation", func() { + engine := &MySqlMacroEngine{} + + sql, err := engine.Interpolate("select min($__time(time_column))") + So(err, ShouldBeNil) + + So(sql, ShouldEqual, "select min(UNIX_TIMESTAMP(time_column)) as time_sec)") + }) + Convey("interpolate __timeFilter function", func() { engine := &MySqlMacroEngine{ TimeRange: &tsdb.TimeRange{From: "5m", To: "now"}, diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 1f0df861613..63fdba693cb 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -144,7 +144,6 @@ module.directive('grafanaPanel', function($rootScope, $document) { function updatePanelCornerInfo() { var cornerMode = ctrl.getInfoMode(); - console.log('update error', cornerMode); cornerInfoElem[0].className = 'panel-info-corner panel-info-corner--' + cornerMode; if (cornerMode) { diff --git a/public/app/plugins/datasource/mysql/module.ts b/public/app/plugins/datasource/mysql/module.ts index 8cff67ff1af..315e11b637a 100644 --- a/public/app/plugins/datasource/mysql/module.ts +++ b/public/app/plugins/datasource/mysql/module.ts @@ -14,7 +14,7 @@ class MysqlQueryCtrl extends QueryCtrl { super($scope, $injector); this.target.resultFormat = 'time_series'; - this.target.alias = "{{table}}{{col_3}}"; + this.target.alias = ""; this.resultFormats = [ {text: 'Time series', value: 'time_series'}, {text: 'Table', value: 'table'}, diff --git a/tasks/default_task.js b/tasks/default_task.js index 76e11444ddf..60ccf158d3c 100644 --- a/tasks/default_task.js +++ b/tasks/default_task.js @@ -14,12 +14,12 @@ module.exports = function(grunt) { ); grunt.registerTask('default', [ + 'clean:gen', 'jscs', 'jshint', 'copy:node_modules', 'copy:public_to_gen', 'exec:tslint', - 'clean:gen', 'phantomjs', 'css', 'exec:tscompile'