tmtm / ruby-mysql

MySQL connector for Ruby. pure Ruby version.
MIT License
143 stars 34 forks source link

ResultSet#each and Statement#each should splat record passed to block #18

Open jstewmon opened 11 years ago

jstewmon commented 11 years ago

This PR is based on tag 2.9.9. Github is not allowing a tag to be specified as the base branch.

If the record is not splatted, a block that processes a result set that contains a single column receives the column as an array with a single value.

The problem is demonstrated by many of the tests that already existed, so no new tests are provided with this commit. Instead, all of the tests that demonstrated this problem have been updated so that queries returning a single column use the value of that column without wrapping it in an array.