Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No current record for fetch operation" with queries with aggregated subselect [CORE6171] #6419

Closed
firebird-issue-importer opened this issue Oct 28, 2019 · 4 comments

Comments

@firebird-issue-importer

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

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 28, 2019

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Oct 29, 2019

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0.5 [ 10885 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 1, 2019

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 1, 2019

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment