]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 538705: Assure that Bugzilla->dbh doesn't become invalid under MySQL during long...
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 1 Feb 2010 21:16:24 +0000 (13:16 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 1 Feb 2010 21:16:24 +0000 (13:16 -0800)
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat

Bugzilla/DB/Mysql.pm

index da3e301a98c6f30cff32fec63d2760151b00c043..daf34d04ece206ba52b1cb8209567d1e1d5c6017 100644 (file)
@@ -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.