Issue Details (XML | Word | Printable)

Key: DERBY-466
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Manish Khettry
Reporter: Manish Khettry
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Distinct in subselect can return wrong results

Created: 20/Jul/05 09:22 AM   Updated: 25/Apr/06 03:45 AM
Return to search
Component/s: SQL
Affects Version/s: None
Fix Version/s: 10.1.3.1, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works d466-10_1.patch 2005-11-20 06:08 AM A B 3 kB
Text File Licensed for inclusion in ASF works distinct.diff.txt 2005-07-20 09:35 AM Manish Khettry 3 kB
Environment: All Platforms

Resolution Date: 25/Apr/06 03:45 AM


 Description  « Hide
The second query should return two rows but returns just one.

ij> select * from t1;
I |V
----------------------
1 |row 1
2 |row 2

2 rows selected
ij> select * from t1, (select distinct 1 from t1) as sub(c);
I |V |C
----------------------------------
1 |row 1 |1

1 row selected

More specifically, this bug will show up when the sql layer does duplication elimination for distinct *without* a sorter (i.e. the underlying result set is already sorted). The result set will return correct data the first time, but after it is closed and re-opened it will not return any data rows.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.