wrong statement generation for exists subquery when the from clause is empty

Issue #491 resolved
Former user created an issue

I have attached the test script that reproduces the problem.

Please note that I'm not sure if the problem is caused by a wrong usage of SQLAlchemy.

The generated query is:

SELECT EXISTS (SELECT test.id AS id FROM test WHERE test.x = ? AND test.y = ?) FROM (SELECT test.id AS id FROM test WHERE test.x = ? AND test.y = ?)

Note that this query works with SQLite, but PostgreSQL throws an error.

Thanks for your work!

Comments (1)

  1. Log in to comment