User tests: Successful: Unsuccessful:
Pull Request for Issue # .
With Pull Request (PR) #28135 I have added the check for the CMS' minimum database server version requirement to the installation, because the CMS requirement is at least for PostgreSQL more strict than the database driver's requirement, which was the only checked one before that PR.
But that PR has fixed that only for the case when the database already exists in case of MySQL (PDO) and PostgreSQL (PDO). When creating a new database during installation and using these drivers, still only the database driver's requirement is checked. For MySQLi that is not a problem because there the check in the setup model (which respects the CMS' requirement) works also when the database doesn't exist (yet).
This PR here corrects this so it works for all 3 drivers.
In addition it adds the same checks for connection encryption after successful connection to the database model as I have added them with my PR #27348 when I had added the connection encryption feature to the installation. The reason for this change is the same: Without this PR here these checks take only place when the database already exists, but not when a new database is created. This change is harder to test, because it is only relevant for the special case that the server doesn't support encryption, or negotiating an encrypted connection fails, and the server is configured to allow to fall back to an unencrypted connection. This part can only be tested by code review, I think.
The minimum database server versions currently required by the database drivers are:
The minimum database server versions currently required by the CMS are:
Because for MySQL and MariaDB the requirements of database driver and CMS are equal, you have to patch either the driver's or the CMS' requirement so that the above condition is fulfilled. For PostgreSQL you either use a server version 10 or have to patch some requirements, too.
The minimum version as required by the particular database driver for the particular database type can be patched at the following places:
For MySQL databases
MySQLi driver - file libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php
, line 86
MySQL (PDO) driver - file libraries/vendor/joomla/database/src/Mysql/MysqlDriver.php
, line 72
protected static $dbMinimum = '5.6';
For MariaDB databases
MySQLi driver - file libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php
, line 94
MySQL (PDO) driver - file libraries/vendor/joomla/database/src/Mysql/MysqlDriver.php
, line 80
protected static $dbMinMariadb = '10.0';
For PostgreSQL databases
PostgreSQL (PDO) driver - file libraries/vendor/joomla/database/src/Pgsql/PgsqlDriver.php
, line 54
protected static $dbMinimum = '9.4.0';
The minimum version as required by the CMS for the particular database type can be patched here:
joomla-cms/installation/src/Helper/DatabaseHelper.php
Lines 23 to 48 in 8925612
You need an up-to-date 4.0-dev branch so it contains the recently merged PR #28338 , or when using a nightly build, wait until tomorrow so that PR is included.
This PR has to be tested with the PDO drivers, i.e. database type MySQL (PDO) or PosgreSQL (PDO). Of course if you have a MySQL or MariaDB database, you can test in addition if this PR doesn't break anything when using the MySQLi driver.
Start a new Joomla 4 installation without the patch of this PR applied, using a database server and user combination which allows to create a new database, and a database name for which no database exists on that server, and make sure that for the server version the 1st point in section "Recuirements" above is fulfilled.
Result: See section "Actual result" below.
Do the same with the patch of this PR applied. When getting an error message about version requirement not being fulfilled, change database server or patch the requirement so that it will be fulfilled, and try again, using the "Install Jooma >" button again.
Result: See section "Expected result" below.
Finally check by code review that the checks for connection encryption added by this PR to here
joomla-cms/installation/src/Model/DatabaseModel.php
Lines 486 to 497 in 8925612
joomla-cms/installation/src/Model/SetupModel.php
Lines 569 to 584 in 8925612
When creating a new database at installation, the CMS' requirement on the minimum database server version is checked, and if it is not fulfilled, the installation stops with an appropriate error message.
The user can correct database information in the installation form and then finish the installation by using the "Install Joomla >" button again.
When creating a new database at installation, the CMS' requirement on the minimum database server version is not checked, i.e. Joomla is installed in that database even if the server doesn't fulfill the version requirement by the CMS.
None.
This PR doesn't fix the fact that a database will also be created with MySQL (PDO) or PosgreSQL (PDO) when the server doesn't fulfill the minimum version requirement because that version check is done after database creation. This issue I plan to fix with another, future PR.
Status | New | ⇒ | Pending |
Category | ⇒ | Installation |
Title |
|
Labels |
Added:
?
|
Done. Description adapted. Ready for test.
I have tested this item
Test is successful with MariaDB. I get the proper error message and it reads the proper version that I am running.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Anything wrong with my PR? It is RTC, has no conflicts and is still valid.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-05-02 08:25:36 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
|
Thanks
Thanks.
Wait a bit with testing ... I have to adjust description so it is clear that the problem fixed by this PR doesn’t appear with MySQLi, only with MySQL (PDO) and PostgreSQL (PDO).