Add table prefix in new MySQL tableExists()
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 21 Sep 2016 15:43:15 +0000 (11:43 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 21 Sep 2016 15:44:06 +0000 (11:44 -0400)
Bug: T146289
Change-Id: If73907f69471a6a91e1db7131a57439f950c5d8c

includes/libs/rdbms/database/DatabaseMysqlBase.php

index 7abfb17..39cf5bc 100644 (file)
@@ -519,6 +519,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
        }
 
        function tableExists( $table, $fname = __METHOD__ ) {
        }
 
        function tableExists( $table, $fname = __METHOD__ ) {
+               $table = $this->tableName( $table, 'raw' );
                $encLike = $this->buildLike( $table );
 
                return $this->query( "SHOW TABLES $encLike", $fname )->numRows() > 0;
                $encLike = $this->buildLike( $table );
 
                return $this->query( "SHOW TABLES $encLike", $fname )->numRows() > 0;