Last modified: 2010-05-15 15:48:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 9421 - Division by zero in SpecialStatistics.php
Division by zero in SpecialStatistics.php
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.9.x
PC Linux
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-26 18:23 UTC by Dan Jacobson
Modified: 2010-05-15 15:48 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Jacobson 2007-03-26 18:23:22 UTC
$ w3m -dump \
http://radioscanningtw.jidanni.org/index.php?title=Special:Statistics |
head -3

Warning: Division by zero in ...SpecialStatistics.php on line 53
Comment 1 Rob Church 2007-03-26 23:15:44 UTC
Please state the value of site_stats.ss_users; I'm guessing it will be zero.
This sounds like another "messed up statistics table" bug.
Comment 2 Dan Jacobson 2007-03-29 23:23:07 UTC
Must be 0 I suppose too. Maybe I will check it when I supposedly get ADSL.

Moral of story: always check for 0 before dividing external items anyway!
Comment 3 Dan Jacobson 2007-04-07 04:31:36 UTC
Well, it turns out there is nothing there:
-- Dumping data for table `wiki_site_stats`
/*!40000 ALTER TABLE `wiki_site_stats` DISABLE KEYS */;
LOCK TABLES `wiki_site_stats` WRITE;
UNLOCK TABLES;
/*!40000 ALTER TABLE `wiki_site_stats` ENABLE KEYS */;

So at least be prepared for that possibility when writing the code.
Hmmm, how shall I medicate that condition best?

By the way, here are some other wiki observations that I hope your
code is prepared for: ss_admins: -1 ss_images: 0 ss_good_articles:
18446744073709551615
Comment 4 Rob Church 2007-04-07 04:38:57 UTC
You can run maintenance/initStats.php to initialise the site_stats table, or
indeed, reset the whole thing if it turns bad.

Checking for a missing or invalid site_stats row appears to have been added in
trunk...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links