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
Don't call mysql_close() when InactiveDestroy is set
Without this change, the END block of DBI would call disconnect_all()
and that would call mysql_close() on all open connections. This is bad
because forks would destroy their parent's context on exit as shown in
the example for AutoInactiveDestroy in the DBI docs.
This example fails with "DBD::MariaDB::db do failed: Lost connection to
MySQL server during query" without this fix:
$dbh->{'AutoInactiveDestroy'} = 1;
if (my $pid = fork()) {
waitpid($pid, 0);
$dbh->do('SELECT 1');
} else {
exit(0);
}
0 commit comments