Page MenuHomePhabricator

Duplicate entry 'updatelist' for key 'PRIMARY'
Closed, ResolvedPublic

Description

Author: physik

Description:
While trying to test the creation and deletion of the database updates of the math extension, I get the following error:

  1. DatabaseTest::testDebugCreateTable

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_updatelog (ul_key,ul_value) VALUES ('updatelist-1.21wmf9-1361359986','a:2:{i:0;a:4:{i:0;s:8:\"addTable\";i:1;s:4:\"math\";i:2;s:54:\"/PATHTOWIKI/extensions/Math/db/math.sql\";i:3;b:1;}i:1;a:4:{i:0;s:8:\"addTable\";i:1;s:9:\"mathindex\";i:2;s:66:\"/PATHTOWIKI/extensions/MathSearch/db/mathsearch.sql\";i:3;b:1;}}')
Function: DatabaseUpdater::setAppliedUpdates
Error: 1062 Duplicate entry 'updatelist-1.21wmf9-1361359986' for key 'PRIMARY' (localhost)

The error occurs while trying to execute the following code a second time

		$this->db->dropTable("math",__METHOD__);
		$dbu=DatabaseUpdater::newForDB($this->db);
		$dbu->doUpdates(array("extensions"));

If I add a sleep(1); command prior to the second execution the error message vanishes.


Version: 1.22.0
Severity: minor
OS: Linux
Platform: PC
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=35912

Details

Reference
bz45194

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:41 AM
bzimport set Reference to bz45194.
bzimport added a subscriber: Unknown Object (MLST).

It's probably another case of SQLite behaving differently. See bug 35912.

physik wrote:

With the latest core version the bug is gone for me.

physik wrote:

maybe I should set it to fixed

Related URL: https://gerrit.wikimedia.org/r/69302 (Gerrit Change Ibb288aba0fd68f25ef012f82489d6f87d9bac072)

Related URL: https://gerrit.wikimedia.org/r/69302 (Gerrit Change Ibb288aba0fd68f25ef012f82489d6f87d9bac072)

https://gerrit.wikimedia.org/r/69302 (Gerrit Change Ibb288aba0fd68f25ef012f82489d6f87d9bac072) | change APPROVED and MERGED [by Physikerwelt]