From d80ce7526c14db8737febb824347c1ee09af2707 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Mon, 1 Feb 2010 13:16:24 -0800 Subject: 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 --- Bugzilla/DB/Mysql.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index da3e301a9..daf34d04e 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. -- cgit v1.2.3-24-g4f1b