Page MenuHomePhabricator

Database error on [[Special:Random/redirect]]
Closed, ResolvedPublic


Author: happy_melon

from within function "RandomPage::selectRandomPageFromDB". MySQL returned error "1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND page_is_redirect = 0 AND page_random >= 0.987298690 (".

This corresponds to lines 94-98 of trunk/phase3/specials/SpecialRandomPage.php; it's probably a result of r45467, applied to fix bug16560.

Interestingly, [[Special:RandomRedirect]] still works.

Version: 1.15.x
Severity: enhancement



Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:34 PM
bzimport set Reference to bz17799.
bzimport added a subscriber: Unknown Object (MLST).

This is a generic issue. Apparently Special:Random dies if you feed it any non-namespace. And afaik, Special:Random/redirect has never been a redirect to Special:RandomRedirect.

Fixed in r48059. Do we want to make Special:Random/redirect go to Special:RandomRedirect? Would seem sensible.

happy_melon wrote:

As best I can tell, RandomRedirect is actually a bizzarre internal redirect to Random/redirect: it's a derived class that essentially just changes the structure of RandomPage just enough to make it always return redirects, which is wierd, to say the least. But in the interests of ease of future modification, it would be nice to have it as a pseudo-separate page; at the very least we shouldn't have two similar-but-subtly-different ways of getting (almost) the same outcome.

It's not a redirect, it's a subclass that specifies that the article chosen must be a redirect. Special:Random/redirect does nothing (now).

happy_melon wrote:

OH, I see the issue, and the source of the original error. It was trying to pick a random page from the Redirect: namespace? Ignore comment #3 then, ravings of a madman :D

In that case, I'd be disinclined to redirect it, it would create a problem for anyone that wanted to *actually have* a Redirect: namespace for whatever reason, and it's unnecessary given that there's a dedicated special page for it.

True about the Redirect: namespace, hadn't considered that. Marking as FIXED, then.

  • Bug 18065 has been marked as a duplicate of this bug. ***