diff --git a/pkg/tsdb/grafana-postgresql-datasource/postgres_snapshot_test.go b/pkg/tsdb/grafana-postgresql-datasource/postgres_snapshot_test.go index df7a226f202..a9582ec7222 100644 --- a/pkg/tsdb/grafana-postgresql-datasource/postgres_snapshot_test.go +++ b/pkg/tsdb/grafana-postgresql-datasource/postgres_snapshot_test.go @@ -98,7 +98,8 @@ func TestIntegrationPostgresSnapshots(t *testing.T) { format string }{ {format: "time_series", name: "simple"}, - {format: "time_series", name: "no_rows"}, + {format: "time_series", name: "no_rows_long"}, + {format: "time_series", name: "no_rows_wide"}, {format: "time_series", name: "7x_compat_metric_label"}, {format: "time_series", name: "convert_to_float64"}, {format: "time_series", name: "convert_to_float64_not"}, diff --git a/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows.golden.jsonc b/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_long.golden.jsonc similarity index 100% rename from pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows.golden.jsonc rename to pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_long.golden.jsonc diff --git a/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows.sql b/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_long.sql similarity index 100% rename from pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows.sql rename to pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_long.sql diff --git a/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_wide.golden.jsonc b/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_wide.golden.jsonc new file mode 100644 index 00000000000..2cc0ccc47b8 --- /dev/null +++ b/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_wide.golden.jsonc @@ -0,0 +1,36 @@ +// 🌟 This was machine generated. Do not edit. 🌟 +// +// Frame[0] { +// "typeVersion": [ +// 0, +// 0 +// ], +// "executedQueryString": "SELECT * FROM tbl WHERE false" +// } +// Name: +// Dimensions: 0 Fields by 0 Rows +// + +// + +// +// +// 🌟 This was machine generated. Do not edit. 🌟 +{ + "status": 200, + "frames": [ + { + "schema": { + "meta": { + "typeVersion": [ + 0, + 0 + ], + "executedQueryString": "SELECT * FROM tbl WHERE false" + }, + "fields": [] + }, + "data": { + "values": [] + } + } + ] +} \ No newline at end of file diff --git a/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_wide.sql b/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_wide.sql new file mode 100644 index 00000000000..b34df7a0650 --- /dev/null +++ b/pkg/tsdb/grafana-postgresql-datasource/testdata/time_series/no_rows_wide.sql @@ -0,0 +1,10 @@ +-- SELECT * FROM tbl WHERE false +CREATE TEMPORARY TABLE tbl ( + "time" timestamp with time zone, + v1 double precision, + v2 double precision +); + +INSERT INTO tbl ("time", v1, v2) VALUES +('2023-12-24 14:30:03 UTC', 10, 110), +('2023-12-24 14:31:03 UTC', 20, 120); \ No newline at end of file