Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324809

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

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

This reverts commit bec6151e5fe30e780d82527c4c53e54379149a4e.

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/324809/1

diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index 4f663b3..7e80221 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -1981,7 +1981,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 f201dad..2281f23 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/324809
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib479f0e8f604a0cc0899f23c35a0f5eaf84d5031
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy <re...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to