Commit 3aa47909 by Sven Klemm

add tests for metric column prefix to mssql

parent e487fabc
......@@ -610,6 +610,31 @@ func TestMSSQL(t *testing.T) {
So(queryResult.Series[1].Name, ShouldEqual, "valueTwo")
})
Convey("When doing a metric query with metric column and multiple value columns", func() {
query := &tsdb.TsdbQuery{
Queries: []*tsdb.Query{
{
Model: simplejson.NewFromAny(map[string]interface{}{
"rawSql": "SELECT $__timeEpoch(time), measurement AS metric, valueOne, valueTwo FROM metric_values ORDER BY 1",
"format": "time_series",
}),
RefId: "A",
},
},
}
resp, err := endpoint.Query(nil, nil, query)
So(err, ShouldBeNil)
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
So(len(queryResult.Series), ShouldEqual, 4)
So(queryResult.Series[0].Name, ShouldEqual, "Metric A valueOne")
So(queryResult.Series[1].Name, ShouldEqual, "Metric A valueTwo")
So(queryResult.Series[2].Name, ShouldEqual, "Metric B valueOne")
So(queryResult.Series[3].Name, ShouldEqual, "Metric B valueTwo")
})
Convey("Given a stored procedure that takes @from and @to in epoch time", func() {
sql := `
IF object_id('sp_test_epoch') IS NOT NULL
......
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