Anomie has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393929 )

Change subject: Drop archive.ar_text and ar_flags
......................................................................

Drop archive.ar_text and ar_flags

This should have been done long ago. Now it is being done.

This also changes ar_text_id to NOT NULL, since it should never be null
anymore.

Bug: T33223
Change-Id: I18f1c740b7537c7dc3cfeba9b241d0a9f31caa34
---
M includes/Revision.php
M includes/api/ApiQueryAllDeletedRevisions.php
M includes/api/ApiQueryDeletedRevisions.php
M includes/api/ApiQueryDeletedrevs.php
M includes/installer/DatabaseUpdater.php
M includes/page/PageArchive.php
M includes/page/WikiPage.php
A maintenance/archives/patch-drop-ar_text.sql
M maintenance/migrateArchiveText.php
A maintenance/mssql/archives/patch-drop-ar_text.sql
M maintenance/mssql/tables.sql
A maintenance/oracle/archives/patch-drop-ar_text.sql
M maintenance/oracle/tables.sql
A maintenance/postgres/archives/patch-drop-ar_text.sql
M maintenance/postgres/tables.sql
A maintenance/sqlite/archives/patch-drop-ar_text.sql
M maintenance/storage/trackBlobs.php
M maintenance/tables.sql
M tests/phpunit/includes/RevisionTest.php
19 files changed, 127 insertions(+), 106 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/393929/1

diff --git a/includes/Revision.php b/includes/Revision.php
index 25c89c2..8712d0b 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -219,13 +219,6 @@
                        $attribs['title'] = Title::makeTitle( 
$row->ar_namespace, $row->ar_title );
                }
 
-               if ( isset( $row->ar_text ) && !$row->ar_text_id ) {
-                       // Pre-1.5 ar_text row
-                       $attribs['text'] = self::getRevisionText( $row, 'ar_' );
-                       if ( $attribs['text'] === false ) {
-                               throw new MWException( 'Unable to load text 
from archive row (possibly T24624)' );
-                       }
-               }
                return new self( $attribs );
        }
 
@@ -492,7 +485,6 @@
                        'ar_id',
                        'ar_page_id',
                        'ar_rev_id',
-                       'ar_text',
                        'ar_text_id',
                        'ar_timestamp',
                        'ar_user_text',
@@ -646,7 +638,6 @@
                                'ar_id',
                                'ar_page_id',
                                'ar_rev_id',
-                               'ar_text',
                                'ar_text_id',
                                'ar_timestamp',
                                'ar_user_text',
