Skip to content
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

migration 7.0 9.0 sql issue #10245

Open
tiaris opened this issue Dec 17, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@tiaris
Copy link
Contributor

commented Dec 17, 2018

Bug

Erreur DB_ERROR_1071: ALTER TABLE llx_emailcollector_emailcollectorfilter ADD UNIQUE INDEX uk_emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue);
Specified key was too long; max key length is 767 bytes

Environment

  • Version: dolibarr 9.0 beta
  • OS: debian
  • Web server: [Webserver type and version]
  • PHP: [PHP version]
  • Database: [Database type and version]
  • URL(s): [Affected URL(s)]

Expected and actual behavior

We should not build unique indexes on long varchar columns

Steps to reproduce the behavior

Migrate from 7 - 9, maybe also on fresh installs

@milamberspace

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2019

Workaround (on mariadb 10.1):

Error DB_ERROR_1071: ALTER TABLE llx_emailcollector_emailcollectorfilter ADD UNIQUE INDEX uk_emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue);
Specified key was too long; max key length is 767 bytes

==> before force upgrade:

MariaDB [dolibarrdb]> ALTER TABLE llx_emailcollector_emailcollectorfilter ROW_FORMAT=DYNAMIC;
Query OK, 0 rows affected (0.07 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [dolibarrdb]> ALTER TABLE llx_emailcollector_emailcollectorfilter CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 0 rows affected (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [dolibarrdb]> ALTER TABLE llx_emailcollector_emailcollectorfilter ADD UNIQUE INDEX uk_emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue);
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.