-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Small performance check for downgrading utf8mb4 #12847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
No need to do preg_replace() if utf8mb4 doesn't exist in the $query string.
|
Worked fine here. |
|
@mehranfazili please mark your Test as successfully:
|
|
I have tested this item ✅ successfully on 4cd6dd8 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12847. |
|
@franz-wohlkoenig I think @mehranfazili will not mark his successful test result in the issue anymore after more than 2 years. But theroetically it is still valid, and as the guy who worked much on that utf8mb4 stuff in past I can say this change is good and still valid, plus I've just tested as described in my test result. |
|
Pity I did not notice this PR before, but end of 2016 I had a very passive phase here on GitHub because of new job. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12847. |
|
thx |
|
@mbabker Does this need re-integration back to the framework database package, and if so for which versions, master and 2.0-dev or only one of both? If I know what to do I will make the necessary PR(s) to the framework package. |
|
Any changes made in this repo should go to the Framework repo, in whatever branch(es) the change impacts. There should not be selective porting of changes, that's how things get inconsistent. |
|
@mbabker I checked and saw in the framework database package it is different anyway, and the change from this PR here is not really needed there. So nothing to do, it seems to me. Thanks for advising. |
Pull Request for Issue # .
Summary of Changes
Checks if the string utf8mb4 exists in the query - no need to do a regex replacement otherwise.
How I came across this: had a client that was attempting to install any extension and received the following errors:
The SQL is empty because the database did not support utf8mb4 AND the PCRE library the PHP was using was outdated and didn't understand
(*SKIP)(*FAIL). Thus,preg_replace()returned false instead of the original$query.It won't make much of a difference in the long run, but I've seen plenty of times this error on the Joomla! forum and perhaps this will solve it.
Testing Instructions
Install any extension that creates tables in the database. Make sure it installs correctly and the tables are created. Make sure utf8mb4 tables are downgraded to utf8 if the database does not support the character set (MySQL < 5.5 if I recall correctly).
Documentation Changes Required
None.