diff --git a/includes/api/ApiQueryAllDeletedRevisions.php 
b/includes/api/ApiQueryAllDeletedRevisions.php
index 765b5c7..9c5dce6 100644
--- a/includes/api/ApiQueryAllDeletedRevisions.php
+++ b/includes/api/ApiQueryAllDeletedRevisions.php
@@ -138,16 +138,11 @@
                }
 
                if ( $this->fetchContent ) {
-                       // Modern MediaWiki has the content for deleted revs in 
the 'text'
-                       // table using fields old_text and old_flags. But 
revisions deleted
-                       // pre-1.5 store the content in the 'archive' table 
directly using
-                       // fields ar_text and ar_flags, and no corresponding 
'text' row. So
-                       // we have to LEFT JOIN and fetch all four fields.
                        $this->addTables( 'text' );
                        $this->addJoinConds(
                                [ 'text' => [ 'LEFT JOIN', [ 
'ar_text_id=old_id' ] ] ]
                        );
-                       $this->addFields( [ 'ar_text', 'ar_flags', 'old_text', 
'old_flags' ] );
+                       $this->addFields( [ 'old_text', 'old_flags' ] );
 
                        // This also means stricter restrictions
                        $this->checkUserRightsAny( [ 'deletedtext', 'undelete' 
] );
diff --git a/includes/api/ApiQueryDeletedRevisions.php 
b/includes/api/ApiQueryDeletedRevisions.php
index 3339fec..edb3afb 100644
--- a/includes/api/ApiQueryDeletedRevisions.php
+++ b/includes/api/ApiQueryDeletedRevisions.php
@@ -90,16 +90,11 @@
                }
 
                if ( $this->fetchContent ) {
-                       // Modern MediaWiki has the content for deleted revs in 
the 'text'
-                       // table using fields old_text and old_flags. But 
revisions deleted
-                       // pre-1.5 store the content in the 'archive' table 
directly using
-                       // fields ar_text and ar_flags, and no corresponding 
'text' row. So
-                       // we have to LEFT JOIN and fetch all four fields.
                        $this->addTables( 'text' );
                        $this->addJoinConds(
                                [ 'text' => [ 'LEFT JOIN', [ 
'ar_text_id=old_id' ] ] ]
                        );
-                       $this->addFields( [ 'ar_text', 'ar_flags', 'old_text', 
'old_flags' ] );
+                       $this->addFields( [ 'old_text', 'old_flags' ] );
 
                        // This also means stricter restrictions
                        $this->checkUserRightsAny( [ 'deletedtext', 'undelete' 
] );
diff --git a/includes/api/ApiQueryDeletedrevs.php 
b/includes/api/ApiQueryDeletedrevs.php
index 5dd007b..f66bd43 100644
--- a/includes/api/ApiQueryDeletedrevs.php
+++ b/includes/api/ApiQueryDeletedrevs.php
@@ -144,17 +144,11 @@
                }
 
                if ( $fld_content ) {
-                       // Modern MediaWiki has the content for deleted revs in 
the 'text'
-                       // table using fields old_text and old_flags. But 
revisions deleted
-                       // pre-1.5 store the content in the 'archive' table 
directly using
-                       // fields ar_text and ar_flags, and no corresponding 
'text' row. So
-                       // we have to LEFT JOIN and fetch all four fields, plus 
ar_text_id
-                       // to be able to tell the difference.
                        $this->addTables( 'text' );
                        $this->addJoinConds(
                                [ 'text' => [ 'LEFT JOIN', [ 
'ar_text_id=old_id' ] ] ]
                        );
-                       $this->addFields( [ 'ar_text', 'ar_flags', 
'ar_text_id', 'old_text', 'old_flags' ] );
+                       $this->addFields( [ 'ar_text_id', 'old_text', 
'old_flags' ] );
 
                        // This also means stricter restrictions
                        $this->checkUserRightsAny( [ 'deletedtext', 'undelete' 
] );
@@ -365,12 +359,7 @@
                                        $anyHidden = true;
                                }
                                if ( Revision::userCanBitfield( 
$row->ar_deleted, Revision::DELETED_TEXT, $user ) ) {
-                                       if ( isset( $row->ar_text ) && 
!$row->ar_text_id ) {
-                                               // Pre-1.5 ar_text row (if 
condition from Revision::newFromArchiveRow)
-                                               ApiResult::setContentValue( 
$rev, 'text', Revision::getRevisionText( $row, 'ar_' ) );
-                                       } else {
-                                               ApiResult::setContentValue( 
$rev, 'text', Revision::getRevisionText( $row ) );
-                                       }
+                                       ApiResult::setContentValue( $rev, 
'text', Revision::getRevisionText( $row ) );
                                }
                        }
 
diff --git a/includes/installer/DatabaseUpdater.php 
b/includes/installer/DatabaseUpdater.php
index 6639fc8..e89850a 100644
--- a/includes/installer/DatabaseUpdater.php
+++ b/includes/installer/DatabaseUpdater.php
@@ -1235,10 +1235,15 @@
         * @since 1.31
         */
        protected function migrateArchiveText() {
-               $this->output( "Migrating archive ar_text to modern storage.\n" 
);
-               $task = $this->maintenance->runChild( 'MigrateArchiveText', 
'migrateArchiveText.php' );
-               $task->execute();
-               $this->output( "done.\n" );
+               if ( $this->db->fieldExists( 'archive', 'ar_text', __METHOD__ ) 
) {
+                       $this->output( "Migrating archive ar_text to modern 
storage.\n" );
+                       $task = $this->maintenance->runChild( 
'MigrateArchiveText', 'migrateArchiveText.php' );
+                       $task->setForce();
+                       if ( $task->execute() ) {
+                               $this->applyPatch( 'patch-drop-ar_text.sql', 
false,
+                                       'Dropping ar_text and ar_flags columns' 
);
+                       }
+               }
        }
 
 }
