WikiPageEntityMetaDataLookup::getWhere has a special guard against an empty condition list for the query:
if ( empty( $where ) ) { // If we skipped all entity IDs, select nothing, not everything. return '0'; }
However, Database::selectSQLText actually interprets that '0' as “no conditions” (same as []), which results in a query without WHERE clause. Make sure we return something better. ([ false ]?)
Part of https://wikitech.wikimedia.org/wiki/Incident_documentation/20180226-WikibaseQualityConstraints.