[PHPBB3-9551] Mysql fulltext index creation fails due to partial collation change Created: 20/Apr/10 Updated: 22/Jan/17 Resolved: 19/Jun/12
|Reporter:||Oleg [X] (Inactive)||Assignee:||Nils Adermann|
Mysql with fulltext search
|GitHub Pull Request URL:||https://github.com/phpbb/phpbb3/pull/849|
Support topic: http://www.phpbb.com/community/viewtopic.php?f=46&t=2035165
In mysql if a fulltext index is created over multiple columns, collations of all of those columns must be the same. In the linked code above, the procedure for creating a fulltext index changes collation on post text but not on post subject.
If the affected columns already use the target collation, changing collation on one column is a no-op. If affected columns use different collation, after the code runs collation on columns differs and index creation fails.
A fix would be changing collation on both columns.
Also note that the commented out line unconditionally changes subject column length to 100 chars. In support topic linked above the user's subject column was 255 chars long. Depending on mysql version changing length to 100 chars (or any fixed number, for that matter) may result in silent data loss.
|Comment by Nils Adermann [ 19/Jun/12 ]|
I have no idea why/who commented out this line which broke this:
Someone should find out where this was done. The code should simply use the varchar length that phpBB uses. Supporting unknown random schema changes within phpBB is not something we have ever done elsewhere and not something I plan on supporting. If you want to go and modify your schema you will have to adapt the code as well.