diff --git a/includes/page/PageArchive.php b/includes/page/PageArchive.php
index c03d6b2..4dbdadc 100644
--- a/includes/page/PageArchive.php
+++ b/includes/page/PageArchive.php
@@ -327,19 +327,12 @@
        }
 
        /**
-        * Get the text from an archive row containing ar_text, ar_flags and 
ar_text_id
+        * Get the text from an archive row containing ar_text_id
         *
         * @param object $row Database row
         * @return string
         */
        public function getTextFromRow( $row ) {
-               if ( is_null( $row->ar_text_id ) ) {
-                       // An old row from MediaWiki 1.4 or previous.
-                       // Text is embedded in this row in classic compression 
format.
-                       return Revision::getRevisionText( $row, 'ar_' );
-               }
-
-               // New-style: keyed to the text storage backend.
                $dbr = wfGetDB( DB_REPLICA );
                $text = $dbr->selectRow( 'text',
                        [ 'old_text', 'old_flags' ],
@@ -359,15 +352,18 @@
         */
        public function getLastRevisionText() {
                $dbr = wfGetDB( DB_REPLICA );
-               $row = $dbr->selectRow( 'archive',
-                       [ 'ar_text', 'ar_flags', 'ar_text_id' ],
+               $row = $dbr->selectRow(
+                       [ 'archive', 'text' ],
+                       [ 'old_text', 'old_flags' ],
                        [ 'ar_namespace' => $this->title->getNamespace(),
                                'ar_title' => $this->title->getDBkey() ],
                        __METHOD__,
-                       [ 'ORDER BY' => 'ar_timestamp DESC' ] );
+                       [ 'ORDER BY' => 'ar_timestamp DESC' ],
+                       [ 'text' => [ 'JOIN', 'old_id = ar_text_id' ] ]
+               );
 
                if ( $row ) {
-                       return $this->getTextFromRow( $row );
+                       return Revision::getRevisionText( $row );
                }
 
                return null;
@@ -550,12 +546,10 @@
                        'ar_id',
                        'ar_rev_id',
                        'rev_id',
-                       'ar_text',
                        'ar_user',
                        'ar_user_text',
                        'ar_timestamp',
                        'ar_minor_edit',
-                       'ar_flags',
                        'ar_text_id',
                        'ar_deleted',
                        'ar_page_id',
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 8b34928..47d9ce1 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -2887,8 +2887,6 @@
                                'ar_rev_id'     => $row->rev_id,
                                'ar_parent_id'  => $row->rev_parent_id,
                                'ar_text_id'    => $row->rev_text_id,
-                               'ar_text'       => '',
-                               'ar_flags'      => '',
                                'ar_len'        => $row->rev_len,
                                'ar_page_id'    => $id,
                                'ar_deleted'    => $suppress ? $bitfield : 
$row->rev_deleted,
diff --git a/maintenance/archives/patch-drop-ar_text.sql 
b/maintenance/archives/patch-drop-ar_text.sql
new file mode 100644
index 0000000..cfd0a21
--- /dev/null
+++ b/maintenance/archives/patch-drop-ar_text.sql
@@ -0,0 +1,7 @@
+-- T33223: Remove obsolete ar_text and ar_flags columns
+-- (and make ar_text_id not nullable)
+
+ALTER TABLE /*_*/archive
+  DROP COLUMN ar_text,
+  DROP COLUMN ar_flags,
+  CHANGE COLUMN ar_text_id ar_text_id int unsigned NOT NULL;
diff --git a/maintenance/migrateArchiveText.php 
b/maintenance/migrateArchiveText.php
index 96f5dbf..7f10bb9 100644
--- a/maintenance/migrateArchiveText.php
+++ b/maintenance/migrateArchiveText.php
@@ -39,6 +39,14 @@
                );
        }
 
+       /**
+        * Sets whether a run of this maintenance script has the force 
parameter set
+        * @param bool $forced
+        */
+       public function setForce( $forced = true ) {
+               $this->mOptions['force'] = $forced;
+       }
+
        protected function getUpdateKey() {
                return __CLASS__;
        }
@@ -48,9 +56,16 @@
 
                $batchSize = $this->getBatchSize();
 
-               $this->output( "Migrating ar_text to modern storage...\n" );
                $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] );
                $dbw = $this->getDB( DB_MASTER );
