Last modified: 2012-12-07 10:43:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44226, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42226 - MediaWikiSiteTest::testRemove gets a duplicate key error
MediaWikiSiteTest::testRemove gets a duplicate key error
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
1.21.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Jeroen De Dauw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-17 10:26 UTC by Umherirrender
Modified: 2012-12-07 10:43 UTC (History)
4 users (show)

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


Attachments

Description Umherirrender 2012-11-17 10:26:41 UTC
1) MediaWikiSiteTest::testRemove with data set #0 (array('foo'), true)
DBQueryError: A database error has occurred.  Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: INSERT  INTO `unittest_sites` (site_id,site_global_key,site_type,site_group,site_source,site_language,site_protocol,site_domain,site_data,site_forward,site_config) VALUES (NULL,'foo','unknown','none','local','en','','.','a:0:{}','','a:0:{}')
Function: ORMRow::insert
Error: 1062 Duplicate entry 'foo' for key 'sites_global_key' (localhost)


\includes\db\Database.php:996
\includes\db\Database.php:962
\includes\db\Database.php:1720
\includes\db\ORMRow.php:397
\includes\db\ORMRow.php:338
\includes\site\SiteObject.php:465
\tests\phpunit\includes\db\ORMRowTest.php:167
\tests\phpunit\MediaWikiTestCase.php:87
\tests\phpunit\MediaWikiPHPUnitCommand.php:45
\tests\phpunit\phpunit.php:107

Looks like the ORMRow is not populated right and the id for the deletion is null.
Comment 1 Umherirrender 2012-11-23 15:12:58 UTC
Seeing
DELETE FROM `unittest_sites` WHERE site_id IS NULL

in the log, looks like the object is not populated before calling the remove method, because I am not seeing something like

SELECT ... FROM unittest_sites WHERE ...

But why this works on jenkins?
Comment 2 Jeroen De Dauw 2012-12-06 22:33:46 UTC
Thanks for reporting :)
Comment 3 Jeroen De Dauw 2012-12-06 23:45:10 UTC
https://gerrit.wikimedia.org/r/#/c/37328/
Comment 4 Antoine "hashar" Musso (WMF) 2012-12-07 10:43:47 UTC
Merged in! Thanks for the report and patch.

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


Navigation
Links