fatfree-core icon indicating copy to clipboard operation
fatfree-core copied to clipboard

Added primary key length for mysql

Open n0nag0n opened this issue 5 years ago • 4 comments

This table fails to create if your default charset is utf8mb4 for your database because the key length of 255 is too long. This should fix it.

n0nag0n avatar Nov 13 '20 17:11 n0nag0n

Depending on session.hash-function in php.ini, the session ID might be longer than just 20. With utf8mb4 you can only index 191 chars in certain version, so I guess it'll be better to cap this so 128 here.

ikkez avatar Dec 13 '20 09:12 ikkez

Just tried it myself with utf8mb4_unicode_ci and the current version and there's no problem to create the table, column session_id (255) and the default index. MySQL 5.7.26 / PHP7.4

ikkez avatar Dec 13 '20 09:12 ikkez

Okay this only seems to be an issue for older databases / tables in MYISAM format. Since that is not the default anymore since (mysql 5.5) we can probably ignore this.

ikkez avatar Dec 13 '20 10:12 ikkez

Hmm I'll have to try it again on a new project to see if it's still an issue. I had to do this manually for like 3 projects because of the length issue about .... 4-5 months ago

n0nag0n avatar Dec 13 '20 14:12 n0nag0n