silverstripe/sapphire — pull request #887 by tractorcow (2012-10-17 23:52:58+00:00)
Title: BUG Fixed isue with SQLQuery->lastRow()

SQLQuery->lastRow() would crash on an empty result set; The code would try to call $this->setLimit(1, -1) which of course will fail.

This has been fixed in code and added test cases to check for correct behaviour of both firstRow() and lastRow().