Re: Maximum results to return from query



On Mon, Dec 05, 2005 at 07:25:49AM -0700, Elijah Newren wrote:
> Sounds like it'd also be a good idea, but I really do think we should
> also special case an empty query and make it return
> nothing--especially since we have caused it so many times ourselves.

I was able to implement this. buglist.cgi uses Bugzilla/Search.pm to
generate the SQL (but not execute). This SQL will have a '1 = 1' in the
WHERE part. This '1 = 1' could still be there if the query somehow was
using HAVING instead, so the if-statement currently reads:
 if ($query =~ / 1 = 1/ && $query !~ /HAVING/) {

The WHERE can have some stuff to show restricted bugs, so above was the
best option I could think of... somewhat hackish, but oh well :-)

-- 
Regards,
Olav



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]