Last modified: 2012-08-04 20:49:04 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 18909 - DatabasePostgres missing insertSelect wrapper
DatabasePostgres missing insertSelect wrapper
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Greg Sabino Mullane
: 19088 (view as bug list)
Depends on:
Blocks: postgres
  Show dependency treegraph
Reported: 2009-05-25 16:08 UTC by OverlordQ
Modified: 2012-08-04 20:49 UTC (History)
2 users (show)

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

bad patch (2.58 KB, patch)
2009-05-25 16:59 UTC, OverlordQ

Description OverlordQ 2009-05-25 16:08:02 UTC
The DatabasePostgres class is missing an insertSelect wrapper so it uses the method in Database.php which does not take into account the special handling for INSERT IGNORE.

A database error has occurred
Query: INSERT IGNORE INTO page_restrictions (pr_page,pr_type,pr_level,pr_cascade,pr_user,pr_expiry) SELECT 964,pr_type,pr_level,pr_cascade,pr_user,pr_expiry FROM page_restrictions WHERE pr_page = '5'
Function: Title::moveTo
Error: 1 ERROR: syntax error at or near "IGNORE"
LINE 1: INSERT /* Title::moveTo EvilWiki */ IGNORE INTO page_restric...


#0 /var/www/domain/wiki/includes/db/Database.php(616): DatabasePostgres->reportQueryError('ERROR: syntax ...', 1, 'INSERT IGNORE I...', 'Title::moveTo', false)
#1 /var/www/domain/wiki/includes/db/Database.php(1809): Database->query('INSERT IGNORE I...', 'Title::moveTo')
#2 /var/www/domain/wiki/includes/Title.php(2724): Database->insertSelect('page_restrictio...', 'page_restrictio...', Array, Array, 'Title::moveTo', Array)
#3 /var/www/domain/wiki/extensions/Renameuser/SpecialRenameuser_body.php(306): Title->moveTo(Object(Title), false, 'Automatically m...')
#4 /var/www/domain/wiki/includes/SpecialPage.php(559): SpecialRenameuser->execute(NULL)
#5 /var/www/domain/wiki/includes/Wiki.php(233): SpecialPage::executePath(Object(Title))
#6 /var/www/domain/wiki/includes/Wiki.php(62): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
#7 /var/www/domain/wiki/index.php(117): MediaWiki->initialize(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))
#8 {main}
Comment 1 Greg Sabino Mullane 2009-05-25 16:48:09 UTC
Thanks for the report, I'll look into this. If there is any special action needed on that special page to trigger the problem, please post it here.
Comment 2 OverlordQ 2009-05-25 16:59:49 UTC
Created attachment 6151 [details]
bad patch

Nothing special required, just whatever calls insertSelect with the IGNORE option which the only place I've found is in Title::moveTo when moving a protected page.

He's my rough sketchup, lots of duplicated code from insert to handle the ignore, didn't really see a good way to shoehorn it into the existing insert function.
Comment 3 Alexandre Emsenhuber [IAlex] 2009-06-05 09:18:57 UTC
*** Bug 19088 has been marked as a duplicate of this bug. ***
Comment 4 Alexandre Emsenhuber [IAlex] 2009-06-05 16:29:20 UTC
*** Bug 19088 has been marked as a duplicate of this bug. ***
Comment 5 OverlordQ 2009-10-27 05:34:40 UTC
Applied in r58179 likely could be better reworked as a calling DB::select and DB::insert separately instead of duplicating rollback code.

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