Accept DBD::MariaDB (#1490)
This commit is contained in:
parent
27aea3ecd2
commit
7e8a007b02
|
@ -108,7 +108,7 @@ logLevel = warn
|
||||||
;
|
;
|
||||||
; type = RDBI
|
; type = RDBI
|
||||||
; ;type = CDBI
|
; ;type = CDBI
|
||||||
; dbiChain = DBI:mysql:database=lemonldap-ng;host=1.2.3.4
|
; dbiChain = DBI:MariaDB:database=lemonldap-ng;host=1.2.3.4
|
||||||
; dbiUser = lemonldap
|
; dbiUser = lemonldap
|
||||||
; dbiPassword = password
|
; dbiPassword = password
|
||||||
;
|
;
|
||||||
|
|
|
@ -174,6 +174,9 @@ sub get_key_from_all_sessions {
|
||||||
$args->{unserialize} =
|
$args->{unserialize} =
|
||||||
\&Lemonldap::NG::Common::Apache::Session::Serialize::JSON::_unserialize;
|
\&Lemonldap::NG::Common::Apache::Session::Serialize::JSON::_unserialize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# For now, Apache::Session::MariaDB doesn't exists.
|
||||||
|
# Apache::Session::Browseable::MariaDB has its own get_key_from_all_sessions
|
||||||
if ( $backend =~
|
if ( $backend =~
|
||||||
/^Apache::Session::(SQLite\d?|MySQL|MySQL::NoLock|Postgres|Oracle|Sybase|Informix)$/
|
/^Apache::Session::(SQLite\d?|MySQL|MySQL::NoLock|Postgres|Oracle|Sybase|Informix)$/
|
||||||
)
|
)
|
||||||
|
|
|
@ -45,7 +45,7 @@ BEGIN {
|
||||||
# - Nothing: default configuration file is tested,
|
# - Nothing: default configuration file is tested,
|
||||||
# - { confFile => "/path/to/storage.conf" },
|
# - { confFile => "/path/to/storage.conf" },
|
||||||
# - { Type => "File", dirName => "/path/to/conf/dir/" },
|
# - { Type => "File", dirName => "/path/to/conf/dir/" },
|
||||||
# - { Type => "DBI", dbiChain => "DBI:mysql:database=lemonldap-ng;host=1.2.3.4",
|
# - { Type => "DBI", dbiChain => "DBI:MariaDB:database=lemonldap-ng;host=1.2.3.4",
|
||||||
# dbiUser => "user", dbiPassword => "password" },
|
# dbiUser => "user", dbiPassword => "password" },
|
||||||
# - { Type => "SOAP", proxy => "https://auth.example.com/config" },
|
# - { Type => "SOAP", proxy => "https://auth.example.com/config" },
|
||||||
# - { Type => "LDAP", ldapServer => "ldap://localhost", ldapConfBranch => "ou=conf,ou=applications,dc=example,dc=com",
|
# - { Type => "LDAP", ldapServer => "ldap://localhost", ldapConfBranch => "ou=conf,ou=applications,dc=example,dc=com",
|
||||||
|
|
|
@ -70,12 +70,14 @@ sub _dbh {
|
||||||
elsif ( $self->{dbiChain} =~ /^dbi:pg/i ) {
|
elsif ( $self->{dbiChain} =~ /^dbi:pg/i ) {
|
||||||
$self->{_dbh}->{pg_enable_utf8} = 1;
|
$self->{_dbh}->{pg_enable_utf8} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# DBD::MariaDB should have o problem here
|
||||||
return $self->{_dbh};
|
return $self->{_dbh};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub lock {
|
sub lock {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
if ( $self->{dbiChain} =~ /^dbi:mysql:/i ) {
|
if ( $self->{dbiChain} =~ /^dbi:(?:MariaDB|mysql):/i ) {
|
||||||
my @row = $self->_dbh->selectrow_array("SELECT GET_LOCK('lmconf', 0)");
|
my @row = $self->_dbh->selectrow_array("SELECT GET_LOCK('lmconf', 0)");
|
||||||
return $row[0] || 0;
|
return $row[0] || 0;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +86,7 @@ sub lock {
|
||||||
|
|
||||||
sub isLocked {
|
sub isLocked {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
if ( $self->{dbiChain} =~ /^dbi:mysql:/i ) {
|
if ( $self->{dbiChain} =~ /^dbi:(?:MariaDB|mysql):/i ) {
|
||||||
my @row = $self->_dbh->selectrow_array("SELECT IS_FREE_LOCK('lmconf')");
|
my @row = $self->_dbh->selectrow_array("SELECT IS_FREE_LOCK('lmconf')");
|
||||||
return $row[0] ? 0 : 1;
|
return $row[0] ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +95,7 @@ sub isLocked {
|
||||||
|
|
||||||
sub unlock {
|
sub unlock {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
if ( $self->{dbiChain} =~ /^dbi:mysql:/i ) {
|
if ( $self->{dbiChain} =~ /^dbi:(?:MariaDB|mysql):/i ) {
|
||||||
my @row = $self->_dbh->selectrow_array("SELECT RELEASE_LOCK('lmconf')");
|
my @row = $self->_dbh->selectrow_array("SELECT RELEASE_LOCK('lmconf')");
|
||||||
return $row[0] || 0;
|
return $row[0] || 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user