Last modified: 2012-12-19 16:40:23 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 T45253, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43253 - SQL query error in CategoryTree::renderParents
SQL query error in CategoryTree::renderParents
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CategoryTree (Other open bugs)
master
All All
: High major with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-19 00:36 UTC by Matthew Flaschen
Modified: 2012-12-19 16:40 UTC (History)
3 users (show)

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


Attachments

Description Matthew Flaschen 2012-12-19 00:36:29 UTC
https://en.wikipedia.org/w/index.php?title=Special%3ACategoryTree&target=Meteorites&mode=all&namespaces= gives the error:

Technical details about this error:
Last attempted database query: (SQL query hidden)
Function: CategoryTree::renderParents
MySQL error: 1054: Unknown column 'page_namespace' in 'field list' (10.0.6.69)
Comment 1 Dereckson 2012-12-19 01:29:05 UTC
See also http://wikitech.wikimedia.org/view/Schema_changes
Comment 2 Sam Reed (reedy) 2012-12-19 13:48:53 UTC
(In reply to comment #1)
> See also http://wikitech.wikimedia.org/view/Schema_changes

Why?
Comment 3 Sam Reed (reedy) 2012-12-19 13:55:18 UTC
		$res = $dbr->select(
			'categorylinks',
			array(
				NS_CATEGORY => 'page_namespace',
				'cl_to' => 'page_title'
			),
			array( 'cl_from' => $title->getArticleID() ),
			__METHOD__,
			array(
				'LIMIT' => $wgCategoryTreeMaxChildren,
				'ORDER BY' => 'cl_to'
			)
		);
Comment 4 Sam Reed (reedy) 2012-12-19 13:59:29 UTC
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
SELECT page_namespace,page_title AS cl_to FROM `mw_categorylinks` WHERE cl_from = '2' ORDER BY cl_to LIMIT 200
from within function ‘CategoryTree::renderParents.’ Database returned error ‘1054: Unknown column 'page_namespace' in 'field list' (192.168.0.212).’

reedy@fenari:~$ mwscript eval.php enwiki
> $dbr = wfGetDB( DB_SLAVE );

> $res = $dbr->select( 'categorylinks', array( NS_CATEGORY => 'page_namespace', 'cl_to' => 'page_title' ), array( 'cl_from' => 1 ), __METHOD__, array( 'LIMIT' => 10, 'ORDER BY' => 'cl_to' ) );
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: SELECT  page_namespace,page_title AS cl_to  FROM `categorylinks`  WHERE cl_from = '1'  ORDER BY cl_to LIMIT 10
Function:
Error: 1054 Unknown column 'page_namespace' in 'field list' (10.0.6.46)

reedy@fenari:~$ mwscript eval.php enwiki
> $dbr = wfGetDB( DB_SLAVE );                                                                                                                                           
> $res = $dbr->select( 'categorylinks', array( 'page_namespace' => NS_CATEGORY, 'page_title' => 'cl_to' ), array( 'cl_from' => 1 ), __METHOD__, array( 'LIMIT' => 10, 'ORDER BY' => 'cl_to' ) );
Comment 5 Sam Reed (reedy) 2012-12-19 14:01:19 UTC
> $sql = $dbr->selectSQLText( 'categorylinks', array( 'page_namespace' => NS_CATEGORY, 'page_title' => 'cl_to' ), array( 'cl_from' => 1 ), __METHOD__, array( 'LIMIT' => 10, 'ORDER BY' => 'cl_to' ) );

> var_dump( $sql );
string(118) "SELECT  14 AS page_namespace,cl_to AS page_title  FROM `categorylinks`  WHERE cl_from = '1'  ORDER BY cl_to LIMIT 10  "


https://gerrit.wikimedia.org/r/39384
Comment 6 Sam Reed (reedy) 2012-12-19 16:40:23 UTC
Fixed

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


Navigation
Links