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

Database upgrade fails when coming from Geeklog 2.0.0 or earlier #1153

Open
dhaun opened this issue May 14, 2023 · 0 comments
Open

Database upgrade fails when coming from Geeklog 2.0.0 or earlier #1153

dhaun opened this issue May 14, 2023 · 0 comments
Labels
Bug An issue describing unexpected or malicious behaviour.

Comments

@dhaun
Copy link
Member

dhaun commented May 14, 2023

This took me a while to track down. As it says in the comment for $_TABLES['topic_assignments'] in mysql_tableanddata.php, the max. size for the PRIMARY KEY is approaching 1000 bytes, which is a limitation in some MySQL versions.

However, that limit is actually hit during the upgrade from Geeklog 2.0.0 to 2.1.0:

$_SQL[] = "ALTER TABLE {$_TABLES['topic_assignments']} CHANGE `tid` `tid` VARCHAR(128) NOT NULL";
$_SQL[] = "ALTER TABLE {$_TABLES['topic_assignments']} CHANGE `id` `id` VARCHAR(128) NOT NULL";

from sql/updates/mysql_2.0.0_to_2.1.0.php, lines 25+26

So you end up with len(tid + id + type) = 286, which is 1144 bytes for the utf8mb4 collation.

Simply commenting out / removing line 25 (for the tid) in mysql_2.0.0_to_2.1.0.php fixes the problem for me, but I'm not sure if that's the best approach.

@dhaun dhaun added the Bug An issue describing unexpected or malicious behaviour. label May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An issue describing unexpected or malicious behaviour.
Projects
None yet
Development

No branches or pull requests

1 participant