Panic:runtime error: index out of range after upgrading to 1.3 to 1.6

#1

I’m getting a panic error when querying a large number of series.

Case 1 - one series

> SELECT "SensorId","2002" FROM Reading WHERE "SensorId"='17001' AND time > now()-1m ORDER BY time DESC tz('Asia/Kolkata');
name: Reading
time                      SensorId 2002
----                      -------- ----
2018-07-25T21:05:53+05:30 17001    1.6144
2018-07-25T21:05:38+05:30 17001    1.5099
2018-07-25T21:05:23+05:30 17001    1.7591
2018-07-25T21:05:08+05:30 17001    2.2847

Case 2 - 10 series

> SELECT "SensorId","2002" FROM Reading WHERE "SensorId" =~ /^1700[0-9]{1}$/ AND time > now()-1m ORDER BY time DESC LIMIT 5 tz('Asia/Kolkata');
name: Reading
time                      SensorId 2002
----                      -------- ----
2018-07-25T21:03:11+05:30 17009    3.0074
2018-07-25T21:03:11+05:30 17008    47.5647
2018-07-25T21:03:10+05:30 17006    38.8565
2018-07-25T21:03:10+05:30 17005    25.7809
2018-07-25T21:03:10+05:30 17007    22.3157

Case 3 - 100 series

> SELECT "SensorId","2002" FROM Reading WHERE "SensorId" =~ /^170[0-9]{2}$/ AND time > now()-1m ORDER BY time DESC LIMIT 5 tz('Asia/Kolkata');

name: Reading
time                      SensorId 2002
----                      -------- ----
2018-07-25T21:09:48+05:30 17058    166.2178
2018-07-25T21:09:48+05:30 17057    95.7444
2018-07-25T21:09:47+05:30 17056    311.7403
2018-07-25T21:09:47+05:30 17055    227.4399
2018-07-25T21:09:47+05:30 17054    796.9971

Case 4 - 1000 series

> SELECT "SensorId","2002" FROM Reading WHERE "SensorId" =~ /^17[0-9]{3}$/ AND time > now()-1m ORDER BY time DESC LIMIT 5 tz('Asia/Kolkata');

ERR: SELECT SensorId, "2002" FROM smartsense.autogen.Reading WHERE SensorId =~ /^17[0-9]{3}$/ AND time > now() - 1m ORDER BY time DESC LIMIT 5 TZ('Asia/Kolkata') [panic:runtime error: index out of range]

What changes do I need to make to resolve this error in 1.6?