Schema change: change cl_type from ENUM('page', 'subcat', 'file') to varchar(6)....
authorRoan Kattouw <catrope@users.mediawiki.org>
Sun, 13 Mar 2011 10:35:06 +0000 (10:35 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sun, 13 Mar 2011 10:35:06 +0000 (10:35 +0000)
commit4bfddfe4bffa4b23ef290a50b9830936eb475632
treecd13cb067aadec64f1276733bb6652b82ecdf814
parent7e9149bb02a44b7327b9d1622d38c5f572c1b433
Schema change: change cl_type from ENUM('page', 'subcat', 'file') to varchar(6). This is needed because MySQL sorts 'page' < 'subcat' < 'file' when using ORDER BY cl_type but uses 'file' < 'page' < 'subcat' for the purposes of WHERE clauses, making paging impossible. Changing the ENUM() order to be alphabetical would fix the order discrepancy, but leave range scans like WHERE cl_type > 'page' unindexed. Varchars do behave correctly. Changing to an int was not an option because existing data would have to be migrated.

This commit does not include a patch for SQLite, because ALTER TABLE MODIFY is apparently not supported by SQLite as far as I could tell by Googling. Leaving resolution of this issue for SQLite to the SQLite experts; maybe SQLite's enum implementation is saner than MySQL and it doesn't even need this schema change, I don't know.
includes/installer/MysqlUpdater.php
maintenance/archives/patch-cl_type.sql [new file with mode: 0644]
maintenance/tables.sql