db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2526) Wrong query results due to column ordering in UNION view
Date Fri, 06 Apr 2007 16:27:32 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487267

Bryan Pendleton commented on DERBY-2526:

The query that finds 1 row prints:
Modifying access paths to use join order: 2,1,0, with cost Level2CostEstimateImpl: at 602878,
cost == 216.069408, rowCount == 0.25920000000000015, singleScanRowCount == 0.6000000000000001

The query that finds 0 rows prints:
Modifying access paths to use join order: 2,0,1, with cost Level2CostEstimateImpl: at 17715159,
cost == 186.67111680000002, rowCount == 0.1555200000000001, singleScanRowCount == 1.2000000000000002

I believe that optimizable 2 is table b4, optimizable 1 is the UNION view, and optimizable
0 is table b3, so these results match the other info I was seeing in the query plan dumps.

Time to fire up the debugger...

> Wrong query results due to column ordering in UNION view
> --------------------------------------------------------
>                 Key: DERBY-2526
>                 URL: https://issues.apache.org/jira/browse/DERBY-2526
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:,,,
>            Reporter: Bryan Pendleton
>         Attachments: badQuery.log, derby-2526.sql, goodQuery.log
> I think both select statements in the attached repro script should return 1 row, but
in fact the first statement returns 1 row and the second returns zero rows.
> The only difference between the two statements is that the columns in the UNION view
are listed in a different order (bvw vs. bvw2).
> This seems like a bug to me; the order of the columns in the view definition shouldn't
matter, should it? 
> As Army noted on the derby-dev list, the fact that this reproduces with 10.0 means that
it is not caused by some of the 10.2 optimizer changes. Something else is going wrong.

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

View raw message