Merge "rdbms: Disable DBConnRef::selectDB() for sanity"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / DBConnRef.php
index b414a2a..eba1657 100644 (file)
@@ -167,6 +167,9 @@ class DBConnRef implements IDatabase {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
+       /**
+        * @codeCoverageIgnore
+        */
        public function getWikiID() {
                return $this->getDomainID();
        }
@@ -284,6 +287,12 @@ class DBConnRef implements IDatabase {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
+       public function lockForUpdate(
+               $table, $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
+       ) {
+               return $this->__call( __FUNCTION__, func_get_args() );
+       }
+
        public function fieldExists( $table, $field, $fname = __METHOD__ ) {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
@@ -362,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() {