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] [Commented] (DERBY-5933) SQL sorting error
Date Tue, 25 Sep 2012 19:32:07 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463139#comment-13463139

Knut Anders Hatlen commented on DERBY-5933:

The remap+test patch looks good to me. Thanks for explaining the cause of the bug so clearly
in the test comment. +1 to commit.

As to pushing the logic down, I agree that that would be cleaner. However, it looks like there
are parts of the code that expect the current behaviour of ResultColumn.getColumnPosition().
At least, I ran into trouble with some other statements when I attempted to push down the
logic without the extra check for JoinNode that Dag put in the poc patch (I suspect that the
JoinNode check was what made Dag call that patch a hack in the first place). So in that case
I think we should create a new method rather than changing the existing one. And try to explain
clearly when to use which method to retrieve the column number/position.

My main problem with this code is that I don't fully understand the invariants. My first thought
was that (columnDescriptor == null) == (expression instanceof VirtualColumnNode) was one,
but apparently not. And that makes it more difficult to understand when to use virtualColumnId
and when to use columnDescriptor.
> SQL sorting error
> -----------------
>                 Key: DERBY-5933
>                 URL: https://issues.apache.org/jira/browse/DERBY-5933
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:,,,,,,,,,
>         Environment: Windows 7 Netbeans JDBC GUI
>            Reporter: Vlasov Igor
>              Labels: derby_triage10_10
>         Attachments: 5933.log, d5933-pof.diff, d5933-remap.diff, d5933-remap+test.diff,
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

View raw message