Last modified: 2012-08-04 20:49:04 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 T20909, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18909 - DatabasePostgres missing insertSelect wrapper
DatabasePostgres missing insertSelect wrapper
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.15.x
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: ---


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

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.

BT:
===
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...
^

Backtrace:

#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.


Navigation
Links