[odb-users] UTF-8 character set issue in schema_version table

Henri Schwarz il1k3pepsi at gmail.com
Wed Apr 12 09:16:29 EDT 2017


Hi Boris,

at first I want to thank you very very much for your support. I tried to
switch the character set of my database but due to another error I switched
to sqlite and both errors vanished. It seems like MariaDB doesn't like
schema versioning and polymorphic persistent classes as well.

Kind regards,

Henri


2017-04-06 18:31 GMT+02:00 Boris Kolpackov <boris at codesynthesis.com>:

> Hi Henri,
>
> Henri Schwarz <il1k3pepsi at gmail.com> writes:
>
> > `name` VARCHAR(255) NOT NULL PRIMARY KEY,
> >
> > [...]
> >
> > *ERROR 1071 (42000) at line 13: Specified key was too long; max key
> length
> > is 767 bytes*
> >
> > [...]
> >
> > | character_set_database   | utf8mb4                    |
>
> The utf8mb4 is the issue. This means MySQL uses 4 bytes per character
> instead of 3 as was the case I guess until recently (that's where 255
> comes from: 767/3).
>
> I've fixed this for the next release (now the default is 128 in case
> MySQL folks decide to use 5 bytes next week ;-)). Your options are
> as follows:
>
> 1. Change the database from utf8mb4 to utf8mb3.
>
> 2. Create a suitable schema_version table manually before calling the
>    create_schema() function (which will omit creating it because of the
>    IF NOT EXISTS clause).
>
> 3. I can build you a pre-release version of ODB with the fix.
>
> Let me know if you are interested in #3.
>
> Boris
>


More information about the odb-users mailing list