[pkg-firebird-general] select distinct and left join bug in 1.5.3.4870 deb

Damyan Ivanov divanov at creditreform.bg
Wed Mar 15 07:28:51 UTC 2006


Hi, Normunds,

Normunds wrote:
> I put yesterday latest Firebird SuperServer 1.5.3.4870 deb package

>From where? It is not in the archive yet.

> on my Debian server and got some bugs.
> 
> select distinct c.cust_no, c.customer
> from customer c
> left join sales s on s.cust_no = c.cust_no
> order by c.customer
> 
> query is not sorting by customer column in employee.fdb database.

Same here. Good catch!

$ isql-fb localhost:employee.fdb
Database:  localhost:employee.fdb
SQL> set plan;
SQL> select distinct c.cust_no, c.customer
CON> from customer c
CON> left join sales s on s.cust_no = c.cust_no
CON> order by c.customer;

PLAN SORT (JOIN (C ORDER CUSTNAMEX,S INDEX (RDB$FOREIGN25)))

     CUST_NO CUSTOMER
============ =========================

        1001 Signature Design
        1002 Dallas Technologies
        1003 Buttle, Griffith and Co.
        1004 Central Bank
        1005 DT Systems, LTD.
        1006 DataServe International
        1007 Mrs. Beauvais
        1008 Anini Vacation Rentals
        1009 Max
        1010 MPM Corporation
        1011 Dynamic Intelligence Corp
        1012 3D-Pad Corp.
        1013 Lorenzi Export, Ltd.
        1014 Dyno Consulting
        1015 GeoTech Inc.

Changing the query to

select distinct c.customer, c.cust_no
...
makes it sort rightly.

There is a patch that fiddles with redundant sorts. I'try to remove it and see
if it makes any difference.


Thanks for reporting.
-- 
Damyan Ivanov                              Creditreform Bulgaria
divanov at creditreform.bg              http://www.creditreform.bg/
phone: +359(2)928-2611, 929-3993            fax: +359(2)920-0994
mob. +359(88)856-6067               dam at jabber.minus273.org/Gaim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-firebird-general/attachments/20060315/0a9d3bfc/signature.pgp


More information about the pkg-firebird-general mailing list