Ticket #788 (closed defect: fixed)
Quick fix for count()/select and ENUM for 0.9
| Reported by: | Nail | Owned by: | zYne- |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.0.0 (OLD) |
| Component: | Query/Hydration | Version: | 0.9.0 |
| Severity: | Keywords: | enum | |
| Cc: | Has Test: | ||
| Status: | Has Patch: |
Description
My problem was that enum parameter structure was messed after count() call.
Example:
$q->from('Company c')->where('c.company_type=?', 'BANK'); // ENUM parameter
$q->count();
$q->where('c.id=?','c3_'); // Integer parameter
$result = $q->execute(); // wrong result here
The solution is to replace in Doctrine_Query::getQuery()
// reset the state
if ( ! $this->isSubquery()) {
$this->_aliasMap = array();
$this->pendingAggregates = array();
$this->aggregateMap = array();
}
with
// reset the state
if ( ! $this->isSubquery()) {
$this->_aliasMap = array();
$this->pendingAggregates = array();
$this->aggregateMap = array();
$this->_enumParams = array(); // the solution
}
Attachments
Change History
Note: See
TracTickets for help on using
tickets.