#209 IBPP::LogicException using FB 2.5.1rc1

v1.0
closed
nobody
None
5
2014-12-07
2011-09-08
Anonymous
No

I've started getting this:

Error: IBPP::LogicException
Context: RB::GetCountValue
Message: Token not found.

since upgrading a test server to firebird 2.5.1 rc1 (from 2.1.4, never tried 2.5.0.) The statement seems to execute okay, and I can commit, but Flamerobin's pretty much dead after that and needs to be restarted. (Fatal error, do you want to try, etc.)

This has happened with FR 0.9.3-1897, 2007, and 2106, on WindowsXP and Server2008, both remotely and locally. I do not get the same problem when talking to FB 2.1.4. (Same metadata, same query.)

The particular query I was running today was:

create view UT_VIEW_FOREIGN_KEYS (FK_NAME, FK_TABLE, FK_FIELD, PK_NAME, PK_TYPE, PK_TABLE, PK_FIELD, DELETE_RULE, UPDATE_RULE)
as
select fkc.rdb$constraint_name fk_name,
fkc.rdb$relation_name fk_table,
fkseg.rdb$field_name fk_field,
pkc.rdb$constraint_name pk_name,
pkc.rdb$constraint_type pk_type,
pkc.rdb$relation_name pk_table,
pkseg.rdb$field_name pk_field,
fk.rdb$delete_rule delete_rule,
fk.rdb$update_rule update_rule
from rdb$ref_constraints fk
inner join rdb$relation_constraints fkc on fkc.rdb$constraint_name = fk.rdb$constraint_name
inner join rdb$relation_constraints pkc on pkc.rdb$constraint_name = fk.rdb$const_name_uq
inner join rdb$indices fkix on fkix.rdb$index_name = fkc.rdb$index_name
inner join rdb$indices pkix on fkix.rdb$foreign_key = pkix.rdb$index_name
inner join rdb$relation_constraints pk on pk.rdb$index_name = pkix.rdb$index_name
inner join rdb$index_segments fkseg on fkix.rdb$index_name = fkseg.rdb$index_name
inner join rdb$index_segments pkseg on pkix.rdb$index_name = pkseg.rdb$index_name and pkseg.rdb$field_position = fkseg.rdb$field_position;

create table mi_fk_snapshot
(
id varchar(50),
fk_name varchar(50),
pk_table varchar(50),
total_count integer,
match_count integer,
later_count integer
);

set term ^;
create or alter procedure mi_prc_chk_fk_usage
returns (
fk_name varchar(50),
pk_table varchar(50),
total_count integer,
match_count integer,
later_count integer
)
as
declare variable fk_table varchar(50);
declare variable fk_field varchar(50);
declare variable pk_field varchar(50);
begin
for select rtrim(fk_name), rtrim(fk_table), rtrim(fk_field), rtrim(pk_table), rtrim(pk_field)
from UT_VIEW_FOREIGN_KEYS
where fk_name like 'MI_FK_%' escape '\' --'
into :fk_name, :fk_table, :fk_field, :pk_table, :pk_field do
begin
execute statement 'select count() from ' || :pk_table into :total_count;
execute statement 'select count(
) from ' || :pk_table || ' inner join ' || :fk_table || ' on ' || :pk_table || '.' || :pk_field || ' = ' || :fk_table || '.' || :fk_field into :match_count;
later_count = null;
begin
execute statement 'select count(*) from ' || :pk_table || ' where event_by is not null' into :later_count;
when any do begin end
end
suspend;
end
end^
set term ;^

insert into mi_fk_snapshot (id, fk_name, pk_table, total_count, match_count, later_count)
select '20110908 1643 baseline', fk_name, pk_table, total_count, match_count, later_count from mi_prc_chk_fk_usage;

The error happens whether I just select the data, or select + insert. It originally happened when I had that SP as an anonymous EXECUTE BLOCK, and I tried creating a named SP to see if FR was having trouble selecting from a block (and discovering the fieldnames) -- that doesn't seem to be the problem.

unordained@gmail.com if you'd like to send me a debug build to try out.

Discussion

  • Michael Hieke
    Michael Hieke
    2011-09-09

    I could not reproduce this, so it's probably best if you try with the latest code - I uploaded a snapshot build of SVN revision 2188.

     
  • mariuz
    mariuz
    2014-03-06

    • status: open --> closed
    • Group: --> v1.0
     


Anonymous


Cancel   Add attachments