Last modified: 2014-11-10 20:08:39 UTC
A unit test https://gerrit.wikimedia.org/r/#/c/48098/ fails on Sqlite backend, but functions properly with MySql backend. The test creates two pages with the [[Category:AQBT-Cat]], and tests that a call to api api.php?action=query&list=allcategories&acprefix=AQBT- returns only one value. With sqlite, two identical values are returned.
That sounds like table category gets two entries with cat_pages=1 instead of one with cat_pages=2 (output lags this info, can you add acprop=size?), sounds impossible due to a unique index there
I suspect the indexes are not created when unit test harness clones DBs, but have no easy way to very this. The strange thing is that this bug only occurs with categories, not with page links or templates
That is bug 37702 There is a difference, because here a extra table category is used to count the entries. There is no table template or link to count the entries per template/link. Have a look at WikiPage::updateCategoryCounts, why you get duplicates.
(In reply to comment #3) > That is bug 37702 db, but the unit tests work when testing with MySql, and all queries are identical, which makes me believe that the clone table without "unique" index is what causes this issue. Setting dependent bug to 37702.
Maybe foreign keys are duplicated on mysql and not on sqlite. Have a look at duplicateTableStructure of DatabaseSqlite or DatabaseMysql to check that
The relying on the unique index changed with I7e6d07e42cc06cedbd9d10ed9f276f20636dc222