AUTODDL OFF: can`t create procedure P2 which references on proc P1 and both of 
them are created in same transaction (and ONLY at 2nd, 4th, 6th etc even runs 
of the script)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-4490
                 URL: http://tracker.firebirdsql.org/browse/CORE-4490
             Project: Firebird Core
          Issue Type: Bug
    Affects Versions: 2.5.3
            Reporter: Pavel Zotov


LI-V2.5.3.26744

1. Create new database:

SQL> create database 'test25.fdb'; commit;
SQL> connect 'localhost/3253:/var/db/fb25/test25.fdb';
Database:  'localhost/3253:/var/db/fb25/test25.fdb'

2. Run *several* times the following script ('crp.sql'):

set autoddl off;
commit;

set term ^;
create or alter procedure p1 returns (result int) as
begin
    result = 1;
    suspend;
end
^

create or alter procedure p2 returns (result int) as
begin
    result = (select result from p1);
    suspend;
end
^

set term ;^
rollback;
--- end of script 'crp.sql' ---

The output in ISQL is:

SQL> in crp.sql;
SQL> show proc;
There are no stored procedures in this database
-- Ok --
--- Now run this script AGAIN in the same connection:

SQL> in crp.sql;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-Procedure P1 not found
After line 4 in file crp.sql
Statement failed, SQLSTATE = 42S02
Dynamic SQL Error
-SQL error code = -204
-Table unknown
-P1
-At line 3, column 34
At line 13 in file crp.sql
SQL>

--- So, 2nd run faults.
-- Now try it one again, 3rd run:

SQL> in crp.sql;
SQL> show proc;
There are no stored procedures in this database
--- Ok! ---

-- And now - once more, 4th time:
SQL> in crp.sql;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-Procedure P1 not found
After line 4 in file crp.sql
Statement failed, SQLSTATE = 42S02
Dynamic SQL Error
-SQL error code = -204
-Table unknown
-P1
-At line 3, column 34
At line 13 in file crp.sql

--- So, 4th run *faults* - as 2nd.

All odd runs (1,3,5,...) of this script finishes Ok and even ones (2,4,6,...) 
faults.

PS. No such problem in LI-T3.0.0.31208

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

        

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to