Fix intersect(union, ...) bug in SQL translation