From 45fdf3123d7f024352c19e46a082bc6792adba5e Mon Sep 17 00:00:00 2001 From: GS Date: Tue, 31 Mar 2026 17:39:04 +0200 Subject: [PATCH] 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 --- libraries/classes/Engines/Innodb.php | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) 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;"); } /**