Last modified: 2012-08-04 20:48:58 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 T15430, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13430 - populateCategory does not work with Postgres
populateCategory does not work with Postgres
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.13.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2008-03-19 09:15 UTC by OverlordQ
Modified: 2012-08-04 20:48 UTC (History)
1 user (show)

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


Attachments

Description OverlordQ 2008-03-19 09:15:51 UTC
I got this error message once when browsing the wiki normally, a refresh of the page didn't show the error message again so I thought it was just some caching error since I just updated from svn.  However somebody in #mediawiki was asking about schema changes and I came across r32085 so I tried running the maintnence script, and sure enough, there was that error message again:

===
Warning: pg_query(): Query failed: ERROR:  current transaction is aborted, commands ignored until end of transaction block in /home/wiki/includes/DatabasePostgres.php on line 553
A database error has occurred
Query: SELECT  COUNT(*) AS pages,COUNT(IF(page_namespace=14,1,NULL)) AS subcats,COUNT(IF(page_namespace=6,1,NULL)) AS files  FROM categorylinks,page  WHERE cl_to = 'Rainbow_Tables' AND (page_id = cl_from)
Function: Category::refreshCounts
Error: 1 ERROR:  current transaction is aborted, commands ignored until end of transaction block

Backtrace:
#0 /home/wiki/includes/Database.php(799): DatabasePostgres->reportQueryError('ERROR:  current...', 1, 'SELECT  COUNT(*...', 'Category::refre...', false)
#1 /home/wiki/includes/Database.php(1244): Database->query('SELECT  COUNT(*...', 'Category::refre...')
#2 /home/wiki/includes/Database.php(1263): Database->select(Array, Array, Array, 'Category::refre...', '1OCK IN SHARE M...')
#3 /home/wiki/includes/Category.php(285): Database->selectRow(Array, Array, Array, 'Category::refre...', 'LOCK IN SHARE M...')
#4 /home/wiki/maintenance/populateCategory.inc(61): Category->refreshCounts()
#5 /home/wiki/maintenance/populateCategory.php(51): populateCategory('', 10, 0, false)
#6 {main}
====

If I try running that through something like phppgadmin you get a more helpful error message:

====
ERROR:  function if(boolean, integer, unknown) does not exist
LINE 1: SELECT  COUNT(*) AS pages,COUNT(IF(page_namespace=14,1,NULL)...
                                        ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

In statement:

SELECT  COUNT(*) AS pages,COUNT(IF(page_namespace=14,1,NULL)) AS subcats,COUNT(IF(page_namespace=6,1,NULL)) AS files  FROM mediawiki.categorylinks,mediawiki.page  WHERE cl_to = 'Rainbow_Tables' AND (page_id = cl_from)
====

for PG that should be something like:

====
SELECT  COUNT(*) AS pages,COUNT(CASE WHEN page_namespace=14 THEN 1 ELSE NULL END) AS subcats,COUNT(CASE WHEN page_namespace=6 THEN 1 ELSE NULL END) AS files  FROM categorylinks,page  WHERE cl_to = 'Rainbow_Tables' AND (page_id = cl_from)
====

Problem is on line 278 of trunk/phase3/includes/Category.php
Comment 1 Greg Sabino Mullane 2008-03-19 13:15:53 UTC
Should be fixed now, as of r32173. You will need to run maintenance/update.php to add the new category table first.

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


Navigation
Links