influxdb/influxdb — pull request #587 by chobie (2014-05-28 14:27:28+00:00)
Title: fixed index out of range.

How to reproduce this issue:

* create unwanted series (for example: columns and fields count mismatched. put 2 fields, put 1 column)
* insert data with modified client library.

then, InfluxDB will panic with following message

```
panic: runtime error: index out of range

goroutine 20 [running]:
runtime.panic(0x8a9040, 0x104d997)
/usr/local/go/src/pkg/runtime/panic.c:266 +0xb6
datastore.(*LevelDbShard).Write(0xc2100b0480, 0xc211182a80, 0xa,
0xc210405408, 0x1, ...)
/home/chobie/src/influxdb/src/datastore/leveldb_shard.go:89
+0x98f
datastore.(*LevelDbShardDatastore).Write(0xc210077d80, 0xc21843eb00,
0x0, 0x0)
/home/chobie/src/influxdb/src/datastore/leveldb_shard_datastore.go:163
+0xf2
cluster.(*WriteBuffer).write(0xc2100d5150, 0xc21843eb00)
/home/chobie/src/influxdb/src/cluster/write_buffer.go:88 +0x86
cluster.(*WriteBuffer).handleWrites(0xc2100d5150)
/home/chobie/src/influxdb/src/cluster/write_buffer.go:79 +0xb7
created by cluster.NewWriteBuffer
/home/chobie/src/influxdb/src/cluster/write_buffer.go:43 +0x24f
```

I've noticed this potential issue when I develop binary protocol client.

Almost cases, this will not happen except using not mature client library.
But once this happen, we have to remove WAL log otherwise InfluxDB will panic every recovering from log sequence.

I'm not sure this is good. for now, send quick patch.