Last modified: 2013-10-02 21:20:45 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 T55760, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53760 - When database table prefix is set, tables in SQL should be aliased into their original names
When database table prefix is set, tables in SQL should be aliased into their...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-04 16:59 UTC by Liangent
Modified: 2013-10-02 21:20 UTC (History)
2 users (show)

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


Attachments

Description Liangent 2013-09-04 16:59:16 UTC
Normally it looks sane to write:

wfGetDB(DB_SLAVE)->selectSQLText('objectcache','objectcache.keyname');

but with database prefix set to "pf_", the resulting SQL becomes:

SELECT objectcache.keyname FROM `pf_objectcache`

which doesn't work.
Comment 1 db [inactive,noenotif] 2013-09-08 09:18:57 UTC
in this case you must not use the full name of the column, because it is not ambigious

As workaround you can set alias yourself:

wfGetDB(DB_SLAVE)->selectSQLText(array( 'oc' => 'objectcache' ),'oc.keyname');
Comment 2 Siebrand Mazeland 2013-10-02 21:20:45 UTC
Patch set that surfaced this is Gerrit change #65477.

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


Navigation
Links