? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
14 Mar 2020

Pull Request for Issue # .

Summary of Changes

When installing Joomla using a database user who has the privilege to create a database on the specified database server and specifying a database name for which no database exists, the installation should create that database.

This currently might work with MySQLi, but not with MySQL (PDO) or PosgreSQL (PDO).

This Pull Request (PR) fixes that.

At least for PosgreSQL (PDO) I think it never has been working, except maybe for very old versions, because all information I found says that it is not possible to connect to a PostgreSQL server without specifying a database. So this PR here uses the 'postgres' database which is installed with a default PostgreSQL installation.

Testing Instructions

Requirements

  1. A database which fulfills the minimum server version requirements as they are
  • MySql: 5.6
  • MariaDB: 10.1
  • PostgreSQL: 11.0
  1. A database user who has the privilege to create a database on that server with that kind of connection, e.g. on a standard installation of
  • MySql: user 'root' on host 'localhost'
  • MariaDB: no idea
  • PostgreSQL: user 'postgres'
  1. 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.

Instructions

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.

Result: See section "Actual result" below.

Do the same with the patch of this PR applied.

Result: See section "Expected result" below.

Expected result

A new database with the specified name is created on the specified server, and the installation finishs with successs, if everything else is right.

Actual result

With MySQL (PDO):
j4-error-db-create-mysqlpdo

With PostgreSQL (PDO):
j4-error-db-create-pg

Documentation Changes Required

Maybe somewhere is written that installing a new database doesn't work when using PostgreSQL (PDO)? If so, this has to be changed.

Additional information

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 check is done after database creation. This issue I plan to fix with another, future PR.

avatar richard67 richard67 - open - 14 Mar 2020
avatar richard67 richard67 - change - 14 Mar 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Mar 2020
Category Installation
avatar richard67 richard67 - change - 14 Mar 2020
Labels Added: ?
avatar richard67 richard67 - change - 14 Mar 2020
The description was changed
avatar richard67 richard67 - edited - 14 Mar 2020
avatar richard67 richard67 - change - 14 Mar 2020
The description was changed
avatar richard67 richard67 - edited - 14 Mar 2020
avatar N6REJ
N6REJ - comment - 14 Mar 2020

I have tested this item successfully on b83bdd2

Post patch
pdo_psql : success
pdo: mysql : success
mysqli: success

Pre Patch:
pdo_psql: fail
pdo_mysql: fail
mysqli: success


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28338.

avatar N6REJ N6REJ - test_item - 14 Mar 2020 - Tested successfully
avatar wilsonge wilsonge - change - 14 Mar 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-03-14 22:26:42
Closed_By wilsonge
avatar wilsonge wilsonge - close - 14 Mar 2020
avatar wilsonge wilsonge - merge - 14 Mar 2020
avatar wilsonge
wilsonge - comment - 14 Mar 2020

Thankyou! Nice work here and well done @N6REJ as well - know you had to spent some time trying to get this test done with Richard!

avatar richard67
richard67 - comment - 14 Mar 2020

Thanks, George, for all advise. Fix for issue #27924 will come in a few minutes.

Add a Comment

Login with GitHub to post a comment