-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix #18204 - Update getInnodbPluginVersion for MariaDB compatibility #20220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: QA_5_2
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -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
|
||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you return empty it will break phpmyadmin/libraries/classes/Operations.php Line 525 in 6f66b76
was this variable also removed ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it was removed in MariaDB 10.10 : https://mariadb.com/docs/server/server-usage/storage-engines/innodb/innodb-system-variables
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just noticed that even in MySQL this variable is quite useless: Maybe it's better to remove it completely?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, then we can juste replace :
With:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
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;");
}
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, please apply this |
||||
| } | ||||
|
|
||||
| /** | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.