From: Max Kanat-Alexander Date: Mon, 1 Feb 2010 21:16:24 +0000 (-0800) Subject: Bug 538705: Assure that Bugzilla->dbh doesn't become invalid under MySQL during long... X-Git-Tag: bugzilla-3.5.3~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d80ce7526c14db8737febb824347c1ee09af2707;p=thirdparty%2Fbugzilla.git Bug 538705: Assure that Bugzilla->dbh doesn't become invalid under MySQL during long jobqueue.pl runs. Patch by Max Kanat-Alexander r=LpSolit, a=mkanat --- diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index da3e301a98..daf34d04ec 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -68,9 +68,13 @@ sub new { $dsn .= ";port=$port" if $port; $dsn .= ";mysql_socket=$sock" if $sock; - my $attrs = { mysql_enable_utf8 => Bugzilla->params->{'utf8'} }; + my %attrs = ( + mysql_enable_utf8 => Bugzilla->params->{'utf8'}, + # Needs to be explicitly specified for command-line processes. + mysql_auto_reconnect => 1, + ); - my $self = $class->db_new($dsn, $user, $pass, $attrs); + my $self = $class->db_new($dsn, $user, $pass, \%attrs); # This makes sure that if the tables are encoded as UTF-8, we # return their data correctly.