rdbms: Disable DBConnRef::selectDB() for sanity
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 14 Aug 2018 07:27:27 +0000 (00:27 -0700)
committerKrinkle <krinklemail@gmail.com>
Wed, 15 Aug 2018 03:03:51 +0000 (03:03 +0000)
Bug: T193565
Change-Id: I4276d1a7d77a019e0e60dab4b9ec36c93e418037

includes/libs/rdbms/database/DBConnRef.php

index 7cb0604..eba1657 100644 (file)
@@ -371,7 +371,8 @@ class DBConnRef implements IDatabase {
        }
 
        public function selectDB( $db ) {
-               return $this->__call( __FUNCTION__, func_get_args() );
+               // Disallow things that might confuse the LoadBalancer tracking
+               throw new DBUnexpectedError( $this, "Database selection is disallowed to enable reuse." );
        }
 
        public function getDBname() {