Make LoadBalancer domain handling more robust
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 16 Sep 2016 18:32:23 +0000 (11:32 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 17 Sep 2016 02:31:13 +0000 (02:31 +0000)
commit32c7a9bf46b8ba8d81ed534ecb9bba29c4e50610
treefe994f363a939085f9df1f95fd1a502565399791
parent0a806b75f1450646bf54c36567e4085968ca0829
Make LoadBalancer domain handling more robust

* Cleanup setDomainPrefix() methods to handle existing LBs/DBs.
* This also makes it set just the prefix as the prefix rather
  than as the whole domain.
* Fix regression from 789a54a5f1 where "read" mode of
  tablePrefix()/dbSchema() still set the field.
* Make getConnectionRef() always have the domain set.
* Add a check in openConnection() for explicit local
  connections, treating $domain as false and avoiding
  openForeignConnection().

Bug: T145840
Change-Id: Idf392bd9992a215c4fa3bddf275562f3916596aa
includes/db/CloneDatabase.php
includes/db/Database.php
includes/libs/rdbms/lbfactory/LBFactory.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php
tests/phpunit/includes/db/DatabaseTest.php