You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firebird 3 gives error "no current record for fetch operation" with queries filtering a table using an index, and with a second filter using a subselect with an aggregation function running over a second table correlated with the table of the outer select.
It can be reproduced with the following (nonsense) query:
select *
from rdb$relations r
where
rdb$relation_name = ''
or (
select sum(rdb$relation_id)
from rdb$database d
where d.rdb$character_set_name = r.rdb$owner_name
) > 0
-
FB 2.1, 2.5:
PLAN (D NATURAL)
PLAN (R NATURAL)
Runs ok (no results)
-
FB 3.0.4, 3.0.5.33182-0_x64_nightly, Firebird-4.0.0.1636-0_x64_nightly:
PLAN (D NATURAL)
PLAN (R NATURAL, R INDEX (RDB$INDEX_0))
Select Expression
-> Singularity Check
-> Aggregate
-> Filter
-> Table "RDB$DATABASE" as "D" Full Scan
Select Expression
-> Filter
-> Condition
-> Table "RDB$RELATIONS" as "R" Full Scan
-> Table "RDB$RELATIONS" as "R" Access By ID
-> Bitmap
-> Index "RDB$INDEX_0" Unique Scan
Statement failed, SQLSTATE = 22000
no current record for fetch operation
Submitted by: Paquito Ines (paquito)
Firebird 3 gives error "no current record for fetch operation" with queries filtering a table using an index, and with a second filter using a subselect with an aggregation function running over a second table correlated with the table of the outer select.
It can be reproduced with the following (nonsense) query:
select *
from rdb$relations r
where
rdb$relation_name = ''
or (
select sum(rdb$relation_id)
from rdb$database d
where d.rdb$character_set_name = r.rdb$owner_name
) > 0
-
FB 2.1, 2.5:
PLAN (D NATURAL)
PLAN (R NATURAL)
Runs ok (no results)
-
FB 3.0.4, 3.0.5.33182-0_x64_nightly, Firebird-4.0.0.1636-0_x64_nightly:
PLAN (D NATURAL)
PLAN (R NATURAL, R INDEX (RDB$INDEX_0))
Select Expression
-> Singularity Check
-> Aggregate
-> Filter
-> Table "RDB$DATABASE" as "D" Full Scan
Select Expression
-> Filter
-> Condition
-> Table "RDB$RELATIONS" as "R" Full Scan
-> Table "RDB$RELATIONS" as "R" Access By ID
-> Bitmap
-> Index "RDB$INDEX_0" Unique Scan
Statement failed, SQLSTATE = 22000
no current record for fetch operation
Commits: 1ccadfd c05df45
The text was updated successfully, but these errors were encountered: