joomla-framework / database

Joomla Framework Database Package
GNU General Public License v2.0
28 stars 34 forks source link

Fix version check for display width modifier support in unit tests for MySQL #242

Closed richard67 closed 3 years ago

richard67 commented 3 years ago

Pull Request for Issue #241 .

Summary of Changes

This pull request (PR) changes the 2 checks for display width modifier support in unit tests for the MySQL drivers so the check is correctly done if it's a MariaDB or a MySQL version lower than 8.0.17, which still use the display width modifier for integer data types, or if it's a MySQL 8.0.17 or later, on which the display width modifier is deprecated and not part of the column's type specifier returned e.g. by a "SHOW COLUMNS" and where it might not be supported in future.

It makes it possible to run the unit tests on MariaDB, too.

See https://github.com/joomla/joomla-cms/pull/32606 for details on the display width issue.

Testing Instructions

Check if unit tests still pass.

Documentation Changes Required

None.

Additional information

I might do a follow-up PR later to remove the usage of the display width modifier from SQL statements in scripts and at other places.

richard67 commented 3 years ago

@nibra Does it also need a PR for the 2.0-dev branch? Or is this something which will be merged up to there from master?

richard67 commented 3 years ago

@nibra Does it also need a PR for the 2.0-dev branch? Or is this something which will be merged up to there from master?

Update: I just see tests have been changed there, so I have to make a separate PR.

richard67 commented 3 years ago

For 2.0-dev see #243 .

nibra commented 3 years ago

Thank you!