[Mediawiki-l] $dbr->selectDB

Jim Hu jimhu at tamu.edu
Sun Aug 26 15:03:12 UTC 2007

On Aug 25, 2007, at 7:27 PM, Michael Daly wrote:

> Rob Church wrote:
>> On 25/08/07, Michael Daly <michaeldaly at kayakwiki.org> wrote:
>>> But $wgDBprefix should be applied to all tables.  If you have a wiki
>>> family sharing MySQL, the only differentiation between each  
>>> member of
>>> the family is the relative value of $wgDBprefix.  Hence the end  
>>> result is
>> This statement seems to assume that "wiki families" all exist in the
>> same database, which is an odd assumption.
> Sorry - maybe I'm confused.
> Each wiki family member has a separate catalog entry in MySQL.  All  
> the
> tables within each family share the same prefix - which I assume is
> $wgDBprefix.  So you can have, say, a table called "en_page" (i.e.
> $wgDBprefix = "en_") for an English family member, "fr_page" for a
> French family member etc.  Hence the need to have the prefix on the
> extension's tables to make them consistent with all the other  
> tables in
> the database.  Otherwise the tables would look like:
> EnglishWiki
>    en_archive
>    en_categorylinks
>    en_externallinks
> ...
>    extensiontable
> ...
> FrenchWiki
>    fr_archive
>    fr_categorylinks
>    fr_externallinks
> ...
>    extensiontable
> ...

What I had in mind back when I raised this is that the extension  
prefix is not a variable, it's a naming convention so if we used


to provide a db table for an extension, $wgDBprefix would still be  
applied to give


Within the extension code, the extension developer would hardcode  
et_extensiontable, and the MW database methods would prepend  
$wgDBprefix as needed.

The naming convention just assures that extensions will never add  
tables with names that clash with table names added by the MW core  
devs.  To prevent clashes between extensions, we'd add a registry  
page on mediawiki.org.

> I'd prefer the en_ and fr_ in front of extensiontable to be  
> consistent.
>   The naming options as per Dan's recent post sound right to me.
> If this prefix is a variable other than $wgDBprefix, my apologies.

So, I was not proposing a variable.  See above.  But no need to  
apologize.  If it wasn't clear, it was probably that the proposal was  


> Mike
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128

More information about the MediaWiki-l mailing list