Repository navigation
Conversation
…sensitive The 2026_10_11 migration converted file_groups.file to utf8mb4. On a MyISAM table with a utf8mb3 column that widens the indexed VARCHAR(255) to 1020 bytes, past the MyISAM key limit of 1000, and the update stops with error 1071. Change only the collation, to the binary one of the column's own character set, named as the server spells it (utf8_bin on MySQL 5.7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The charset-preserving ALTER is the right approach. One compatibility blocker in — SokilAI |
…QL engines in CI MyISAM is a supported engine: the installers write it for older servers and sites keep it, often with a utf8 (utf8mb3) connection. The file_groups migrations now respect its 1000-byte key limit: - core/includes/file_groups_schema.php, loaded by path: the engine and charset a new table gets, bytes per character, the binary collation as the server names it (RIGHT(), not LIKE '%\_bin', which matches nothing under NO_BACKSLASH_ESCAPES), and the longest `file` the unique key allows. - The create migration (both copies) declares the binary collation itself and, on MyISAM with utf8mb4, creates `file` as VARCHAR(249). - 2026_10_11 keeps the column length as well as its charset. - 2026_12_05_000000_restore_file_groups_indexes puts back the indexes a create that hit the key limit left out, drops the duplicates it let in, and keeps rows whose path is longer than the key allows. CI: an install leg on MySQL with MyISAM, a nightly upgrade of a site turned MyISAM / utf8mb3 (legacy-myisam.php), smoke checks for the file_groups key and collation and the engine of every table, and FileGroupsMysqlTest run against a real server (EVO_TEST_MYSQL) in both SQL modes. AGENTS.md lists the rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, confirmed and fixed in 686bb62. On MySQL 8.0.46 and 9.7.4, The MySQL regression test is
It passes on MySQL 5.7.44, 8.0.46, 9.7.4 and MariaDB 10.11. The same commit also covers MyISAM in the rest of the chain: the create migration, a repair migration for tables a failed create left without indexes, and CI legs for MyISAM. The PR description has the details. |
An update from 3.5.9 stops in
2026_10_11_000000_make_file_groups_file_case_sensitivewhenfile_groupsis a MyISAM table with a utf8mb3 column (an older site on MySQL 8.0, connection configengineMyISAM,charsetutf8):The migration converted the column to utf8mb4 on the way to a binary collation. That widens the indexed
VARCHAR(255)from 765 to 1020 bytes, past the MyISAM key limit of 1000.make:site finishstops there: the new files are in place, but the update seeders, the Extras module, the settings version and the removal ofinstall/never run, so the manager reports the leftover install folder.MyISAM is a supported engine, not a legacy one: the installers write it into the connection config for servers older than MySQL 5.7.6, and sites keep it. Checking the whole chain on MyISAM found a second gap: on a MyISAM site with a utf8mb4 connection, even a fresh install failed. The create migration's unique key
(document_group, file VARCHAR(255))needs 4 + 1020 bytes. The table stayed behind without its indexes, and the next migrate skipped it (hasTable()) and reported success.Changes
core/includes/file_groups_schema.php, loaded by path (a migration must not depend on a classmap rebuild). It provides:utf8resolves toutf8mb3on MySQL 8.0.30+);utf8_binon 5.7,utf8mb3_binon 8.0);filethe unique key allows (249 for MyISAM with utf8mb4, 255 otherwise).2026_10_11changes only the collation, keeping the charset and the length.2026_10_11has nothing left to do on a new site;fileasVARCHAR(249)on MyISAM with utf8mb4. The unique key still covers the full, case-exact path, with no prefix.2026_12_05_000000_restore_file_groups_indexes(new, idempotent):fileonly when no stored path is longer;RIGHT(COLLATION_NAME, 4) = '_bin'. UnderNO_BACKSLASH_ESCAPES,LIKE '%\_bin'matched nothing on MySQL 8.0.46 and 9.7.4, and the migration would have been recorded without changing anything. The CI scripts match the table prefix withLEFT()for the same reason.ci.yml: an install leg on MySQL with MyISAM (EVO_DB_ENGINE), whose updater pass replays the chain over it.upgrade.yml: a nightly / on-demand leg (legacy: myisam) that turns the older site into MyISAM / utf8mb3 before upgrading it (legacy-myisam.php).smoke.phpchecks thefile_groupsunique key and binary collation on MySQL, and the engine of every table when one was asked for.FileGroupsMysqlTestthere (EVO_TEST_MYSQL).AGENTS.md: a "Migrations on MySQL: MyISAM and older charsets" section with the rules behind this (key budget per engine and charset, change only what the migration is for, server-named collations, repair after a partial create, both migration copies, CI legs).A site already stuck on it can finish before this is released:
php artisan make:site finishincore/.Tests
FileGroupsStorageEngineTest(SQLite, always runs): key budget per engine and charset, engine/charset resolution, server collation names, the generatedALTER, both copies of the create migration, and the three migrations on SQLite.FileGroupsMysqlTest(needsEVO_TEST_MYSQL), in the default SQL mode and underNO_BACKSLASH_ESCAPES:_bin;VARCHAR(249), all indexes;EVO_TEST_MYSQL(MySQL 9.7): 2896 passed, 32 skipped.mysql:9.7:file_groupsmade MyISAM utf8mb3, 3.5.12 laid over it.make:site finishfails as above. Laying this branch over it, or applying the manualALTERon 3.5.12, completes it: exit 0,install/removed, no pending migrations.🤖 Generated with Claude Code