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

Error "context already in use (BLR error)" when preparing a query with UNION [CORE4144] #4471

Closed
firebird-automations opened this issue Jul 19, 2013 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @hvlad

Is related to QA516

It was discovered when researching bug CORE4005, but it is not depends on recursive queries.

Simplified example:

select n
from
(
select d.rdb$relation_id as n from rdb$database d
union all
select d.rdb$relation_id as n from rdb$database d
)

union all

select cast(1 as bigint) from rdb$database d

At prepare time error is raised:

Invalid token.
invalid request BLR at offset 24.
context already in use (BLR error).

The bug happens when :
- first member of UNION is derived table, and
- data type of first field of that derived table is impliciltly CAST'ed to the type of whole UNION (int -> bigint in example above)

Commits: a4d6f10 01a6f1a 7986522 FirebirdSQL/fbt-repository@c83aa49 FirebirdSQL/fbt-repository@29debd8 FirebirdSQL/fbt-repository@870df69 FirebirdSQL/fbt-repository@b3d1d8e

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Bug was introduced at v2.0

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Version: 2.1.5 Update 1 [ 10522 ]

Version: 2.5.2 [ 10450 ]

Version: 2.1.5 [ 10420 ]

Version: 2.0.7 [ 10390 ]

Version: 2.5.1 [ 10333 ]

Version: 2.1.4 [ 10361 ]

Version: 2.5.0 [ 10221 ]

Version: 2.0.6 [ 10303 ]

Version: 3.0 Initial [ 10301 ]

Version: 2.1.3 [ 10302 ]

Version: 2.1.2 [ 10270 ]

Version: 2.0.5 [ 10222 ]

Version: 2.1.1 [ 10223 ]

Version: 2.1.0 [ 10041 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 2.5.3 [ 10461 ]

Fix Version: 2.1.6 [ 10460 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA516 [ QA516 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

Test created.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

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