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

Henri Schwarz il1k3pepsi at gmail.com
Thu Apr 6 04:13:34 EDT 2017


Hi all,

currently I'm encountering a bug that is similar to the issue reported here
<http://www.codesynthesis.com/pipermail/odb-users/2013-January/001017.html>.
The difference is that it first appeared after I tried to make use of the
schema migration features provided with ODB.

So after adding *#pragma db model version (1, 1, open) *the ODB compiler
created the following SQL code in the *.sql file..

CREATE TABLE IF NOT EXISTS `schema_version` (
  `name` VARCHAR(255) NOT NULL PRIMARY KEY,
  `version` BIGINT UNSIGNED NOT NULL,
  `migration` TINYINT(1) NOT NULL)
 ENGINE=InnoDB;

When I try to apply the schema to my database I get an error on the first
line of the above statement.

*ERROR 1071 (42000) at line 13: Specified key was too long; max key length
is 767 bytes*

Using the SQL statement provided with the old issue report (*show variables
like '%char%';*) I got the following.

+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8mb4                    |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8mb4                    |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

How I can I solve this issue? Help is much appreciated.

Regards,


More information about the odb-users mailing list