Skip to content

Comparision with IN and subquery with RDB$DB_KEY returns wrong result [CORE2068] #2504

Closed
@firebird-automations

Description

@firebird-automations

Submitted by: @asfernandes

Is related to QA364

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

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

       N 

============
1
2
3

Commits: 50ab76f

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions