Refactor InnoDB methods for version handling
Removed the getInnodbPluginVersion method and updated the getInnodbFileFormat method to handle version checks for MariaDB and MySQL. Signed-off-by: Guido Selva guido.selva@gmail.com
This commit is contained in:
parent
04424694c3
commit
45fdf3123d
@ -281,18 +281,6 @@ class Innodb extends StorageEngine
|
||||
return 'innodb-storage-engine';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the InnoDB plugin version number
|
||||
*
|
||||
* @return string the version number, or empty if not running as a plugin
|
||||
*/
|
||||
public function getInnodbPluginVersion()
|
||||
{
|
||||
global $dbi;
|
||||
|
||||
return $dbi->fetchValue('SELECT @@innodb_version;') ?: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the InnoDB file format
|
||||
*
|
||||
@ -300,19 +288,14 @@ class Innodb extends StorageEngine
|
||||
*
|
||||
* @return string|null the InnoDB file format
|
||||
*/
|
||||
public function getInnodbFileFormat(): ?string
|
||||
public function getInnodbFileFormat(): string|null
|
||||
{
|
||||
global $dbi;
|
||||
|
||||
$value = $dbi->fetchValue("SHOW GLOBAL VARIABLES LIKE 'innodb_file_format';", 1);
|
||||
|
||||
if ($value === false) {
|
||||
// This variable does not exist anymore on MariaDB >= 10.6.0
|
||||
// This variable does not exist anymore on MySQL >= 8.0.0
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string) $value;
|
||||
return (
|
||||
($dbi->isMariaDB() && $dbi->getVersion() >= 100600)
|
||||
|| ($dbi->isMySql() && $dbi->getVersion() >= 80000)
|
||||
) ? '' : $dbi->fetchValue("SELECT @@innodb_file_format;");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user