Subject | Re: [firebird-support] Problem with 'UNION ALL' |
---|---|
Author | Lester Caine |
Post date | 2009-09-13T10:29:08Z |
Dimitry Sibiryakov wrote:
check I needed.
The SQL *IS* fine. It *IS* the PDO:firebird driver that is at fault!
I'd bypassed the check when the target database was empty, and now that
there is data in there, the SQL is giving the right numbers, so now I
need to find out why 'PDO:fetch' is crashing apache ....
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
>> SELECT 'OBJE' AS type, COUNT(*) AS num FROM pgv_media WHERE m_gedfile=1Actually that was a remnant of another row! But it was just the sanity
>> GROUP BY type
>>
>> I'm only getting 4 results rather than the 5 expected, and strapping a
>> SELECT type, num FROM () around it does not help.
>
> It is simple: your "group by" affects not UNION as whole, but only to
> the last query, causing it to return no rows. Perhaps, there is no
> records with m_gedfile=1 in pgv_media.
check I needed.
The SQL *IS* fine. It *IS* the PDO:firebird driver that is at fault!
I'd bypassed the check when the target database was empty, and now that
there is data in there, the SQL is giving the right numbers, so now I
need to find out why 'PDO:fetch' is crashing apache ....
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php