db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-5933) SQL sorting error
Date Sat, 22 Sep 2012 14:37:07 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-5933:
--------------------------------------

    Attachment: repro.sql

Attaching repro.sql, which is a standalone, stripped-down repro for the bug. Here is what
I see when I run the script on trunk:

ij version 10.10
ij> connect 'jdbc:derby:memory:d5933;create=true';
ij> create table a (a1 int, a2 int, a3 int, a4 int);
0 rows inserted/updated/deleted
ij> create table b (b1 int);
0 rows inserted/updated/deleted
ij> create table c (c1 int);
0 rows inserted/updated/deleted
ij> create table d (d1 int);
0 rows inserted/updated/deleted
ij> insert into a values (1,2,1,2), (2,3,1,3), (1,4,1,4);
3 rows inserted/updated/deleted
ij> insert into b values 1;
1 row inserted/updated/deleted
ij> insert into d values 2,3,4;
3 rows inserted/updated/deleted
ij> select a1
from
    a inner join b on a3 = b1
      left outer join c on a4 = c1
      inner join d on a2 = d1
where b1 = 1
order by a1;
A1         
-----------
1          
2          
1          

3 rows selected

The results come out unordered, even though there is an ORDER BY clause. The bug seems to
go all the way back to 10.0.
                
> SQL sorting error
> -----------------
>
>                 Key: DERBY-5933
>                 URL: https://issues.apache.org/jira/browse/DERBY-5933
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.9.1.0
>         Environment: Windows 7 Netbeans JDBC GUI
>            Reporter: Vlasov Igor
>         Attachments: Helpdesk.zip, repro.sql, right_sorting.png, wrong_sorting.png
>
>
> Hello 
> I have a simple database with 100 records.
> I am running a SQL query from Netbeans GUI though JDBC
> This query was generated by Hibernate ORM.
> In certain circumstances the result rowset is not sorting.
> When I use  condition morefld2_.mf_id in (5) the result is unsortable.
> When I use  condition morefld2_.mf_id in (5,0) the result is sorting properly.
>     
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message