Ticket #1133 (closed defect: fixed)
Count query with a join condition can put its parameters in the wrong order
| Reported by: | dball | Owned by: | jwage |
|---|---|---|---|
| Priority: | major | Milestone: | 0.11.0 |
| Component: | Attributes | Version: | 0.11.0 |
| Severity: | Keywords: | ||
| Cc: | Has Test: | no | |
| Status: | Pending User Response | Has Patch: | no |
Description
If you create a query with a join with a parameter, and a where clause with a parameter, and issue a count() query on it, the parameters are populated in the wrong order. I don't have time for a proper test case now, but the basic gist is:
$query->from('Foo f')->innerJoin('f.Bar b ON b.id = ?', $bar)->addWhere('f.id = ?', $foo);
$query->count(); // Uses foo for bar and vice versa
$query->execute(); // Uses the parameters in the proper places
Change History
Note: See
TracTickets for help on using
tickets.