Issue Details (XML | Word | Printable)

Key: CORE-2069
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Adriano dos Santos Fernandes
Votes: 0
Watchers: 0
Operations

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

Incorrect VIEW expansion when RDB$DB_KEY is used in view body

Created: 07/Sep/08 06:32 PM   Updated: 25/Apr/11 03:46 PM
Component/s: None
Affects Version/s: 2.1.0, 2.5 Alpha 1, 2.1.1
Fix Version/s: 2.5 Beta 1

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
create table t1 (n integer);

insert into t1 values (1);
insert into t1 values (2);
insert into t1 values (3);

-- ok
SQL> select a.*
CON> from t1 a
CON> where a.rdb$db_key = (
CON> select b.rdb$db_key
CON> from t1 b
CON> where n = 1
CON> );

           N
============
           1

-- ok
SQL> create view v1 as
CON> select a.*
CON> from t1 a
CON> where a.rdb$db_key = (
CON> select b.rdb$db_key
CON> from t1 b
CON> where n = 1
CON> );
SQL>

-- ok
SQL> select * from v1;

           N
============
           1

-- wrong: returns nothing
SQL> select * from v1 union all select * from v1;


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Cisar added a comment - 25/Apr/11 03:46 PM
QA test added.