https://bugzilla.wikimedia.org/show_bug.cgi?id=64365

--- Comment #2 from Ryan Schmidt <[email protected]> ---
There's definitely a change that needs to be made here (at the very least it
needs to gracefully fall back to no schema if the $dbType isn't in the list
without emitting an E_NOTICE for not finding the index), but I'm not certain
that a config variable is necessary for this, for a couple of reasons.

1) You can pass the desired schema in as part of the $options array to
DatabaseBase::factory(), e.g. $dbw = DatabaseBase::factory( 'customdb', array(
'schema' => 'foobar' ) );
2) By making it a configuration variable, that indicates that changing the
default values for existing database types is supported, when in reality that
is not the case (trying to set a schema for MySQL will end badly in all cases,
and even though Postgres and Oracle support them, the MediaWiki drivers for
them assume that there isn't one/it doesn't need to be specified so things may
subtly break).

An alternative would be a new hook to define the default schema for a new
database type, it would be passed in $dbType and &$schema (which allows for
setting a single schema for that database, defaulting to null). This way we
avoid the pitfalls of point 2 by not allowing the defaults for existing drivers
to be changed, while also avoiding the extra boilerplate required in the
solution presented in point 1 in the event a db object needs to be constructed
multiple times.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to