You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the code, it seems like an oversight, but PG::Connection#initialize was previously implemented entirely in C, ending with this code:
if (rb_block_given_p()) {
returnrb_ensure(rb_yield, self, pgconn_finish, self);
}
In v1.3.0, the class function new is replaced with Ruby code here.
defnew(*args, **kwargs)conn=self.connect_start(*args, **kwargs)orraise(PG::Error,"Unable to create a new connection")raise(PG::ConnectionBad,conn.error_message)ifconn.status == PG::CONNECTION_BADconn.send(:async_connect_or_reset,:connect_poll)end
The C implementation retains the semantics in connect_start (including a comment on 308 explaining it's role), but the block is not passed from new to connect_start in order to be called on line 326.
Looking at the code, it seems like an oversight, but
PG::Connection#initialize
was previously implemented entirely in C, ending with this code:In v1.3.0, the class function
new
is replaced with Ruby code here.The C implementation retains the semantics in
connect_start
(including a comment on 308 explaining it's role), but the block is not passed fromnew
toconnect_start
in order to be called on line 326.An example of some code that previously worked:
With v1.3.0 and later, the inner block is not called.
The text was updated successfully, but these errors were encountered: