Improved queries.tests.SubqueryTests to cover more potential edge cases used by 3rd party backends