Details
Description
When using an SQLFilter, if applied to a query that contains only OR expressions in the WHERE clause, the generated SQL is incorrect.
Example:
- SQLFilter returns a constraint like "{$tableAlias}.accountid={$accountId}"
- Query: "SELECT u FROM User u WHERE u.fname='bob' OR u.lname='bob'"
Resulting SQL:
"SELECT u FROM User u WHERE u.fname='bob' OR u.lname='bob' AND u.accountid=2"
Expected:
"SELECT u FROM User u WHERE (u.fname='bob' OR u.lname='bob') AND u.accountid=2"
The problem is that the order of operations is wrong. I'm getting users who aren't in account 2, making SQLFilter unreliable.
Activity
Vaughn Clayton
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
When using an SQLFilter, if applied to a query that contains only OR expressions in the WHERE clause, the generated SQL is incorrect.
Example: - SQLFilter returns a constraint like "{$tableAlias}.accountid={$accountId}" - Query: "SELECT u FROM User u WHERE u.fname='bob' OR u.lname='bob'" Resulting SQL: "SELECT u FROM User u WHERE u.fname='bob' OR u.lname='bob' AND u.accountid=2" Expected: "SELECT u FROM User u WHERE (u.fname='bob' OR u.lname='bob') AND u.accountid=2" The problem is that the order of operations is wrong. I'm getting users who aren't in account 2, making SQLFilter unreliable. |
When using an SQLFilter, if applied to a query that contains only OR expressions in the WHERE clause, the generated SQL is incorrect.
Example: * SQLFilter returns a constraint like "{$tableAlias}.accountid={$accountId}" * Query: "SELECT u FROM User u WHERE u.fname='bob' OR u.lname='bob'" Resulting SQL: "SELECT u FROM User u WHERE u.fname='bob' OR u.lname='bob' AND u.accountid=2" Expected: "SELECT u FROM User u WHERE (u.fname='bob' OR u.lname='bob') AND u.accountid=2" The problem is that the order of operations is wrong. I'm getting users who aren't in account 2, making SQLFilter unreliable. |
Fabio B. Silva
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Benjamin Eberlei
made changes -
| Fix Version/s | 2.3.1 [ 10323 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2113, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
Fixed : https://github.com/doctrine/doctrine2/commit/129d6efd8585458fd4bde2a3eb9a5cac374f54fe