Last modified: 2011-03-14 13:49:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14127, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12127 - Addition of "LIKE" parameter to doQuery()
Addition of "LIKE" parameter to doQuery()
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
Blocks: 6
  Show dependency treegraph
 
Reported: 2007-11-26 23:34 UTC by Chad H.
Modified: 2011-03-14 13:49 UTC (History)
3 users (show)

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


Attachments
Patch to implement LIKE into doQuery() (1.12 KB, patch)
2007-11-27 00:24 UTC, Chad H.
Details

Description Chad H. 2007-11-26 23:34:07 UTC
With the addition of a LIKE parameter to doQUERY(), we would be able to do filtering based on name matches, which is a common request for special pages (bug 6 comes to mind).
Comment 1 Chad H. 2007-11-27 00:24:10 UTC
Created attachment 4384 [details]
Patch to implement LIKE into doQuery()

This may or may not work, I'm not entirely sure. I'd really like input on the feasibility of this idea, as I think it could greatly enhance our various querypages.
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-12-18 18:11:14 UTC
1) This breaks all existing uses of doQuery that specified $shownavigation.  You need to add the new parameter to the end, or make a new method.

2) You only support LIKE '%foo%'; is that desirable?  Would 'foo%' and '%foo' be useful in some cases?  Or maybe '%foo%bar', etc.?

3) What effect would using this have on performance?
Comment 3 Chad H. 2007-12-18 18:22:55 UTC
1) Oops, wasn't paying attention.

2) I'm not sure how you would implement that, interface-side. Would you have to give options, such as "begins with/ends with?" Give them ability to put %'s in themselves (very dangerous!), or what? I'm open to ideas, as I hadn't considered that previously. I figured %like% to be a "contains," I suppose.

3) A lot, potentially. How does Prefixindex deal with the LIKE?
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-12-18 21:23:03 UTC
(In reply to comment #3)
> 2) I'm not sure how you would implement that, interface-side. Would you have to
> give options, such as "begins with/ends with?" Give them ability to put %'s in
> themselves (very dangerous!), or what? I'm open to ideas, as I hadn't
> considered that previously. I figured %like% to be a "contains," I suppose.

I was imagining the caller wouldn't be passing input straight from a form, it would be taking form input and calling based on that.  Is this incorrect?  I never looked at QueryPage.php, to be honest.

> 3) A lot, potentially. How does Prefixindex deal with the LIKE?

LIKEs where the only wildcard is at the very end of the string (e.g., LIKE 'Foo%') can use an index on the column you're LIKEing.  LIKE '%foo%' cannot use an index to retrieve the desired rows, in MySQL -- it has to scan the contents of all rows that otherwise match.  I don't know much about the querycache table is used, either, so I don't know whether this is a problem in the specific case.  Maybe I'm not the best person to comment on this bug.  :)
Comment 5 Dan Jacobson 2008-05-20 03:37:58 UTC
All I know is I need Special:PrefixIndex/* or some way to match everything

Special:Allpages with no arguments gets everything.
Special:PrefixIndex with no arguments gets nothing.

Special:Allpages is great, so I link it from the Main Page on
http://radioscanningtw.jidanni.org/), but when the user attempts to
narrow his view, there is no lower bound. That's why
Special:PrefixIndex was invented, apparently.

So I want to link Special:PrefixIndex from my Main Page instead, but
then the user will start out seeing no pages at all and think my site
is empty.

Special:PrefixIndex/* of course gets nothing.
Comment 6 Chad H. 2009-07-14 22:55:03 UTC
WONTFIX. Crap bug I filed long before I knew what I was talking about. Adding LIKE to doQuery() is stupid.

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


Navigation
Links