Merge "Change 'editfont' default preference to 'monospace'"
[lhc/web/wiklou.git] / includes / db / CloneDatabase.php
index c4921e2..3d22c03 100644 (file)
@@ -24,6 +24,7 @@
  * @ingroup Database
  */
 use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\IMaintainableDatabase;
 
 class CloneDatabase {
        /** @var string Table prefix for cloning */
@@ -45,8 +46,6 @@ class CloneDatabase {
        private $db;
 
        /**
-        * Constructor
-        *
         * @param IMaintainableDatabase $db A database subclass
         * @param array $tablesToClone An array of tables to clone, unprefixed
         * @param string $newTablePrefix Prefix to assign to the tables
@@ -92,8 +91,10 @@ class CloneDatabase {
                        self::changePrefix( $this->newTablePrefix );
                        $newTableName = $this->db->tableName( $tbl, 'raw' );
 
+                       // Postgres: Temp tables are automatically deleted upon end of session
+                       //           Same Temp table name hides existing table for current session
                        if ( $this->dropCurrentTables
-                               && !in_array( $this->db->getType(), [ 'postgres', 'oracle' ] )
+                               && !in_array( $this->db->getType(), [ 'oracle' ] )
                        ) {
                                if ( $oldTableName === $newTableName ) {
                                        // Last ditch check to avoid data loss