Ticket #496 (closed defect: fixed)
NOT operator doesn't work well in DQL
| Reported by: | jonathan.ding | Owned by: | jepso |
|---|---|---|---|
| Priority: | critical | Milestone: | 2.0.0 (OLD) |
| Component: | Query/Hydration | Version: | 1.0.0 |
| Severity: | Keywords: | ||
| Cc: | Has Test: | ||
| Status: | Has Patch: |
Description
Considering below DQL:
<?php $q1->parseQuery('SELECT c.id FROM Content c WHERE NOT (c.id=3)'); $q2->parseQuery('SELECT c.id FROM Content c WHERE NOT c.id=3'); echo $q1->getSql(); echo $q2->getSql();
The first one returns wrong Sql
SELECT c.id AS c__id FROM content c
And the second one raised exception.
Looks like the 'NOT' is not well parsed. Or my usage is wrong? Oringinally I'm have a complicated DQL like
SELECT ... FROM ... WHERE condition1 AND NOT condition2 AND condition3 OR NOT condition4 ...
Change History
Note: See
TracTickets for help on using
tickets.