Skip to content

[2.0] Backport PR #300 for MariaDB >= 11.0 compatibility#314

Closed
richard67 wants to merge 1 commit intojoomla-framework:2.0-devfrom
richard67:2.0-dev-select-row-number-mariadb
Closed

[2.0] Backport PR #300 for MariaDB >= 11.0 compatibility#314
richard67 wants to merge 1 commit intojoomla-framework:2.0-devfrom
richard67:2.0-dev-select-row-number-mariadb

Conversation

@richard67
Copy link
Contributor

Pull Request for Issue #290 .

See also joomla/joomla-cms#42333 .

Summary of Changes

Backport PR #300 from 3.x-dev:

Use the ROW_NUMBER() window function for MariaDB 11.0.0 and newer.

That function is supported on MySQL since version 8.0.0, too, and on MariaDB since version 10.2.0, but in order to play safe this PR only changes that for MariaDB 11.0.0 and newer, as for older MariaDB versions or MySQL the old code still seems to work. I've added a @todo comment to the selectRowNumber method and a comment to the version check for MariaDB 11.0.0 to make that clear.

I could not find any unit tests for the selectRowNumber method, so no changes on unit tests with this PR.

Testing Instructions

See joomla/joomla-cms#42333 :

  1. Installation of MariaDB Version 11.1.2 (active Arch Linux),
  2. Goto backend (Administrator),
  3. Open Components > Banners > Banners,
  4. Create three new banners named 1st_banner, 2nd_banner, 3rd_banner,
  5. Click on Sort By "Ordering ascending",
  6. "Drag and Drop" the second banner to the first position - ordering now: 2 - 1 - 3,
  7. Click on the search magnifying glass to reload the banner or reload page.

Without this PR, ordering of the banners is reordered to 1 - 2 - 3, and you cannot change the ordering with "Drag and Drop".

With this PR, ordering of the banners is 2 - 1 - 3, and you can change the ordering with "Drag and Drop".

The issue has been reported for Joomla 4.4 and 5.

Documentation Changes Required

None.

@richard67
Copy link
Contributor Author

Meanwhile obsolete as Joomla 4.4 bug fix support has ended.

@richard67 richard67 closed this Oct 16, 2024
@richard67 richard67 deleted the 2.0-dev-select-row-number-mariadb branch October 16, 2024 17:31
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.

1 participant