Last modified: 2012-11-01 17:29:50 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 T43269, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41269 - SQLStore3 update.php error: duplicate key in smw_stats
SQLStore3 update.php error: duplicate key in smw_stats
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
master
All All
: Normal blocker (vote)
: ---
Assigned To: Nischay Nahata
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-22 12:56 UTC by Jeroen De Dauw
Modified: 2012-11-01 17:29 UTC (History)
2 users (show)

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


Attachments

Description Jeroen De Dauw 2012-10-22 12:56:26 UTC
When running update.php on SQLStore3 I'm getting the following error:

Setting up internal property indices ...
   ... space for internal properties already allocated.
   ... writing entries for internal properties ...A database query syntax error has occurred.
The last attempted database query was:
"INSERT  INTO `mw_smw_stats` (pid,usage_count) VALUES ('1','0')"
from within function "SMWSQLStore3SetupHandlers::setupPredefinedProperties".
Database returned error "1062: Duplicate entry '1' for key 'pid' (localhost)"

This is after it was already setup, so presumably a check is failing and trying to create an index that already exists.
Comment 1 Jeroen De Dauw 2012-10-22 13:07:45 UTC
Looks like there are queries that are not using the MW DB abstraction layer and breaking whenever run on a setup that uses table prefixes.

Some are fixed here https://gerrit.wikimedia.org/r/#/c/29302/
Comment 2 Nischay Nahata 2012-10-24 08:19:33 UTC
This can be fixed by replacing the insert query in SMW_SQLStore3_SetupHandlers.php (line 230) with a replace query like this

			// Properties also need to be in smw_stats
			$db->replace(
				'smw_stats',
				array( 'pid' ),
				array(
					'pid' => $id,
					'usage_count' => 0
				),
				__METHOD__
			);


But unfortunately I am not able to push my commits right now through git.
Comment 3 Nischay Nahata 2012-10-24 09:10:29 UTC
Yay! git worked
https://gerrit.wikimedia.org/r/#/c/29753/

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


Navigation
Links