Page MenuHomePhabricator

Table prefix should be added to table names with uppercase characters
Closed, ResolvedPublic

Description

Author: rhaertel80

Description:
Currently, the replaceVars function in Database.php (used to replace variables in sourced SQL) only allows $wgDBprefix to be attached to tables with all lowercase names. This follows from the regular expression on line 2268 of Revision 25203 (last changed revision of Database.php is 24969):

$ins = preg_replace_callback( '/\/\*(?:\$wgDBprefix|_)\*\/([a-z_]*)/',

I request that uppercase characters be allowed in table names added by extensions(please let me know if there is a strict policy prohibiting this from MediaWiki extensions like my own):

$ins = preg_replace_callback( '/\/\*(?:\$wgDBprefix|_)\*\/([a-zA-Z_]*)/',


Version: 1.11.x
Severity: normal

Details

Reference
bz11084

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:50 PM
bzimport set Reference to bz11084.
bzimport added a subscriber: Unknown Object (MLST).

I would *very* strongly discourage non-lowercase table names, as behavior with respect to case-sensitivity and preservation is dependent on operating system behavior.

Should still fix the regex. :) Consider that other chars may be used as well, though.