Skip to content

[4.0] Enable utf8mb4 connections for mysql adapters on installation#25292

Merged
wilsonge merged 2 commits intojoomla:4.0-devfrom
richard67:4.0-dev-fix-utf8mb4-for-mysql-pdo
Jun 22, 2019
Merged

[4.0] Enable utf8mb4 connections for mysql adapters on installation#25292
wilsonge merged 2 commits intojoomla:4.0-devfrom
richard67:4.0-dev-fix-utf8mb4-for-mysql-pdo

Conversation

@richard67
Copy link
Member

@richard67 richard67 commented Jun 22, 2019

Pull Request for issue described below.

Summary of Changes

This is the same as PR #24704 but for the installation.

Testing Instructions

  1. Make a new, clean installation on 4.0-dev or with latest nightly 4.0.* build on a MySQL database using the PDO driver.
  2. Goto system panel in backend and check if some database error.
  3. Check database view and check which database error it is.
  4. Check with PhpMyAdmin table charsets and collations.

Expected result

No database error, all tables are created with utf8mb4 charset and collations.

Actual result

One database error about tables not having been converted to utf8mb4, all tables are created with utf8 charset and collations.

What is funny: When connecting to the backend after installation, connection shows utf8mb4 support.

But using the "fix" button to run the utf8mb4 conversion does not help (which makes sense because 4.0 should have all converted already), so you have to live with that database error and wrong collation in db until the end of your life.

When using the MySQLi driver, everything is ok, i.e. this issue is only for the MySQL PDO driver.

But this might be just lucky circumstance, or to be more precise, inconsistency between the drivers regarding initial value for utf8mb4 support, and so this PR also adds the right default for the MySQLi driver.

At the end it is just the same for the installation as PR #24704 was for the installed J4.

With staging this issue does not exist, it exists only in 4.0-dev.

Documentation Changes Required

None.

@richard67
Copy link
Member Author

Ping @wilsonge 😄

@richard67
Copy link
Member Author

@mbabker If you have a bit time, could you check if this PR is an acceptable way to solve the issue we recently discussed? It works, but if you think it's an ugly hack, I will close it of course.

@mbabker
Copy link
Contributor

mbabker commented Jun 22, 2019

That's how it should be. The key part is in making sure the right options always get passed into the drivers, which this PR fixes.

@wilsonge wilsonge merged commit e532da8 into joomla:4.0-dev Jun 22, 2019
@wilsonge
Copy link
Contributor

Thanks!

@wilsonge wilsonge added this to the Joomla 4.0 milestone Jun 22, 2019
@richard67
Copy link
Member Author

Thanks too.

@richard67 richard67 deleted the 4.0-dev-fix-utf8mb4-for-mysql-pdo branch June 22, 2019 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants