Selecting from table "A" with COMPUTED_BY index base on query to another table 
"B" leads to " internal Firebird consistency check ((CMP) copy: cannot remap 
(221), file: RecordSourceNodes.cpp line: 1363)"
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-4792
                 URL: http://tracker.firebirdsql.org/browse/CORE-4792
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
            Reporter: Pavel Zotov
            Priority: Minor


After reading CORE-1865 it was found that following script can lead to some 
troubles (though this is very bad code):

-- (correct host/port  and path/name with yours):
shell del C:\MIX\firebird\QA\fbt-repo\tmp\tmptest.fdb 2>nul;
create database 'localhost/3329:C:\MIX\firebird\QA\fbt-repo\tmp\tmptest.fdb';
show version;
set echo on;
recreate table tdetl( id int, pid int, cost numeric(12,2) );
recreate table tmain( id int primary key, dsum computed by ( (select sum(cost) 
from tdetl d where d.pid = tmain.id) ) );
commit;
create index tmain_dsum on tmain computed by ( (select sum(cost) from tdetl d 
where d.pid = tmain.id) );
commit;

insert into tmain(id) values(1);
insert into tmain(id) values(2);
insert into tmain(id) values(3);

insert into tdetl values(101, 1, 123.45);
insert into tdetl values(101, 1, 456.78);
insert into tdetl values(101, 1, 789.01);
insert into tdetl values(101, 2, 890.12);
insert into tdetl values(101, 2, 901.23);
insert into tdetl values(101, 3, 333.22);
insert into tdetl values(101, 3, 444.33);
commit;

set plan on;
select * from tmain where dsum between 700 and 900; --- [1]

After statement  [1] will appear on the screen the following occurs:

1) Standard Windows message appearing about error issued by application 
(Firebird in this case) and that this app will be closed;
2) This message contain names of two files with debug info (both in TEMP 
folder): firebird.exe.mdmp and appcompat.txt -- I've attached them;
3) firebird.log contains:
===
internal Firebird consistency check ((CMP) copy: cannot remap (221), file: 
RecordSourceNodes.cpp line: 1363)
===
4) it is impossible to stop FB service using windows standard applet "Services" 
-- one may only to kill it using PE.
5) CS -  loads CPU 100% after press "Close" on error window.


Link to full dumps that I've made in PE when Firebird was hung:   
https://yadi.sk/d/_HjH7Hjugf66k

Link to debug files (c:\temp\xxx\firebird.exe.mdmp and 
c:\temp\xxx\appcompat.txt) for SS/SC/CS:  https://yadi.sk/d/uviAJ_xqgf6M7

PS. WI-T3.0.0.31836

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to