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 ] |