georgiev / rubyfb

ruby/rails Firebird db access library
Other
16 stars 5 forks source link

Make #fetch() *always* return nil if #exhausted? #2

Closed pilcrow closed 13 years ago

pilcrow commented 13 years ago

Issue

Calling #fetch on an #exhausted? result set throws a Firebird "Request Synchronization Error," rather than repeatedly returning nil, as I'd expect from the documentation.

How to reproduce

See new unit test added in this pull request. Or, issue a SELECT, iterate with #each() or any Enumerable method on the ResultSet, and then call #fetch().

Proposed fixes

A few ways I can think of: