Issue Details (XML | Word | Printable)

Key: CORE-4144
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Vlad Khorsun
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird Core

Error "context already in use (BLR error)" when preparing a query with UNION

Created: 19/Jul/13 08:35 AM   Updated: 29/Dec/15 03:09 PM
Component/s: Engine
Affects Version/s: 2.1.0, 2.1.1, 2.0.5, 2.1.2, 2.1.3, 3.0 Initial, 2.0.6, 2.5.0, 2.1.4, 2.5.1, 2.0.7, 2.1.5, 2.5.2, 2.1.5 Update 1, 2.5.2 Update 1
Fix Version/s: 3.0 Alpha 1, 2.1.6, 2.5.3

Issue Links:

QA Status: Done successfully

 Description  « Hide
It was discovered when researching bug CORE-4005, but it is not depends on recursive queries.

Simplified example:

select n
     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)

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 22/Jul/13 08:49 AM
Bug was introduced at v2.0

Pavel Cisar added a comment - 25/Sep/15 12:22 PM
Test created.