Page MenuHomePhabricator

Searches with hyphens yield a database query error
Open, Needs TriagePublic

Description

MediaWiki 1.32.0
PHP 7.2.15-0ubuntu0.18.04.2 (apache2handler)
MariaDB 10.1.34-MariaDB

A database query error has occurred. This may indicate a bug in the software.


[42cc5c670a243b95937180db] /w/index.php?title=Special%3ASearch&search=Binding+Coil+of+Bahamut+-+Turn+2&go=Go Wikimedia\Rdbms\DBQueryError from line 1496 of /var/www/<domain>/htdocs/w/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
 Query: SELECT page_id,page_namespace,page_title FROM `ffxiv_mw_page`,`ffxiv_mw_searchindex` WHERE (page_id=si_page) AND ( MATCH(si_title) AGAINST('+binding +coil +ofu800 +bahamut +- +turn +2u800 ' IN BOOLEAN MODE) ) AND page_namespace IN ('0','200','800') ORDER BY MATCH(si_title) AGAINST('+binding +coil +ofu800 +bahamut +- +turn +2u800 ' IN NATURAL LANGUAGE MODE) DESC LIMIT 21 
 Function: SearchMySQL::searchInternal
 Error: 1064 syntax error, unexpected '-' (<endpoint>.rds.amazonaws.com)


Backtrace:

#0 /var/www/<domain>/htdocs/w/includes/libs/rdbms/database/Database.php(1466): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
 #1 /var/www/<domain>/htdocs/w/includes/libs/rdbms/database/Database.php(1226): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
 #2 /var/www/<domain>/htdocs/w/includes/libs/rdbms/database/Database.php(1693): Wikimedia\Rdbms\Database->query(string, string)
 #3 /var/www/<domain>/htdocs/w/includes/search/SearchMySQL.php(191): Wikimedia\Rdbms\Database->select(array, array, array, string, array, array)
 #4 /var/www/<domain>/htdocs/w/includes/search/SearchMySQL.php(178): SearchMySQL->searchInternal(string, boolean)
 #5 /var/www/<domain>/htdocs/w/includes/search/SearchDatabase.php(69): SearchMySQL->doSearchTitleInDB(string)
 #6 /var/www/<domain>/htdocs/w/includes/search/SearchEngine.php(140): SearchDatabase->doSearchTitle(string)
 #7 /var/www/<domain>/htdocs/w/includes/search/SearchEngine.php(169): SearchEngine->{closure}()
 #8 /var/www/<domain>/htdocs/w/includes/search/SearchEngine.php(141): SearchEngine->maybePaginate(Closure)
 #9 /var/www/<domain>/htdocs/w/includes/specials/SpecialSearch.php(341): SearchEngine->searchTitle(string)
 #10 /var/www/<domain>/htdocs/w/includes/specials/SpecialSearch.php(190): SpecialSearch->showResults(string)
 #11 /var/www/<domain>/htdocs/w/includes/specialpage/SpecialPage.php(569): SpecialSearch->execute(NULL)
 #12 /var/www/<domain>/htdocs/w/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
 #13 /var/www/<domain>/htdocs/w/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
 #14 /var/www/<domain>/htdocs/w/includes/MediaWiki.php(860): MediaWiki->performRequest()
 #15 /var/www/<domain>/htdocs/w/includes/MediaWiki.php(517): MediaWiki->main()
 #16 /var/www/<domain>/htdocs/w/index.php(42): MediaWiki->run()
 #17 {main}

Event Timeline

charitwo created this task.Apr 22 2019, 8:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 22 2019, 8:07 PM
Restricted Application added a project: Discovery-Search. · View Herald TranscriptApr 22 2019, 8:10 PM
Reedy added a subscriber: Reedy.Apr 22 2019, 8:36 PM

Needs extra quoting...

debt added a subscriber: debt.

This is related to Mediawiki core...and not our production search.

I found a task that was created after this incident as an exact duplicate and merged it. As mentioned in the original post it was discovered on 1.32.0 (production) and is still present as of 1.33.0-rc.0 on a development install. I will be upgrading production to 1.33.0 soon but given the change log since rc.0 I do not anticipate any improvement.

whoops. don't know how that happened