diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-02-01 22:16:24 +0100 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-02-01 22:16:24 +0100 |
commit | d80ce7526c14db8737febb824347c1ee09af2707 (patch) | |
tree | 8b2d43fd8d9970e1000affb412f18d9d76fb6633 | |
parent | db2e681e87ad1d15bc0c8f8ef08e222da7ea97c1 (diff) | |
download | bugzilla-d80ce7526c14db8737febb824347c1ee09af2707.tar.gz bugzilla-d80ce7526c14db8737febb824347c1ee09af2707.tar.xz |
Bug 538705: Assure that Bugzilla->dbh doesn't become invalid under MySQL during long jobqueue.pl runs.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
-rw-r--r-- | Bugzilla/DB/Mysql.pm | 8 |
1 files changed, 6 insertions, 2 deletions
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. |