Remove exception and drop cloned tables in PostgresSQL too
authoryoonghm <yoonghm@gmail.com>
Sun, 27 Sep 2015 03:02:10 +0000 (11:02 +0800)
committerFederico Leva <federicoleva@tiscali.it>
Tue, 13 Jun 2017 17:31:06 +0000 (19:31 +0200)
In PostgresSQL
a) Temp tables are automatically deleted upon end of session
b) Same temp table name hides existing table for current session

It is not necessary to consider 'postgres' during dropping of table.
I guess similar logic for Oracle but I could not verify.
It seems that no one use Oracle for MediaWiki.

Bug: T113445
Change-Id: I37b5483a6e9abe5cda0d4dfc103c287641f277a7

includes/db/CloneDatabase.php

index 809b660..6d18444 100644 (file)
@@ -93,8 +93,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