Commit graph

3 commits

Author SHA1 Message Date
Aaron Schulz
38b31bc8db Move DatabaseDomain to Rdbms namespace
Change-Id: Ifb06e792a36b5123ec3596933d0d394711ee5d08
2017-02-07 13:21:40 -08:00
Timo Tijhof
782254cf1f rdbms: Lazy-init DatabaseDomain::getId()
Follows-up 847b91b.

Noticed that in Xenon profiles, about 25% of Database::__construct
time is spent in array_map, via DatabaseDomain::convertToString.

* Database::__construct
  * DatabaseDomain::__construct/convertToString/array_map
  * DatabaseDomain::newUnspecified
    * DatabaseDomain::__construct/convertToString/array_map
  * DatabaseMysqlBase::open
    * mysqli::*

Change-Id: Ib5ae7d1d03b27df504a7e5f552e36a0ca6fcf97e
2016-09-28 21:50:17 +00:00
Aaron Schulz
847b91bf1f Make database classes handle hyphens in $wgDBname
* Add DatabaseDomain class to handle passing domains around.
It also can be cast to and from strings, which are of the same
format as wfWikiId() except with hyphens escaped.
* Make IDatabase::getDomainID() use these IDs so they can be
passed into LoadBalancer::getConnection() and friends without
breaking on sites with a hyphen in the DB name.
* Add more LBFactory unit tests for domains.

Bug: T145840
Change-Id: Icfed62b251af8cef706a899197c3ccdb730ef4d1
2016-09-17 15:29:21 -07:00