+               if ( !$dbr->fieldExists( 'archive', 'ar_text', __METHOD__ ) ||
+                       !$dbw->fieldExists( 'archive', 'ar_text', __METHOD__ )
+               ) {
+                       $this->output( "No ar_text field, so nothing to 
migrate.\n" );
+                       return true;
+               }
+
+               $this->output( "Migrating ar_text to modern storage...\n" );
                $start = 0;
                $count = 0;
                $errors = 0;
diff --git a/maintenance/mssql/archives/patch-drop-ar_text.sql 
b/maintenance/mssql/archives/patch-drop-ar_text.sql
new file mode 100644
index 0000000..088615c
--- /dev/null
+++ b/maintenance/mssql/archives/patch-drop-ar_text.sql
@@ -0,0 +1,21 @@
+DECLARE @sql nvarchar(max),
+       @id sysname;--
+
+SET @sql = 'ALTER TABLE /*_*/archive DROP CONSTRAINT ';--
+
+SELECT @id = df.name
+FROM sys.default_constraints df
+JOIN sys.columns c
+       ON c.object_id = df.parent_object_id
+       AND c.column_id = df.parent_column_id
+WHERE
+       df.parent_object_id = OBJECT_ID('/*_*/archive')
+       AND ( c.name = 'ar_text' OR c.name = 'ar_flags' );--
+
+SET @sql = @sql + @id;--
+
+EXEC sp_executesql @sql;--
+
+ALTER TABLE /*_*/archive DROP COLUMN ar_text;
+ALTER TABLE /*_*/archive DROP COLUMN ar_flags;
+ALTER TABLE /*_*/archive ALTER COLUMN ar_text_id INT NOT NULL;
diff --git a/maintenance/mssql/tables.sql b/maintenance/mssql/tables.sql
index 119cd5b..f65a3ba 100644
--- a/maintenance/mssql/tables.sql
+++ b/maintenance/mssql/tables.sql
@@ -206,15 +206,13 @@
    ar_id int NOT NULL PRIMARY KEY IDENTITY,
    ar_namespace SMALLINT NOT NULL DEFAULT 0,
    ar_title NVARCHAR(255) NOT NULL DEFAULT '',
-   ar_text NVARCHAR(MAX) NOT NULL,
    ar_comment NVARCHAR(255) NOT NULL,
    ar_user INT CONSTRAINT ar_user__user_id__fk FOREIGN KEY REFERENCES 
/*_*/mwuser(user_id),
    ar_user_text NVARCHAR(255) NOT NULL,
    ar_timestamp varchar(14) NOT NULL default '',
    ar_minor_edit BIT NOT NULL DEFAULT 0,
-   ar_flags NVARCHAR(255) NOT NULL,
    ar_rev_id INT NULL, -- NOT a FK, the row gets deleted from revision and 
moved here
-   ar_text_id INT CONSTRAINT ar_text_id__old_id__fk FOREIGN KEY REFERENCES 
/*_*/text(old_id) ON DELETE CASCADE,
+   ar_text_id INT NOT NULL CONSTRAINT ar_text_id__old_id__fk FOREIGN KEY 
REFERENCES /*_*/text(old_id) ON DELETE CASCADE,
    ar_deleted TINYINT NOT NULL DEFAULT 0,
    ar_len INT,
    ar_page_id INT NULL, -- NOT a FK, the row gets deleted from page and moved 
here
diff --git a/maintenance/oracle/archives/patch-drop-ar_text.sql 
b/maintenance/oracle/archives/patch-drop-ar_text.sql
new file mode 100644
index 0000000..249ad53
--- /dev/null
+++ b/maintenance/oracle/archives/patch-drop-ar_text.sql
@@ -0,0 +1,7 @@
+-- T33223: Remove obsolete ar_text and ar_flags columns
+-- (and make ar_text_id not nullable)
+
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.archive DROP (ar_text, ar_flags);
+ALTER TABLE &mw_prefix.archive MODIFY ar_text_id NUMBER NOT NULL;
diff --git a/maintenance/oracle/tables.sql b/maintenance/oracle/tables.sql
index e6e2e56..eee9812 100644
--- a/maintenance/oracle/tables.sql
+++ b/maintenance/oracle/tables.sql
@@ -189,15 +189,13 @@
   ar_id          NUMBER NOT NULL,
   ar_namespace   NUMBER    DEFAULT 0 NOT NULL,
   ar_title       VARCHAR2(255)         NOT NULL,
-  ar_text        CLOB,
   ar_comment     VARCHAR2(255),
   ar_user        NUMBER          DEFAULT 0 NOT NULL,
   ar_user_text   VARCHAR2(255)         NOT NULL,
   ar_timestamp   TIMESTAMP(6) WITH TIME ZONE  NOT NULL,
   ar_minor_edit  CHAR(1)         DEFAULT '0' NOT NULL,
-  ar_flags       VARCHAR2(255),
   ar_rev_id      NUMBER,
-  ar_text_id     NUMBER,
+  ar_text_id     NUMBER NOT NULL,
   ar_deleted     CHAR(1)      DEFAULT '0' NOT NULL,
   ar_len         NUMBER,
   ar_page_id     NUMBER,
diff --git a/maintenance/postgres/archives/patch-drop-ar_text.sql 
b/maintenance/postgres/archives/patch-drop-ar_text.sql
new file mode 100644
index 0000000..d7d69ab
--- /dev/null
+++ b/maintenance/postgres/archives/patch-drop-ar_text.sql
@@ -0,0 +1,7 @@
+-- T33223: Remove obsolete ar_text and ar_flags columns
+-- (and make ar_text_id not nullable)
+
+ALTER TABLE archive
+  DROP COLUMN ar_text,
+  DROP COLUMN ar_flags,
+  ALTER COLUMN ar_text_id SET NOT NULL;
diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql
index d6d2f24..3a9be52 100644
--- a/maintenance/postgres/tables.sql
+++ b/maintenance/postgres/tables.sql
@@ -204,7 +204,6 @@
   ar_id             INTEGER      NOT NULL  PRIMARY KEY DEFAULT 
nextval('archive_ar_id_seq'),
   ar_namespace      SMALLINT     NOT NULL,
   ar_title          TEXT         NOT NULL,
-  ar_text           TEXT, -- technically should be bytea, but not used anymore
   ar_page_id        INTEGER          NULL,
   ar_parent_id      INTEGER          NULL,
   ar_sha1           TEXT         NOT NULL DEFAULT '',
@@ -214,9 +213,8 @@
   ar_user_text      TEXT         NOT NULL,
   ar_timestamp      TIMESTAMPTZ  NOT NULL,
   ar_minor_edit     SMALLINT     NOT NULL  DEFAULT 0,
-  ar_flags          TEXT,
   ar_rev_id         INTEGER,
-  ar_text_id        INTEGER,
+  ar_text_id        INTEGER      NOT NULL,
   ar_deleted        SMALLINT     NOT NULL  DEFAULT 0,
   ar_len            INTEGER          NULL,
   ar_content_model  TEXT,
diff --git a/maintenance/sqlite/archives/patch-drop-ar_text.sql 
b/maintenance/sqlite/archives/patch-drop-ar_text.sql
new file mode 100644
index 0000000..393df45
--- /dev/null
+++ b/maintenance/sqlite/archives/patch-drop-ar_text.sql
@@ -0,0 +1,44 @@
+-- T33223: Remove obsolete ar_text and ar_flags columns
+-- (and make ar_text_id not nullable)
+
+BEGIN;
+
+DROP TABLE IF EXISTS /*_*/archive_tmp;
+CREATE TABLE /*_*/archive_tmp (
+  ar_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  ar_namespace int NOT NULL default 0,
+  ar_title varchar(255) binary NOT NULL default '',
+  ar_comment varbinary(767) NOT NULL default '',
+  ar_comment_id bigint unsigned NOT NULL DEFAULT 0,
+  ar_user int unsigned NOT NULL default 0,
+  ar_user_text varchar(255) binary NOT NULL,
+  ar_timestamp binary(14) NOT NULL default '',
+  ar_minor_edit tinyint NOT NULL default 0,
+  ar_rev_id int unsigned,
+  ar_text_id int unsigned NOT NULL,
+  ar_deleted tinyint unsigned NOT NULL default 0,
+  ar_len int unsigned,
+  ar_page_id int unsigned,
+  ar_parent_id int unsigned default NULL,
+  ar_sha1 varbinary(32) NOT NULL default '',
+  ar_content_model varbinary(32) DEFAULT NULL,
+  ar_content_format varbinary(64) DEFAULT NULL
+) /*$wgDBTableOptions*/;
+
+INSERT OR IGNORE INTO /*_*/archive_tmp (
+               ar_id, ar_namespace, ar_title, ar_comment, ar_user, 
ar_user_text,
+               ar_timestamp, ar_minor_edit, ar_rev_id, ar_text_id, ar_deleted, 
ar_len,
+               ar_page_id, ar_parent_id, ar_sha1, ar_content_model, 
ar_content_format)
+  SELECT
+               ar_id, ar_namespace, ar_title, ar_comment, ar_user, 
ar_user_text,
+               ar_timestamp, ar_minor_edit, ar_rev_id, ar_text_id, ar_deleted, 
ar_len,
+               ar_page_id, ar_parent_id, ar_sha1, ar_content_model, 
ar_content_format
+  FROM /*_*/archive;
+
+DROP TABLE /*_*/archive;
+ALTER TABLE /*_*/archive_tmp RENAME TO /*_*/archive;
+CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive 
(ar_namespace,ar_title,ar_timestamp);
+CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive 
(ar_user_text,ar_timestamp);
+CREATE INDEX /*i*/ar_revid ON /*_*/archive (ar_rev_id);
+
+COMMIT;
diff --git a/maintenance/storage/trackBlobs.php 
b/maintenance/storage/trackBlobs.php
index b4514ec..2475732 100644
--- a/maintenance/storage/trackBlobs.php
+++ b/maintenance/storage/trackBlobs.php
@@ -86,25 +86,6 @@
                        exit( 1 );
                }
 
