Plugin(database::mysql::plugin) - Mode(dbi,mysqlcmd): Error when retrieving the server version CTOR-1562 (#5610)

This commit is contained in:
itoussies 2025-06-25 16:30:34 +02:00 committed by GitHub
parent 6cbda8a0fa
commit da00258077
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 9 deletions

View File

@ -36,9 +36,8 @@ sub set_version {
$self->{is_mariadb} = 0; $self->{is_mariadb} = 0;
$self->{version} = $self->{instance}->get_info(18); # SQL_DBMS_VER $self->{version} = $self->{instance}->get_info(18); # SQL_DBMS_VER
# MariaDB: 5.5.5-10.1.36-MariaDB or 10.1.36-MariaDB # MariaDB: 5.5.5-10.1.36-MariaDB, 10.1.36-MariaDB or 11.4.4-2-MariaDB-enterprise-log
if ($self->{version} =~ /([0-9\.]*?)-MariaDB/i) { if ($self->{version} =~ /(?:\d\.\d\.\d-)?(\d+\.\d+\.\d+).*MariaDB/i) {
$self->{version} = $1;
$self->{is_mariadb} = 1; $self->{is_mariadb} = 1;
} }
} }

View File

@ -53,7 +53,7 @@ sub new {
'sql-errors-exit:s' => { name => 'sql_errors_exit', default => 'unknown' } 'sql-errors-exit:s' => { name => 'sql_errors_exit', default => 'unknown' }
}); });
} }
$options{options}->add_help(package => __PACKAGE__, sections => 'MYSQLCMD OPTIONS', once => 1); $options{options}->add_help(package => __PACKAGE__, sections => 'MYSQL COMMAND OPTIONS', once => 1);
$self->{output} = $options{output}; $self->{output} = $options{output};
$self->{sqlmode_name} = $options{sqlmode_name}; $self->{sqlmode_name} = $options{sqlmode_name};
@ -209,8 +209,8 @@ sub set_version {
$self->{is_mariadb} = 0; $self->{is_mariadb} = 0;
$self->{version} = $options{version}; $self->{version} = $options{version};
# MariaDB: 5.5.5-10.1.36-MariaDB or 10.1.36-MariaDB # MariaDB: 5.5.5-10.1.36-MariaDB, 10.1.36-MariaDB or 11.4.4-2-MariaDB-enterprise-log
if ($self->{version} =~ /([0-9\.]*?)-MariaDB/i) { if ($self->{version} =~ /(?:\d\.\d\.\d-)?(\d+\.\d+\.\d+).*MariaDB/i) {
$self->{version} = $1; $self->{version} = $1;
$self->{is_mariadb} = 1; $self->{is_mariadb} = 1;
} }
@ -307,13 +307,13 @@ __END__
=head1 NAME =head1 NAME
mysqlcmd global MySQL command global
=head1 SYNOPSIS =head1 SYNOPSIS
mysqlcmd class MySQL command class
=head1 MYSQLCMD OPTIONS =head1 MYSQL COMMAND OPTIONS
=over 8 =over 8