From: Max Kanat-Alexander Date: Wed, 17 Mar 2010 08:38:32 +0000 (-0700) Subject: Bug 538705: Prevent database connections from timing out during long X-Git-Tag: bugzilla-3.4.7~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dfde8e8c8e53b4e161e68b589d1ff35408fb6d4;p=thirdparty%2Fbugzilla.git Bug 538705: Prevent database connections from timing out during long jobqueue.pl runs. r=LpSolit, a=mkanat --- diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 4f6f9d76fa..3a1c4ae6c0 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.