Found that given two rollups:
(dr_stats_hourly,Druid,1600,9993,8675309)
(dr_teacher_stats_hourly,Druid,1600,9992,8675309)
With same cost (1600) and Engine (Druid), Level is not factored into old logic:
if (a._2 == b._2) { if (a._4 == b._4) { a._3 < b._3 } else { a._4 < b._4 } } else { if (a._5 == b._5) { a._3 < b._3 } else { a._5 < b._5 } }
This case drops into
if (a._5 == b._5) { a._3 < b._3 }
This if-clause which causes errors.
Adding in the same check made on the IF case fixes this.
#765