False triggering of FOREIGN KEY constraint on 7th (seventh) iteration when 
script infinitely does recreate tables with PK and FK, add data, update it and 
then drop tables
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-5172
                 URL: http://tracker.firebirdsql.org/browse/CORE-5172
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 4.0 Initial, 3.0 RC2, 2.5.5
            Reporter: Pavel Zotov
         Attachments: false-FK-triggering-on-seventh-iter.7z

When attempted to implement test for very old CORE-77 I've encountered that if 
script from this ticket is applied several times than metadata become in some 
strange state that prevents from normal data modification. 

Please see attached .7z and run script  "c0077-run.sql" like this: isql -q -i 
c0077-run.sql 1>log 2>&1
(but do not forget first to open this script in editor and correct path to 
database!)

You will see every time following tail in log:

===
                                ##### iter N 7 #####
    set term ^;
    execute block as
    begin
        begin
            execute statement 'alter table department drop constraint 
fk_employee_department';
            when any do begin end
        end
        begin
            execute statement 'alter table usr drop constraint 
fk_department_usr';
            when any do begin end
        end
        begin
            execute statement 'alter table usr drop constraint fk_employee_usr';
            when any do begin end
        end
    end
    ^
    set term ;^
    commit;

. . . . . . . . .

    --8) try to update employee

    update employee set empl_name = 'foo'
    where empl_name = 'bar'; 
Statement failed, SQLSTATE = 23000
violation of FOREIGN KEY constraint "FK_DEPARTMENT_USR" on table "USR"
-Foreign key reference target does not exist
-Problematic key value is ("EMPLOYEE" = 'foo', "DEPARTMENT" = 'administrative')
-At trigger 'CHECK_21'
After line 118 in file c0077-chk.sql
===


-- 
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

        

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to