rdbms: make schema/prefix handling more consistent in LoadBalancer
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 22 Aug 2018 09:28:09 +0000 (02:28 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 23 Aug 2018 07:25:53 +0000 (00:25 -0700)
commita3160ceeba58961c29d977717c58b41d2a7a0360
tree23ada4c1cc6652e420d268f71f47b9b3a7468edd
parenteee4385869fab8d1b5dde7bd3f6520ed880ef673
rdbms: make schema/prefix handling more consistent in LoadBalancer

Move "tablePrefix" logic to LoadBalancer::reallyOpenConnection and
make it more consistent for local vs foreign connections. The prefix
for local connections is now set even if $domain does not provide a
database.

Also set the schema even if $domain does not provide a database.

Typically a database domain is either fully specified or comes from
DatabaseDomain::newUnspecified(), but there's no reason not to use
at least the schema/prefix of otherwise unspecified domains. The only
other sensible option would be some sort of exception.

Change-Id: Ib52f4b69e429810e3c5eac92a48aecf7b22e86e6
includes/libs/rdbms/loadbalancer/LoadBalancer.php