Add support for empty query in joins.