Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
5 Aug 2025

Pull Request for Issue #45839 .

Summary of Changes

This pull request adds missing names quotes to the column alias "newPublished" of the subquery used in the "recursiveUpdatePublishedColumn" in the "Joomla\CMS\Table\Nested" table class and corrects casing for the later use of that column alias so that the query works without any error on any database environment, regardless of case-sensitivity of column names.

Testing Instructions

On MySQL or MariaDB it might need a special environment to be able to reproduce the issue, e.g. a database server where the "information_schema" database uses a case-sensitive collation.

You could do that by changing the collation of the "information_schema" database and convert all its tables to the same collation as it has now but without the "_ci" at the end so that it is case-insensitive.

But you should make a backup so you can later restore the original state as it is not recommended to change the character set and collation of the "information_schema" database.

Then you can try to reproduce the issue.

On PostgreSQL there was no error because the 2 mistakes fixed by this PR compensate each other:

  • PostgreSQL converts all names to lowercase if they are not quoted, what was the case here with the missing names quotes at the first place.
  • But when checking for names, PostgreSQL is still case-sensitive.
  • Because of the 2nd mistake (lowercase spelling of the quoted name a few lines below) it works.
  • If this PR would fix only one of the 2 mistakes, it would fail on PostgreSQL.

So on PostgreSQL you can only check if everything works as before.

Actual result BEFORE applying this Pull Request

See issue #45839 .

Expected result AFTER applying this Pull Request

No such error.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar richard67 richard67 - open - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Aug 2025
Category Libraries
avatar richard67 richard67 - change - 5 Aug 2025
Title
[5.3] Fix column alias missing names quoting and wrong casing in libraries/src/Table/Nested.php
[5.3] Fix missing names quotes and wrong casing of column alias in libraries/src/Table/Nested.php
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar richard67 richard67 - change - 5 Aug 2025
The description was changed
avatar richard67 richard67 - edited - 5 Aug 2025
avatar toivo
toivo - comment - 6 Aug 2025

I have not managed to duplicate the error even after creating a database from the command line with case-sensitive collation:
CREATE DATABASE joomla53 CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs;
When Joomla 5.3.3-dev is installed, the database connection_collation is automatically set to be case-insensitive:

Database Collation	utf8mb4_0900_as_cs
Database Connection Collation	utf8mb4_0900_ai_ci

I am guessing the server variable collation_connection should somehow be set in the command line session before creating the database, just to make the operations involving column aliases case-sensitive.

avatar richard67
richard67 - comment - 6 Aug 2025

@toivo i meant the collation of the „information_schema“ database, not of the database used by Joomla.

avatar richard67
richard67 - comment - 6 Aug 2025

P.S.: The connection collation has absolutely nothing to do with it.

Add a Comment

Login with GitHub to post a comment