The query plan of queries with subqueries that contain nested joins was wrong. This could result in syntax exceptions for correct queries.