Fixes #2848: Individual queries should be enclosed within parenthesis in a UNION query