SOLR-5354: applying hoss's patch to fix function edge case in distributed sort (merged trunk r1547430)