-               // Scan the archive table for HistoryBlobStub objects or 
external flags (T24624)
-               $flags = $dbr->selectField( 'archive', 'ar_flags',
-                       'ar_flags LIKE \'%external%\' OR (' .
-                       'ar_flags LIKE \'%object%\' ' .
-                       'AND LOWER(CONVERT(LEFT(ar_text,22) USING latin1)) = 
\'o:15:"historyblobstub"\' )',
-                       __METHOD__
-               );
-
-               if ( strpos( $flags, 'external' ) !== false ) {
-                       echo "Integrity check failed: found external storage 
pointers in your archive table.\n" .
-                               "Run normaliseArchiveTable.php to fix this.\n";
-                       exit( 1 );
-               } elseif ( $flags ) {
-                       echo "Integrity check failed: found HistoryBlobStub 
objects in your archive table.\n" .
-                               "These objects are probably already broken, 
continuing would make them\n" .
-                               "unrecoverable. Run \"normaliseArchiveTable.php 
--fix-cgz-bug\" to fix this.\n";
-                       exit( 1 );
-               }
-
                echo "Integrity check OK\n";
        }
 
diff --git a/maintenance/tables.sql b/maintenance/tables.sql
index 1813f6c..8804a12 100644
--- a/maintenance/tables.sql
+++ b/maintenance/tables.sql
@@ -536,14 +536,6 @@
   ar_namespace int NOT NULL default 0,
   ar_title varchar(255) binary NOT NULL default '',
 
