diff --git a/libraries/classes/Engines/Innodb.php b/libraries/classes/Engines/Innodb.php index 5b32fb5f39..166d5bf619 100644 --- a/libraries/classes/Engines/Innodb.php +++ b/libraries/classes/Engines/Innodb.php @@ -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;"); } /**