ORIENT/modules/system
Luke Towers bd9f88587f
Fix issues with MySQL utf8mb4 support
Fixes: https://github.com/octobercms/october/issues/1927. Related: https://github.com/laravel/framework/issues/17508. Issue occurs when database configuration related to full support for the utf8mb4 charset is incorrect; MySQL > 5.7 & MariaDB > 10.2 doesn't have this issue because they default to the correct configuration values; this fix solves the issue for older versions of MySQL and MariaDB without requiring database server configuration changes.

The root cause of the issue with the utf8mb4 encoding is that both InnoDB and MyISAM have too low of an index key prefix limit (767 bytes and 1000 bytes respectively) to properly store 255 4-byte characters; which would take 1024 bytes. See the docs on InnoDB limitations: https://dev.mysql.com/doc/refman/5.7/en/innodb-restrictions.html

In MySQL >= 5.7 & MariaDB >= 10.2 this limit has been bumped to 3076 bytes by the changing of the default value of the `innodb_large_prefix` configuration property (introduced in MySQL 5.5) to true; which is what bumps up the limit. In order to manually set that property to true on earlier versions, `innodb_file_format` must be set to `BARRACUDA` and `row_format` must be `DYNAMIC` or `COMPRESSED`. See http://mechanics.flite.com/blog/2014/07/29/using-innodb-large-prefix-to-avoid-error-1071/ for more information. 

This change fixes the issue by changing the default string length to 191 (total of 764 bytes, within the older size limit) when the MySQL database config is detected to be using the utf8mb4 charset.
2018-02-17 17:00:32 -06:00
..
assets Remove loader background color (#3394) 2018-02-13 10:51:39 -06:00
behaviors Catch Artisan::call exception (#3342) 2018-01-08 08:29:43 -06:00
classes Merge branch 'maintenance-mediamanager' into develop 2017-10-16 17:56:34 +11:00
console Build Number Bugfix: Console Upgrade (#3357) 2018-01-11 11:59:30 -06:00
controllers Made hardcoded texts as translatable 2017-08-02 00:16:17 +03:00
database Fixes #3211 with improvements to reverse migration (#3212) 2017-10-31 12:34:48 -06:00
helpers Register `appName` as global view variable 2017-07-23 17:20:53 +10:00
lang Update Persian Language (#3396) 2018-02-13 10:55:06 -06:00
models >= PHP7.0 refactoring (#3343) 2018-01-12 00:23:20 -06:00
partials URL -> Url 2017-06-02 23:34:50 +10:00
reportwidgets Improve status check 2018-02-02 13:23:53 -06:00
traits Check if given partial name is also file or only folder (#3190) 2017-10-23 08:48:34 -06:00
twig Fix exception Class 'System\Twig\MediaLibrary' not found in build 426 (#3181) 2017-10-18 07:56:52 -06:00
views Allow raw values in subject header (#3092) 2017-09-07 08:42:27 -06:00
ServiceProvider.php Fix issues with MySQL utf8mb4 support 2018-02-17 17:00:32 -06:00
aliases.php Introduce new Cms helper 2016-08-20 14:43:49 +10:00
composer.json Fixes #3081. Resets module dependencies from dev to stable. Refs 081a32c928 2017-09-04 12:40:55 -06:00
providers.php Proxy ConsoleSupportServiceProvider properly 2018-01-24 18:09:41 +11:00
routes.php API docs progress 2017-03-16 17:08:20 +11:00