Closed

Description
Describe the bug
Problem with ALTER table during Update
Steps to Reproduce
Make an update 1769 --> 1770
Additional information
Linux #799710 SMP Wed Jul 10 08:31:28 UTC 2019 x86_64
Version du logiciel serveur : Apache
Version de PHP : 7.2.34
Limite de mémoire : 2048M
Temps maximal d'exécution : 18000
Taille max. pour envoi de fichiers : 10M
info_outline Informations sur la base de données
Version de MySQL : 10.1.45-MariaDB-0+deb9u1
Serveur MySQL : localhost
Nom MySQL : 176
Utilisateur MySQL : 176
Préfixe des tables : ps_
Moteur MySQL : InnoDB
Connecteur MySQL : DbPDO
SQL 1.7.7.0 1071 in ALTER TABLE `ps_admin_filter` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_alias` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_authorization_role` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_module_preference` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_smarty_lazy_cache` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_tab_module_preference` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_admin_filter` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_alias` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_authorization_role` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_module_preference` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_smarty_lazy_cache` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
SQL 1.7.7.0 1071 in ALTER TABLE `ps_tab_module_preference` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci: Specified key was too long; max key length is 767 bytes
Activity
matks commentedon Nov 17, 2020
Hi @okom3pom let's explore this topic together 😄
So if I get correctly
max key length
is reachedSo it would be because of the size of your database 🤔 ? ping @PierreRambaud
Can you tell us the size of these tables in your server (count + KB size) ?
ghost commentedon Nov 17, 2020
It's a new install only demo product :)
i think porblem is mysql version or maria db version, i found a lot of topic with this issue
PierreRambaud commentedon Nov 17, 2020
Hi,
It's not because of the size of the database, but the size of the fields. I just don't understand how it is possible to reach more than 767 in ps_admin_filter for example 🤔
Did you add indexes on fields, or did you change something?
ghost commentedon Nov 17, 2020
@PierreRambaud it's a new install without change
ghost commentedon Nov 18, 2020
Here the differences :
176 :

177 :

If i run :
ALTER TABLE `ps_admin_filter` CHANGE `filter_id` `filter_id` VARCHAR(191) NOT NULL;
Before
ALTER TABLE `ps_admin_filter` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
It's ok, il check all tables with the error and it's the same 255 and 191
I also found a lot of duplicate querys, the best is to remove in different PR ?
Regards
ghost commentedon Nov 18, 2020
Something like this, fixing for me but i don't know if a row is greater than 191 ( cache_id ? )
@PierreRambaud
PierreRambaud commentedon Nov 18, 2020
Yes, there are a lot of duplicates, look like a rebase has failed :(
Thanks for your report. We will fix it today:)
17 remaining items