Commit 69429329 authored by Xavier Guimard's avatar Xavier Guimard

Fix #1118 for DBI

parent b80cc5f8
......@@ -56,8 +56,18 @@ sub _dbh {
my $self = shift;
$self->{dbiTable} ||= "lmConfig";
return $self->{_dbh} if ( $self->{_dbh} and $self->{_dbh}->ping );
return DBI->connect_cached( $self->{dbiChain}, $self->{dbiUser},
$self->{_dbh} = DBI->connect_cached( $self->{dbiChain}, $self->{dbiUser},
$self->{dbiPassword}, { RaiseError => 1, AutoCommit => 1, } );
if ( $self->{dbiChain} =~ /^dbi:sqlite/i ) {
$self->{_dbh}->{sqlite_unicode} = 1;
}
elsif ( $self->{dbiChain} =~ /^dbi:mysql/i ) {
$self->{_dbh}->{mysql_enable_utf8} = 1;
}
elsif ( $self->{dbiChain} =~ /^dbi:pg/i ) {
$self->{_dbh}->{pg_enable_utf8} = 1;
}
return $self->{_dbh};
}
sub lock {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment