Last modified: 2010-05-15 15:59:44 UTC
Hello, I am following on from bug 11450, and now have this problem. Query "ALTER TABLE `imagelinks` DROP INDEX il_to, ADD INDEX il_to(il_to, il_from) " failed with error code "Specified key was too long; max key length is 1000 bytes (localhost)". It did complain about imagelinks (or pagelinks?) not existing, but I reloaded the config/index.php and it went on. However, it's stopping here. PS. Thanks for the speed fix to the 11450 problem :)
Hrm.... there should be no way that index is going to be too long. Even if the utf-8 case it'd be like 769 bytes. Ah, it looks like 1.2 had an older form of the imagelinks table where il_from is a string, which is longer. The new imagelinks table (with page ID for il_from) is present from 1.3. The updaters seem to be missing the restructuring of the imagelinks table, though. The links table is restructured via do_old_links_update() (via convertLinks.inc), and the index isn't added until do_backlinking_indices_update() later on. Probably convertLinks.inc needs to be redone to apply the updates on the imagelinks table as well. Surprised nobody's caught this yet; I guess it sort of works even if you leave the string there, unless the index hits you. ;)
I know I'm being a pain, updating from such an old version - sorry about that. Are there any SQL commands I can run to get past this stage?
Hello - just wondering if there's any quick fix that I can do to get me past this as my Wiki has been down for quite a while.
Just redo the imagelinks table from tables.sql.
I've rolled back to the old one now. What do you mean by "redo"? Create?
Fixed in r50580 for release in MW 1.15. Note that you will have to run maintenance/refreshLinks.php after you install if you want the imagelinks table to be populated.