Last modified: 2010-05-15 14:35:47 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 3946 - page_random is 0 for many pages, excluding them from "random page" requests
page_random is 0 for many pages, excluding them from "random page" requests
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.6.x
All All
: High normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-13 01:45 UTC by Daniel Kinzler
Modified: 2010-05-15 14:35 UTC (History)
0 users

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


Attachments

Description Daniel Kinzler 2005-11-13 01:45:16 UTC
Playing with the dumps on zedler, I just found out that a lot of pages have a
page_random value of 0, which causes them to never show up as a "random page".
This seems to be the case mainly for image description pages (namespace 6).

This not only causes the the "random page" and "random image" features to behave
incorrectly, it also effects tools that rely on a random selection of pages.
Please have a look at what is causing this.

Below are some of the results I found when playing with this:


mysql> use commonswiki;
mysql> select count(*) from page where page_random = 0;
+----------+
|    55832 |
+----------+
mysql> select count(*) from page where page_random = 0 and page_namespace = 6;
+----------+
|    54409 |
+----------+
mysql> use enwiki;
mysql> select count(*) from page where page_random = 0;
+----------+
|    62879 |
+----------+
mysql> select count(*) from page where page_random = 0 and page_namespace = 6;
+----------+
|    56830 |
+----------+

(I appologize in advance for broken formating - MediaZill needs a preview button...)
Comment 1 Tim Starling 2005-11-13 02:49:40 UTC
This is a conversion issue -- since Special:Randompage previously only applied to non-
redirects in namespace 0, code which inserted image description pages and redirects 
tended to miss setting cur_random. Because of the consolidation of article insert code 
in 1.5, this is now resolved for new pages. However there will still be many pages left 
with page_random=0, as Daniel points out.

I've fixed this in Wikimedia databases, but it might be nice to have a query like

UPDATE page SET page_random=RAND() WHERE page_random=0

in future installers.
Comment 2 Rob Church 2005-11-14 09:59:15 UTC
Bear with me if I'm missing the trick or the point, but wouldn't you want that
to be UPDATE page SET page_random=RAND() WHERE page_random=0,
page_is_redirect=0; in order to exclude redirects?
Comment 3 Ævar Arnfjörð Bjarmason 2005-11-14 16:01:33 UTC
(In reply to comment #2)
> to be UPDATE page SET page_random=RAND() WHERE page_random=0,
> page_is_redirect=0; in order to exclude redirects?

First, that's invalid SQL, second page_random should be a nonzero value for
every row, including for rows where page_is_redirect = 0.
Comment 4 Rob Church 2005-11-15 15:59:34 UTC
Sorry; I wasn't thinking. Yes, it's invalid SQL and yes I made the glaring
balls-up of specifying WHERE page_is_redirect = 0, when in fact my comment on it
made it clear I meant the other way round.
Comment 5 Ævar Arnfjörð Bjarmason 2005-12-08 11:28:19 UTC
Added a database update for this bug to HEAD, marking this as FIXED in CVS HEAD

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


Navigation
Links