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

Mike Matrigali updated DERBY-4331:
----------------------------------


If anyone has time, what would be useful is the smallest test case possible 
with a set of optimizer hints that forces the bad result.  This will help in 
understanding exactly what is going on. 

If I remember correctly, DERBY-3926 basically eliminated sort avoidance plans 
when marching through
the all the plans.  It turned out that some of the plans it eliminated actually 
did return the correct order but
just through luck.  So the question with this bug, which is obviously affected 
by DERBY-3926 is did 
DERBY-3926 just happen to eliinate some "lucky" plans, and push it to an 
existing bug or did it somehow
now mark a plan we previously skipped as valid.  If the repro had a fixed join 
plan that showed bad sort
now and good sort before we could more easily tell what the regression is.  

> Join returns results in wrong order
> -----------------------------------
>
>                 Key: DERBY-4331
>                 URL: https://issues.apache.org/jira/browse/DERBY-4331
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.3.3, 10.2.2.1, 10.3.3.1, 10.4.2.1, 10.5.2.0, 
> 10.6.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: repro.sql
>
>
> In Derby 10.5.2.0, the query below started returning results in wrong order 
> (note the ORDER BY clause). Derby 10.5.1.1 gives the expected ordering.
> ij> SELECT CS.ID
> FROM
>     CHANGESETS CS, FILECHANGES FC, REPOSITORIES R, FILES F, AUTHORS A
> WHERE
>     R.PATH = '/var/tmp/source5923202038296723704opengrok/mercurial' AND 
> F.REPOSITORY = R.ID AND A.REPOSITORY = R.ID AND
>     CS.REPOSITORY = R.ID AND CS.ID = FC.CHANGESET AND F.ID = FC.FILE AND
>     A.ID = CS.AUTHOR AND
>     EXISTS (
>         SELECT 1
>         FROM FILES F2
>         WHERE
>             F2.ID = FC.FILE AND F2.REPOSITORY = R.ID AND
>             F2.PATH LIKE '/%' ESCAPE '#')
> ORDER BY CS.ID DESC;
> ID         
> -----------
> 1          
> 2          
> 3          
> 2          
> 2          
> 3          
> 6 rows selected

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to