Revert, Follow-up: -1 recent contributors
authorEddie Greiner-Petter <git@eddie-sh.de>
Sat, 22 Apr 2017 19:23:11 +0000 (21:23 +0200)
committerKrinkle <krinklemail@gmail.com>
Thu, 27 Apr 2017 01:51:21 +0000 (01:51 +0000)
This reverts commit b67f40e5b01af569794eba26da79497329590d36.

There was an issue that the web installer, when inserting initial
values into the db table site_stats, would not insert any value for
ss_active_users. That lead to some places, most notably
Special:CreateAccount, to show off -1 recent contributors.

The commit to revert solved this by setting a default value of 1 for
the ss_active_users field in the database schema. However, while the
default schema has been changed, there hasn't been any schema update
procedure implemented. Also, the default of 1 is inconsistent with
other defaults in that table.

Revert that schema change completely. Instead, make the web installer
insert 0 to the field ss_active_users (just like it does with all other
fields in that table).

Bug: T56888
Change-Id: I4298754c2238f6e5447a5df77a4ada722ba302b2

includes/installer/Installer.php
maintenance/mssql/tables.sql
maintenance/oracle/tables.sql
maintenance/postgres/tables.sql
maintenance/tables.sql
tests/phpunit/includes/db/DatabaseSqliteTest.php

index 0a2b808..12e8dd1 100644 (file)
@@ -724,6 +724,7 @@ abstract class Installer {
                                'ss_good_articles' => 0,
                                'ss_total_pages' => 0,
                                'ss_users' => 0,
+                               'ss_active_users' => 0,
                                'ss_images' => 0
                        ],
                        __METHOD__, 'IGNORE'
index 41a2ef9..3babb39 100644 (file)
@@ -469,7 +469,7 @@ CREATE TABLE /*_*/site_stats (
   ss_users bigint default '-1',
 
   -- Number of users that still edit
-  ss_active_users bigint default '1',
+  ss_active_users bigint default '-1',
 
   -- Number of images, equivalent to SELECT COUNT(*) FROM image
   ss_images int default 0
index fefc31c..fc3c696 100644 (file)
@@ -255,7 +255,7 @@ CREATE TABLE &mw_prefix.site_stats (
   ss_good_articles  NUMBER            DEFAULT 0,
   ss_total_pages    NUMBER            DEFAULT -1,
   ss_users          NUMBER            DEFAULT -1,
-  ss_active_users   NUMBER            DEFAULT 1,
+  ss_active_users   NUMBER            DEFAULT -1,
   ss_images         NUMBER            DEFAULT 0
 );
 CREATE UNIQUE INDEX &mw_prefix.site_stats_u01 ON &mw_prefix.site_stats (ss_row_id);
index 9ded079..e19c447 100644 (file)
@@ -283,7 +283,7 @@ CREATE TABLE site_stats (
   ss_good_articles  INTEGER            DEFAULT 0,
   ss_total_pages    INTEGER            DEFAULT -1,
   ss_users          INTEGER            DEFAULT -1,
-  ss_active_users   INTEGER            DEFAULT 1,
+  ss_active_users   INTEGER            DEFAULT -1,
   ss_admins         INTEGER            DEFAULT -1,
   ss_images         INTEGER            DEFAULT 0
 );
index 38fef45..8f59690 100644 (file)
@@ -758,7 +758,7 @@ CREATE TABLE /*_*/site_stats (
   ss_users bigint default '-1',
 
   -- Number of users that still edit
-  ss_active_users bigint default '1',
+  ss_active_users bigint default '-1',
 
   -- Number of images, equivalent to SELECT COUNT(*) FROM image
   ss_images int default 0
index 6d960e1..b90b1ad 100644 (file)
@@ -311,7 +311,6 @@ class DatabaseSqliteTest extends MediaWikiTestCase {
                // Mismatches for these columns we can safely ignore
                $ignoredColumns = [
                        'user_newtalk.user_last_timestamp', // r84185
-                       'site_stats.ss_active_users', // T56888
                ];
 
                $currentDB = DatabaseSqlite::newStandaloneInstance( ':memory:' );