Skip to content

Commit 5d03b18

Browse files
committed
Prevent panic in column type detection
1 parent 7ddf9f7 commit 5d03b18

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/tsdb/druid/column_type.go

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import (
77
)
88

99
func detectColumnType(c *responseColumn, pos int, rows [][]interface{}) {
10+
if len(rows) == 0 {
11+
c.Type = ColumnString
12+
return
13+
}
1014
t := map[columnType]int{"nil": 0}
1115
maxRowsToScan := (len(rows) / 5) + 1
1216
for _, row := range rows[:maxRowsToScan] {

0 commit comments

Comments
 (0)