Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

db-setup.mysql wrongly uses too long keys #154

Open
mid1221213 opened this issue Aug 28, 2017 · 1 comment
Open

db-setup.mysql wrongly uses too long keys #154

mid1221213 opened this issue Aug 28, 2017 · 1 comment

Comments

@mid1221213
Copy link
Contributor

The creation of the table authreg with that script fails on my installation (Ubuntu 17.04) with the message ERROR 1071 (42000): Specified key was too long; max key length is 255 bytes.

I don't know where the max key length is set in MySQL, but apparently, according to what I've seen on some Q&As, using keys that long is useless. Manually editing the file db-setup.mysql to modify is simple, but IMHO this file should be changed to not use keys as long as the maximum field size, maybe 50 for example.

FYI, and if I understood correctly, the authreg table as it tries to create it with the original file would use two 255-length keys, that means 2 times 255 times 2 (the last because of UTF8) = 1020 bytes keys.

@lifeofguenter
Copy link
Contributor

Looking at this: https://github.com/jabberd2/jabberd2/blob/master/storage/authreg_mysql.c#L46 it should be configurable, or at least set to a much lower value (maybe max 128?) to realistically fit in mysql with utf8mb

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants