Only relevant (at the moment) to people using client.socket from ruby, but client->closed = 0 in C occurs too early - after mysql_init, instead of when client->net.fd is actually set, which is after mysql_real_connect returns.
client->closed = 0
Simply moving client->closed = 0 however is not enough, since nogvl_close should still call mysql_close/xfree even if mysql_real_connect was never called. So, I'm filing this ticket until someone can add an "initialized" state or similar.
I don't understand what's going on here. Could you post some sample code to help describe the problem?
I forget why I was using the socket from ruby, but I made this note after working with the C code for a bit. If no one else uses the socket it probably doesn't matter.