reverse range with select gives empty result. fixes #6534
Merge pull request #6538 from tanmaykm/tanmaykm

reverse range with select gives empty result. fixes #6534