From f976e465c47f7c8141fd8f2815eb4cfa4e9e431c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 11 May 2017 11:06:13 +0200 Subject: [PATCH] mysql: minor improvement for table panel --- public/app/plugins/datasource/mysql/query_ctrl.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/mysql/query_ctrl.ts b/public/app/plugins/datasource/mysql/query_ctrl.ts index 17242fac1f0..889855a343a 100644 --- a/public/app/plugins/datasource/mysql/query_ctrl.ts +++ b/public/app/plugins/datasource/mysql/query_ctrl.ts @@ -48,7 +48,14 @@ export class MysqlQueryCtrl extends QueryCtrl { ]; if (!this.target.rawSql) { - this.target.rawSql = defaulQuery; + + // special handling when in table panel + if (this.panelCtrl.panel.type === 'table') { + this.target.format = 'table'; + this.target.rawSql = "SELECT 1"; + } else { + this.target.rawSql = defaulQuery; + } } this.panelCtrl.events.on('data-received', this.onDataReceived.bind(this), $scope);