Page MenuHomePhabricator

Namespace parameters search break execution in SQL error
Closed, ResolvedPublic

Description

See the following:

http://translatewiki.net/w/i.php?title=Special%3ASearch&redirs=0&search=Foobar&ns8=1

On translatewiki (running trunk) a plain search in the searchbar works (in most cases) but going to 'page 2' and/or changing the namespaces being search through breaks:

Database error

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

(SQL query hidden)

from within function "". Database 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_namespace IN ('8') LIMIT 20' at line 1 (localhost)".


Version: 1.18.x
Severity: critical
URL: http://translatewiki.net/w/i.php?title=Special%3ASearch&redirs=0&search=Foobar&ns8=1

Details

Reference
bz26940

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:23 PM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz26940.
bzimport added a subscriber: Unknown Object (MLST).

SELECT page_id, page_namespace, page_title FROM page,searchindex WHERE page_id=si_page AND MATCH(si_title) AGAINST('+foobar ' IN BOOLEAN MODE) AND AND page_namespace IN ('8') LIMIT 20

It's the double "AND AND".

Regression caused by r80856; fixed in r80982