-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and improve PG::Result#stream_each_tuple
This fixes a double free of pgresult which happend when the block of stream_each_tuple raised an exception. That is prevented now by setting pgresult to NULL before the rb_yield call. This commit also fixes typemap use in combination with stream_each_tuple. Before the typemap of the connection was used in PG::Tuple instead of the typemap of the base result. While being at it, I also improved the performance of stream_each_tuple. The per-tuple PG::Result is now copied per memcpy instead of being initialized based on the connection. It also shares field names between all PG::Tuple objects now, instead of repeated allocation of the same values.
- Loading branch information
Showing
2 changed files
with
90 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters