From: Eddie Greiner-Petter Date: Sat, 22 Apr 2017 19:23:11 +0000 (+0200) Subject: Revert, Follow-up: -1 recent contributors X-Git-Tag: 1.31.0-rc.0~3417^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=b140b73b54785966138c6296057c02046f72786f Revert, Follow-up: -1 recent contributors 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 --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 0a2b8084e2..12e8dd1c10 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -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' diff --git a/maintenance/mssql/tables.sql b/maintenance/mssql/tables.sql index 41a2ef9dce..3babb393fb 100644 --- a/maintenance/mssql/tables.sql +++ b/maintenance/mssql/tables.sql @@ -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 diff --git a/maintenance/oracle/tables.sql b/maintenance/oracle/tables.sql index fefc31c5a2..fc3c696a6c 100644 --- a/maintenance/oracle/tables.sql +++ b/maintenance/oracle/tables.sql @@ -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); diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index 9ded0794f4..e19c447a65 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -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 ); diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 38fef45f1b..8f596904ad 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -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 diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php index 6d960e1707..b90b1ad312 100644 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/includes/db/DatabaseSqliteTest.php @@ -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:' );