Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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) [CORE4490] #4810

Open
firebird-automations opened this issue Jul 10, 2014 · 1 comment

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @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

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

I don't believe this is going to be easily fixable in 2.5...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant