[ 
http://tracker.firebirdsql.org/browse/CORE-5652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vlad Khorsun reopened CORE-5652:
--------------------------------


I missed that script was executed with FlameRobin.
Now, with isql and AUTODDL OFF

SQL>
SQL> SET AUTODDL OFF;
SQL>
SQL> SET TERM ^ ;
SQL> CREATE FUNCTION fnTest ()
CON>     RETURNS INTEGER
CON> AS
CON> BEGIN
CON>     RETURN 1;
CON> END^
SQL> SET TERM ;^
SQL>
SQL> SELECT fnTest() FROM RDB$DATABASE;

      FNTEST
============
           1

SQL> ROLLBACK;
SQL> SELECT fnTest() FROM RDB$DATABASE;

      FNTEST
============
           1

SQL> DROP FUNCTION fnTest;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-DROP FUNCTION FNTEST failed
-Function FNTEST not found
SQL>exit;

connect again:

SQL> SELECT fnTest() FROM RDB$DATABASE;
Statement failed, SQLSTATE = 39000
Dynamic SQL Error
-SQL error code = -804
-Function unknown
-FNTEST
SQL>

> 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 being cleared 
> correctly on rollback.
> UPDATE 04/12/2017 SIMILAR ISSUE
> --------------------------------------------------
> 1. Perform an operation on a table that would violate a constraint.
> 2. Note error message involving violation of constraint 'constraint name'.
> 3. Rollback the transaction.
> 4. Drop the constraint
> 5. Perform the same table that would have violated the constraint.
> 6. Note the error message involving violation of constraint 'unknown'.
> If you repeat the procedure but close & re-open the database connection 
> between steps 3 & 4, you'll find that step 5. now completes successfully.

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