Ticket #1480 (closed defect: fixed)
SubQuery and SoftDelete doesn't work well together
| Reported by: | enrico | Owned by: | romanb |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.0.3 |
| Component: | Listeners | Version: | 1.0.2 |
| Severity: | Keywords: | ||
| Cc: | Has Test: | no | |
| Status: | Pending Core Response | Has Patch: | no |
Description
Hi,
I've a problem with two models, a subquery and the SoftDelete?-Listener. The SoftDelete?-Listener is attached to model Foo. The query looks like
Doctrine_Query::create()
->from('Foo f')
->addWhere('f.id NOT IN (SELECT b.foo_id FROM Bar b)')
->execute();
This will result in query:
SELECT "f"."id", "f"."col2" FROM "foo" "f" WHERE "f"."id" IN (SELECT "b"."foo_id" FROM "bar" "b" WHERE "s"."deleted" = ?) AND "s"."deleted" = ?
The SoftDelete? column was added twice and result in the following error:
Doctrine_Connection_Pgsql_Exception: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in /<path>/doctrine/lib/Doctrine/Connection.php on line 1074
Attachments
Change History
Note: See
TracTickets for help on using
tickets.