-  -- Newly deleted pages will not store text in this table,
-  -- but will reference the separately existing text rows.
-  -- This field is retained for backwards compatibility,
-  -- so old archived pages will remain accessible after
-  -- upgrading from 1.4 to 1.5.
-  -- Text may be gzipped or otherwise funky.
-  ar_text mediumblob NOT NULL,
-
   -- Basic revision stuff...
   ar_comment varbinary(767) NOT NULL default '', -- Deprecated in favor of 
ar_comment_id
   ar_comment_id bigint unsigned NOT NULL DEFAULT 0, -- ("DEFAULT 0" is 
temporary, signaling that ar_comment should be used)
@@ -551,9 +543,6 @@
   ar_user_text varchar(255) binary NOT NULL,
   ar_timestamp binary(14) NOT NULL default '',
   ar_minor_edit tinyint NOT NULL default 0,
-
-  -- See ar_text note.
-  ar_flags tinyblob NOT NULL,
 
   -- When revisions are deleted, their unique rev_id is stored
   -- here so it can be retained after undeletion. This is necessary
@@ -569,11 +558,7 @@
   -- and otherwise making storage changes harder, the actual text is
   -- *not* deleted from the text table, merely hidden by removal of the
   -- page and revision entries.
-  --
-  -- Old entries deleted under 1.2-1.4 will have NULL here, and their
-  -- ar_text and ar_flags fields will be used to create a new text
-  -- row upon undeletion.
-  ar_text_id int unsigned,
+  ar_text_id int unsigned NOT NULL,
 
   -- rev_deleted for archives
   ar_deleted tinyint unsigned NOT NULL default 0,
