Database::selectSQLText interprets $conds = '0' as “no conditions”, i. e. a query without WHERE clause, due to its use of the PHP empty function. I assume this is mainly meant to match [], so perhaps a check against that (=== []) would be better and other cases should throw exceptions instead.
Part of https://wikitech.wikimedia.org/wiki/Incident_documentation/20180226-WikibaseQualityConstraints.