facebook/presto — pull request #2049 by FanTn (2014-12-03 07:16:38+00:00)
Title: Fix an issue when using row_number and limit together

RowNumberOperator.isFinished() will never return true when the query like this:

select a.id ,row_number() over() as rn from
test a left join
null_test b on a.id = b.id
where b.id = 2
limit 20;

The null_test is empty.The query will hang and never finish.