Rolling back a transaction that creates a function or procedure keeps a cached 
version of that function or procedure when subsequently re-creating it.
------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-5652
                 URL: http://tracker.firebirdsql.org/browse/CORE-5652
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0.2
         Environment: Windows 7 32-bit running Firebird 3.0.2.32703 executing 
scripts with FlameRobin 0.9.3.
            Reporter: Ob-serve


1.  Execute the following test script:

SET TERM ^ ;
CREATE FUNCTION fnTest ()
    RETURNS INTEGER
AS
BEGIN
    RETURN 1;
END^
SET TERM ; ^

SELECT fnTest() FROM RDB$DATABASE;

2. Then rollback the transaction / script.

3.. Now execute:

SET TERM ^ ;
CREATE FUNCTION fnTest ()
    RETURNS INTEGER
AS
BEGIN
    RETURN 2;
END^
SET TERM ; ^

SELECT fnTest() FROM RDB$DATABASE;

You should find that the value 1 is still returned incorrectly.

The same is also true for procedures as you can test by running:

SET TERM ^ ;
CREATE OR ALTER PROCEDURE spTest
    RETURNS (
            Result INTEGER
            )
AS
BEGIN
    :Result = 1;
    SUSPEND;
END^
SET TERM ; ^

SELECT * FROM spTest;

Rollback the transaction / script.

Now run:

SET TERM ^ ;
CREATE OR ALTER PROCEDURE spTest
    RETURNS (
            Result INTEGER
            )
AS
BEGIN
    :Result = 2;
    SUSPEND;
END^
SET TERM ; ^

SELECT * FROM spTest;

If you disconnect from the database between rollback and running the modified 
function / procedure then all works correctly.  Suspect there is a compiled / 
cached version of the function / procedure which is not be cleared correctly on 
rollback.

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

        

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to