DB crash after running the add calculation in SQL-like query
I have a measurement like ABC and it has columns like count_a and count_b. When I exec query like : select count_a + count_b from ABC where time > now() - 10m The influxdb process crash.
Here is the error log: (the match data number is around 500)
[query] 2015/09/25 14:36:25 SELECT (bdg_count + conn_count) FROM "rtls"."default"."2.bs.status" WHERE time > now() - 1h panic: runtime error: index out of range
goroutine 307 [running]: github.com/influxdb/influxdb/influxql.newEchoProcessor.func1(0xc820491820, 0x2, 0x2, 0x0, 0x0) /tmp/build/src/github.com/influxdb/influxdb/influxql/result.go:151 +0x42 github.com/influxdb/influxdb/influxql.newBinaryExprEvaluator.func1(0xc820491820, 0x2, 0x2, 0x0, 0x0) /tmp/build/src/github.com/influxdb/influxdb/influxql/result.go:173 +0xb3 github.com/influxdb/influxdb/tsdb.processForMath(0xc8204c6030, 0x1, 0x1, 0xc82033a000, 0x2b, 0x40, 0x0, 0x0, 0x0) /tmp/build/src/github.com/influxdb/influxdb/tsdb/executor.go:989 +0x44c github.com/influxdb/influxdb/tsdb.(_limitedRowWriter).processValues(0xc82041c0c0, 0xc820326000, 0x2b, 0x2710, 0x0) /tmp/build/src/github.com/influxdb/influxdb/tsdb/executor.go:882 +0xdb1 github.com/influxdb/influxdb/tsdb.(_limitedRowWriter).Flush(0xc82041c0c0) /tmp/build/src/github.com/influxdb/influxdb/tsdb/executor.go:783 +0xb5 github.com/influxdb/influxdb/tsdb.(_SelectExecutor).executeRaw(0xc8204045d0, 0xc8205eb080) /tmp/build/src/github.com/influxdb/influxdb/tsdb/executor.go:251 +0x52b created by github.com/influxdb/influxdb/tsdb.(_SelectExecutor).Execute /tmp/build/src/github.com/influxdb/influxdb/tsdb/executor.go:94 +0xa1
goroutine 1 [chan receive, 4 minutes]: main.(*Main).Run(0xc8205d3f10, 0xc82000a0b0, 0x4, 0x4, 0x0, 0x0) /tmp/build/src/github.com/influxdb/influxdb/cmd/influxd/main.go:91 +0xa16 main.main() /tmp/build/src/github.com/influxdb/influxdb/cmd/influxd/main.go:42 +0x29b
goroutine 17 [syscall, 4 minutes, locked to thread]: runtime.goexit() /home/philip/.gvm/gos/go1.5/src/runtime/asm_amd64.s:1696 +0x1 goroutine 5 [syscall, 4 minutes]: os/signal.loop() /home/philip/.gvm/gos/go1.5/src/os/signal/signal_unix.go:22 +0x18 created by os/signal.init.1 /home/philip/.gvm/gos/go1.5/src/os/signal/signal_unix.go:28 +0x37
goroutine 34 [IO wait, 4 minutes]: net.runtime_pollWait(0x7ffbb1705068, 0x72, 0xc82000e1d0) /home/philip/.gvm/gos/go1.5/src/runtime/netpoll.go:157 +0x60 net.(_pollDesc).Wait(0xc820146370, 0x72, 0x0, 0x0) /home/philip/.gvm/gos/go1.5/src/net/fd_poll_runtime.go:73 +0x3a net.(_pollDesc).WaitRead(0xc820146370, 0x0, 0x0) /home/philip/.gvm/gos/go1.5/src/net/fd_poll_runtime.go:78 +0x36 net.(_netFD).accept(0xc820146310, 0x0, 0x7ffbb1743208, 0xc820632000) /home/philip/.gvm/gos/go1.5/src/net/fd_unix.go:408 +0x27c net.(_TCPListener).AcceptTCP(0xc82013a088, 0xc820045ec8, 0x0, 0x0) /home/philip/.gvm/gos/go1.5/src/net/tcpsock_posix.go:254 +0x4d net.(_TCPListener).Accept(0xc82013a088, 0x0, 0x0, 0x0, 0x0) /home/philip/.gvm/gos/go1.5/src/net/tcpsock_posix.go:264 +0x3d github.com/influxdb/influxdb/tcp.(_Mux).Serve(0xc820141080, 0x7ffbb17051f0, 0xc82013a088, 0x0, 0x0) /tmp/build/src/github.com/influxdb/influxdb/tcp/mux.go:48 +0x4b created by github.com/influxdb/influxdb/cmd/influxd/run.(*Server).Open.func1 /tmp/build/src/github.com/influxdb/influxdb/cmd/influxd/run/server.go:345 +0xae9 ---skipped---
Not sure if it is an expected result but I just report for your checking. It is okay to not support add calculation of 2 columns but the influxdb process cannot be crashed by some unsupported query.
BTW, the influxdb version is 0.9.4.1
Dupe of #4046