GithubHelp home page GithubHelp logo

Comments (7)

tonioo avatar tonioo commented on August 20, 2024

Hi, unfortunately it seems to be a MySQL+InnoDB limitation (according to http://south.aeracode.org/ticket/39 and http://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes.

I suggest you try this workaround: http://mechanics.flite.com/blog/2014/07/29/using-innodb-large-prefix-to-avoid-error-1071/.

Please tell me if it works.

from modoboa-postfix-autoreply.

tonioo avatar tonioo commented on August 20, 2024

@msenebald ping

from modoboa-postfix-autoreply.

msenebald avatar msenebald commented on August 20, 2024

Hi,
sorry for the delay. I tried the workaround, but without success.
Since i am not so familiar with django, i a not sure how to get the sql code that is generated by the migration.
What I did, I removed the index option in the migration "db_index=True" from:
migrations/0002_auto_20150728_1236.py

 field=models.CharField(max_length=300, db_index=True),

it happily upgrades the rest. But now without index.
I use mariadb 5.5.44 from official centos 7 repo.

from modoboa-postfix-autoreply.

tonioo avatar tonioo commented on August 20, 2024

Have you tried to recreate indexes after the migration ?

from modoboa-postfix-autoreply.

tenninjas avatar tenninjas commented on August 20, 2024

This can be solved by changing max_length to 253, which would seem sensible since domain names cannot acceptably exceed 253 characters in any case.

from modoboa-postfix-autoreply.

armouredking avatar armouredking commented on August 20, 2024

The workaround you've noted ( large prefix ) only works with an additional two steps:

  1. The server is setup to use Barracuda ( default is Antelope because backwards compat. )
  2. The table row is setup to use the right ROW_FORMAT.

The second issue is generally what gets people. It's easy enough to switch over to Barracuda, but the ROW_FORMAT option needs to be specified depending on your server setup. The default ROW_FORMAT is usually set to COMPACT ( even my latest edition install of MariaDB 10.1 was set to COMPACT ); you need to append the ROW_FORMAT=DYNAMIC; or whatever you want to use to the actual CREATE line, like so:

CREATE TABLE `postfix_autoreply_transport` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `domain` varchar(300) NOT NULL,
  `method` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

Or change your ROW_FORMAT=DEFAULT option to use DYNAMIC instead of REDUNDANT or COMPACT if you'd rather not deal. COMPRESSED cannot be set globally. ( Edit to note: This is only present in really really new versions. You probably don't have it - I don't. Explicitly setting the option is the only way atm ).

For more information about ROW_FORMAT see the manual.

from modoboa-postfix-autoreply.

msenebald avatar msenebald commented on August 20, 2024

Perfect. Thanks for your help @tonioo !

from modoboa-postfix-autoreply.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.