Error "context already in use (BLR error)" when preparing a query with UNION [CORE4144] #4471
Labels
affect-version: 2.0.5
affect-version: 2.0.6
affect-version: 2.0.7
affect-version: 2.1.0
affect-version: 2.1.1
affect-version: 2.1.2
affect-version: 2.1.3
affect-version: 2.1.4
affect-version: 2.1.5 Update 1
affect-version: 2.1.5
affect-version: 2.5.0
affect-version: 2.5.1
affect-version: 2.5.2 Update 1
affect-version: 2.5.2
affect-version: 3.0 Initial
component: engine
fix-version: 2.1.6
fix-version: 2.5.3
fix-version: 3.0 Alpha 1
priority: major
qa: done successfully
type: bug
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
The text was updated successfully, but these errors were encountered: