Page MenuHomePhabricator

Special:IndexPages search doesn't work with sqlite DBs
Closed, ResolvedPublicBUG REPORT


List of steps to reproduce (step by step, including full links if applicable):

  • Use an SqLite DB (eg. with default docker)
  • Go to Special:IndexPages and search for anything

What happens?:

2021-07-06_101658_1293x823_screenshot.png (823×1 px, 277 KB)

What should have happened instead?:

Search results, or "no results found".

I think this is because "false" here:

	public function getQueryInfo() {
		$conds = [];
		if ( $this->searchTerm ) {
			if ( $this->searchList !== null ) {
				$conds = [ 'page_namespace' => Context::getDefaultContext()->getIndexNamespaceId() ];
				if ( $this->searchList ) {
					$conds['page_title'] = $this->searchList;
				} else {
					// If not pages were found do not return results
					$conds[] = 'false';
			} else {
				$conds = null;

Changing to $conds[] = '0'; works.

Event Timeline

matej_suchanek added a subscriber: matej_suchanek.

Usually 1=0 is used in MediaWiki code base.

Change 703468 had a related patch set uploaded (by Inductiveload; author: Inductiveload):

[mediawiki/extensions/ProofreadPage@master] Fix Special:IndexPages search on SQLite DBs

Change 703468 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@master] Fix Special:IndexPages search on SQLite DBs

Inductiveload claimed this task.