rdbms: clean up use of ATTACH queries in DatabaseSqlite
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 26 Aug 2019 18:17:12 +0000 (11:17 -0700)
committerKrinkle <krinklemail@gmail.com>
Sun, 1 Sep 2019 21:55:45 +0000 (21:55 +0000)
commit3d5faa10f4028f9742df5aaed86a1889b928dc26
treec6a41229932d0c59415c0fb0dc7d09f0428f1b4e
parent13f4dfb519ebdc75b39109c11d31868faa56d49c
rdbms: clean up use of ATTACH queries in DatabaseSqlite

Defer the queries until a connection exists. Only issue issue the
them for databases that are different than the currently opened file.
Also, make handleSessionLossPreconnect() aware of attached databases.

In LoadBalancer::reallyOpenConnection(), avoid having the "catch" block
appear like it returns a half-constructed Database.

Change-Id: I9f676bb72a1ab06f0eac5820dce28231741c283d
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseSqlite.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php