Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/classes/Engines/Innodb.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
{
global $dbi;

return $dbi->fetchValue('SELECT @@innodb_version;') ?: '';
return ($dbi->isMariaDB() && $dbi->getVersion() >= 101000) ? '' : ($dbi->fetchValue('SELECT @@innodb_version') ? : '');

Check failure on line 293 in libraries/classes/Engines/Innodb.php

View workflow job for this annotation

GitHub Actions / analyse-php (7.2)

Cannot call method isMariaDB() on mixed.

Check failure on line 293 in libraries/classes/Engines/Innodb.php

View workflow job for this annotation

GitHub Actions / analyse-php (7.2)

Cannot call method getVersion() on mixed.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return ($dbi->isMariaDB() && $dbi->getVersion() >= 101000) ? '' : ($dbi->fetchValue('SELECT @@innodb_version') ? : '');
return ($dbi->isMariaDB() && $dbi->getVersion() >= 101000) ? '' : ($dbi->fetchValue('SELECT @@innodb_version;') ? : '');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you return empty it will break

$innodb_file_format = $innodbEnginePlugin->getInnodbFileFormat() ?? '';

was this variable also removed ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind refactoring this so we have a clear path that the two variables are only displayed and fetched if the database version is the right one ?
Like you did in the other PR

Copy link
Copy Markdown
Contributor Author

@gs71 gs71 Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that even in MySQL this variable is quite useless:
https://dev.mysql.com/doc/refman/8.4/en/innodb-parameters.html#sysvar_innodb_version

Maybe it's better to remove it completely?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends if it useless since before the minimum MySQL version for phpMyAdmin or not
They say we can use @@version instead

Copy link
Copy Markdown
Contributor Author

@gs71 gs71 Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, then we can juste replace :

return $dbi->fetchValue('SELECT @@innodb_version;') ?: '';

With:

return $dbi->fetchValue('SELECT @@version;') ?: '';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably yes, but it needs to be checked on the lowest version supported

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you just replace it then it becomes useless, right? I think the point was to check whether this setting exists and is not empty.

Copy link
Copy Markdown
Contributor Author

@gs71 gs71 Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the function getInnodbPluginVersion() is useless, since it is only used in libraries/classes/Operations.php as follows:

        $innodbPluginVersion = $innodbEnginePlugin->getInnodbPluginVersion();
        $innodb_file_format = '';
        if (! empty($innodbPluginVersion)) {
            $innodb_file_format = $innodbEnginePlugin->getInnodbFileFormat() ?? '';
        }

This block could just be replaced by:

$innodb_file_format = $innodbEnginePlugin->getInnodbFileFormat() ?? '';

And the function getInnodbFileFormat() could be optimized as:

    public function getInnodbFileFormat(): ?string
    {
        global $dbi;

        return (
          ($dbi->isMariaDB() && $dbi->getVersion() >= 100600)
          || ($dbi->isMySql() && $dbi->getVersion() >= 80000) 
        ) ? '' : $dbi->fetchValue("SELECT @@innodb_file_format;");
    }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, please apply this

}

/**
Expand Down
Loading