jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/344602 )

Change subject: Revert "Remove old remapping hacks from Database::indexName()"
......................................................................


Revert "Remove old remapping hacks from Database::indexName()"

This reverts commit bec6151e5fe30e780d82527c4c53e54379149a4e.

Bug: T154872
Change-Id: I1c67aa464a1f151562ef92fce03f825113847814
---
M includes/libs/rdbms/database/Database.php
M includes/libs/rdbms/database/DatabaseSqlite.php
2 files changed, 22 insertions(+), 1 deletion(-)

Approvals:
  Paladox: Looks good to me, but someone else must approve
  Tim Starling: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index d072754..b8cf63c 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -1952,7 +1952,18 @@
         * @return string
         */
        protected function indexName( $index ) {
-               return $index;
+               // Backwards-compatibility hack
+               $renamed = [
+                       'ar_usertext_timestamp' => 'usertext_timestamp',
+                       'un_user_id' => 'user_id',
+                       'un_user_ip' => 'user_ip',
+               ];
+
+               if ( isset( $renamed[$index] ) ) {
+                       return $renamed[$index];
+               } else {
+                       return $index;
+               }
        }
 
        public function addQuotes( $s ) {
diff --git a/includes/libs/rdbms/database/DatabaseSqlite.php 
b/includes/libs/rdbms/database/DatabaseSqlite.php
index ab5b081..cd17248 100644
--- a/includes/libs/rdbms/database/DatabaseSqlite.php
+++ b/includes/libs/rdbms/database/DatabaseSqlite.php
@@ -427,6 +427,16 @@
        }
 
        /**
+        * Index names have DB scope
+        *
+        * @param string $index
+        * @return string
+        */
+       protected function indexName( $index ) {
+               return $index;
+       }
+
+       /**
         * This must be called after nextSequenceVal
         *
         * @return int

-- 
To view, visit https://gerrit.wikimedia.org/r/344602
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c67aa464a1f151562ef92fce03f825113847814
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_28
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to