Issue Details (XML | Word | Printable)

Key: CORE-2969
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Pavel Zotov
Votes: 0
Watchers: 0
Operations

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

rdb$set_context does NOT allow to overwrite any vars after encountering limit (default=1000) of them

Created: 16/Apr/10 09:02 AM   Updated: 28/Nov/13 01:20 PM
Component/s: Engine
Affects Version/s: 2.1.3
Fix Version/s: 2.1.4

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
It is impossible to OVERWRITE any of previously assigned context variable if the number of them reaches the hard-coded limit (1000).
The following code will finished Ok only for the FIRST run. The error "Too many context variables" will occur if we run it second time - even if the limit will be decreased:

execute block returns(was_overwritten int, ctx_key varchar(30), ctx_val varchar(30))
as
  declare variable k int;
begin
  k = 0;
  while (k < 1000) do
  begin
    ctx_key = 'var_' || k;

    was_overwritten=rdb$set_context('USER_SESSION', :ctx_key, rand());
    ctx_val = rdb$get_context('USER_SESSION', :ctx_key);
    suspend;

    k = k + 1;
  end
end


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 16/Apr/10 10:43 AM
The fix was backported from v2.5 where it was fixed already