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

Faulty user-role mapping #27

Open
Luxter opened this issue Sep 19, 2016 · 0 comments
Open

Faulty user-role mapping #27

Luxter opened this issue Sep 19, 2016 · 0 comments
Labels

Comments

@Luxter
Copy link

Luxter commented Sep 19, 2016

The mapping between user and roles is faulty with mariaDB.

2016-09-19 12:02:26.150 ERROR 5481 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000388: Unsuccessful: create table user_roles (user_id bigint not null, roles varchar(255) not null, primary key (user_id, roles)) 2016-09-19 12:02:26.150 ERROR 5481 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaUpdate : Specified key was too long; max key length is 767 bytes

The composite key created for this relation exceeds length limit. It's probably because the composite key consists of bigint and varchar(255). Bigint takes 8 bytes and utf-8 char 3 bytes so: 8 + 255 * 3 = 773 which is greater than the 767 bytes limit.
Temporar solution was to change the enum type from EnumType.STRING to EnumType.ORDINAL (which reduced its size).

@Luxter Luxter changed the title user-role Faulty user-role mapping Sep 19, 2016
@kulasekp kulasekp added the bug label Sep 19, 2016
@kulasekp kulasekp added this to the 0.1 milestone Sep 19, 2016
@kulasekp kulasekp modified the milestones: 0.1, 0.2 Aug 9, 2017
@kulasekp kulasekp removed this from the 0.2 milestone Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants