Issue Details (XML | Word | Printable)

Key: CORE-3806
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Dmitry Yemanov
Votes: 0
Watchers: 0
Operations

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

Wrong data returned if a sub-query or a computed field refers to the base table in the ORDER BY clause

Created: 02/Apr/12 12:23 PM   Updated: 10/Apr/14 12:17 PM
Component/s: Engine
Affects Version/s: 2.1.0, 2.1.1, 2.0.5, 2.1.2, 2.1.3, 3.0 Initial, 2.0.6, 2.5.0, 2.1.4, 2.5.1
Fix Version/s: 2.5.2, 3.0 Alpha 1

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
Simplified test case:

create table t (col1 int, col2 int, col3 int);
insert into t values (100, 200, 300);
insert into t values (101, 201, 301);
insert into t values (102, 202, 302);
commit;
alter table t drop col1;
-- at this point we have data stored in format 1 but the current format is 2

select col2, col3
from t as t1
-- correct results

select col2, col3
from t as t1
where exists (select * from t as t2 order by t1.col2 )
-- wrong results: both columns return the same data

Key points to see the issue:
- storage format should differ from the current one
- inner query should have ORDER BY referencing to the base table
- base table should not have SORT plan

Regardless of how stupid such an ORDER BY clause may look, the engine should not return garbage.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.