diff --git a/tests/phpunit/includes/RevisionTest.php 
b/tests/phpunit/includes/RevisionTest.php
index 3d0556e..7ca4b83 100644
--- a/tests/phpunit/includes/RevisionTest.php
+++ b/tests/phpunit/includes/RevisionTest.php
@@ -728,7 +728,6 @@
                                'ar_id',
                                'ar_page_id',
                                'ar_rev_id',
-                               'ar_text',
                                'ar_text_id',
                                'ar_timestamp',
                                'ar_user_text',
@@ -751,7 +750,6 @@
                                'ar_id',
                                'ar_page_id',
                                'ar_rev_id',
-                               'ar_text',
                                'ar_text_id',
                                'ar_timestamp',
                                'ar_user_text',
@@ -837,7 +835,6 @@
                                        'ar_id',
                                        'ar_page_id',
                                        'ar_rev_id',
-                                       'ar_text',
                                        'ar_text_id',
                                        'ar_timestamp',
                                        'ar_user_text',
@@ -865,7 +862,6 @@
                                        'ar_id',
                                        'ar_page_id',
                                        'ar_rev_id',
-                                       'ar_text',
                                        'ar_text_id',
                                        'ar_timestamp',
                                        'ar_user_text',
@@ -898,7 +894,6 @@
                                        'ar_id',
                                        'ar_page_id',
                                        'ar_rev_id',
-                                       'ar_text',
                                        'ar_text_id',
                                        'ar_timestamp',
                                        'ar_user_text',
@@ -934,7 +929,6 @@
                                        'ar_id',
                                        'ar_page_id',
                                        'ar_rev_id',
-                                       'ar_text',
                                        'ar_text_id',
                                        'ar_timestamp',
                                        'ar_user_text',
@@ -970,7 +964,6 @@
                                        'ar_id',
                                        'ar_page_id',
                                        'ar_rev_id',
-                                       'ar_text',
                                        'ar_text_id',
                                        'ar_timestamp',
                                        'ar_user_text',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18f1c740b7537c7dc3cfeba9b241d0a9f31caa34
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

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

Reply via email to