[3.x] Get database server version from database so it works also with ProxySQL#312
Draft
richard67 wants to merge 6 commits intojoomla-framework:3.x-devfrom
Draft
[3.x] Get database server version from database so it works also with ProxySQL#312richard67 wants to merge 6 commits intojoomla-framework:3.x-devfrom
richard67 wants to merge 6 commits intojoomla-framework:3.x-devfrom
Conversation
HLeithner
reviewed
Sep 8, 2024
| } | ||
|
|
||
| $this->mariadb = stripos($this->connection->server_info, 'mariadb') !== false; | ||
| $serverVersion = $this->getVersion(); |
Contributor
There was a problem hiding this comment.
I'm not happy with this call on every connect, can we lazy load the mariadb and utf8mb4 variable?
Contributor
Author
There was a problem hiding this comment.
That would be out of scope of my PR, I think. The change here is equal to what we already have in the MySQL PDO driver.
Contributor
Author
|
Changing to draft due to review comments until I have a better solution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue #309
Summary of Changes
This pull request (PR) changes the
getVersionmethods of the "MySQLi" and "MySQL (PDO)" drivers so that they select the version from the database after the first connection instead of relying on the connection'sserver_infoin case of "MySQLi" orPDO::ATTR_SERVER_VERSIONin case of "MySQL (PDO)".The result is cached in a protected class variable so that the database query is only executed at the very first connection of the particular driver instance.
This makes it possible to use ProxySQL for a Joomla 5.x installation.
Testing Instructions
With ProxySQL see issue #309 .
Otherwise (without ProxySQL) check that the version returned by
getVersion()is the same as without this PR for the same database, e.g. something like "10.11.7-MariaDB-log" for MariaDB or "8.0.39-0ubuntu0.22.04.1" for MySQL databases.Documentation Changes Required
None.