Last modified: 2014-11-10 20:08:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 44790 - Sqlite category table contains duplicates in unit tests
Sqlite category table contains duplicates in unit tests
Status: NEW
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on: 37702
Blocks: sqlite
  Show dependency treegraph
Reported: 2013-02-08 08:41 UTC by Yuri Astrakhan
Modified: 2014-11-10 20:08 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Yuri Astrakhan 2013-02-08 08:41:41 UTC
A unit test 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.
Comment 1 db [inactive,noenotif] 2013-02-10 11:05:23 UTC
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
Comment 2 Yuri Astrakhan 2013-02-10 15:25:52 UTC
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
Comment 3 db [inactive,noenotif] 2013-02-10 20:22:17 UTC
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.
Comment 4 Yuri Astrakhan 2013-02-25 15:51:43 UTC
(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.
Comment 5 db [inactive,noenotif] 2013-03-16 17:23:53 UTC
Maybe foreign keys are duplicated on mysql and not on sqlite.

Have a look at duplicateTableStructure of DatabaseSqlite or DatabaseMysql to check that
Comment 6 db [inactive,noenotif] 2013-06-29 11:13:54 UTC
The relying on the unique index changed with I7e6d07e42cc06cedbd9d10ed9f276f20636dc222

Note You need to log in before you can comment on or make changes to this bug.