mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-23 06:38:19 +02:00
N°7150 - Backup : on MariaDB >= 11.0.1 call mariadb-dump instead of mysqldump
This commit is contained in:
@@ -346,7 +346,7 @@ class DBBackup
|
||||
$this->LogInfo("Starting backup of $this->sDBHost/$this->sDBName(suffix:'$this->sDBSubName')");
|
||||
$sMySQLBinDir = utils::ReadParam('mysql_bindir', $this->sMySQLBinDir, true);
|
||||
|
||||
$sMySQLDump = $this->MakeSafeMySQLCommand($sMySQLBinDir, 'mysqldump');
|
||||
$sMySQLDump = $this->MakeSafeMySQLCommand($sMySQLBinDir, DBBackup::GetDumpFunction());
|
||||
|
||||
// Store the results in a temporary file
|
||||
$sTmpFileName = self::EscapeShellArg($sBackupFileName);
|
||||
@@ -603,6 +603,16 @@ EOF;
|
||||
|
||||
return '"'.$sMySQLCommand.'"';
|
||||
}
|
||||
|
||||
public static function GetDumpFunction(): string
|
||||
{
|
||||
$version = CMDBSource::QueryToScalar('SELECT VERSION()');
|
||||
if (is_string($version) && stripos($version, 'MariaDB') !== false) {
|
||||
return 'mariadb-dump';
|
||||
}
|
||||
|
||||
return 'mysqldump';
|
||||
}
|
||||
}
|
||||
|
||||
class TarGzArchive implements BackupArchive
|
||||
|
||||
Reference in New Issue
Block a user