From b620b4a2542a148166e6ca6da9da4027face1b95 Mon Sep 17 00:00:00 2001 From: yoonghm Date: Sun, 27 Sep 2015 11:02:10 +0800 Subject: [PATCH] Remove exception and drop cloned tables in PostgresSQL too 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 809b660a1b..6d1844494c 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -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 -- 2.20.1