summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/DB/Mysql.pm8
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.