Last modified: 2012-08-04 20:49:05 UTC
Found "duplicate key value violates unique constraint "category_title"" in my logs while doing importDump and seeing that it is defined in tables.sql as CREATE UNIQUE INDEX category_title ON category(cat_title); I thought there might be something wrong with the dump, but grepping for the title ("Articles_with_example_pseudocode") only found the following in my logs: LOG: statement: INSERT /* LinksUpdate::incrTableUpdate 127.0.0.1 */ INTO categorylinks (cl_from,cl_to,cl_sortkey,cl_timestamp,cl_sortkey_prefix,cl_collation,cl_type) VALUES ('439','Articles_with_example_pseudocode','ALGORITHMS FOR CALCULATING VARIANCE LOG: statement: SELECT /* LinksUpdate::invalidatePages 127.0.0.1 */ page_id FROM page WHERE page_namespace = '14' AND (page_title IN ('Statistical_algorithms','Statistical_deviation_and_dispersion','Articles_with_example_pseudocode')) AND (page_touched < '2011-02-09 18:07:14 GMT') LOG: statement: INSERT /* Article::updateCategoryCounts 127.0.0.1 */ INTO category (cat_id,cat_title) VALUES ('1586','Articles_with_example_pseudocode') STATEMENT: INSERT /* Article::updateCategoryCounts 127.0.0.1 */ INTO category (cat_id,cat_title) VALUES ('1586','Articles_with_example_pseudocode') LOG: statement: UPDATE /* Article::updateCategoryCounts 127.0.0.1 */ category SET cat_pages = cat_pages + 1 WHERE cat_title IN ('Statistical_algorithms','Statistical_deviation_and_dispersion','Articles_with_example_pseudocode') (The error occured on the "category" INSERT statement)
I'm pretty sure the index itself is not the problem, as this is simply copied from the original MySQL tables.sql nearly verbatim.
This is because we have INSERT IGNORE emulation there, so the error should be ignored. The debug log should say: SQL ERROR (ignored): .... If something wrong still happens, please update to r113534 and see if it got better; if not please include $wgShowExceptionDetails = true; $wgShowSQLErrors = true; $wgShowDBErrorBacktrace = true; $wgDebugDumpSql = true; $wgDebugDBTransactions = true; in your LocalSettings.php