Message "request depth exceeded. (Recursive definition?)" appears when code 
violates uniqueness of index with computed-by key that force engine to scan 
multiple records. Command "QUIT" is impossible in 3.0 and very slow in 2.5.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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


Conside following script (I named it 'qq2.sql'):
===
recreate table foo(id int primary key);
commit;
set term ^;
execute block as
begin
  execute statement 'drop sequence g'; when any do begin end
end
^ set term ;^
commit;
create sequence g;
commit;

insert into foo values(1);
insert into foo values(2);
insert into foo values(3);
commit;

create unique index foo_unq on foo computed by( iif( exists(select * from foo x 
where x.id < 0 and x.id<>foo.id), 0, id ) );

set list on;
set echo on;
update foo set id = -id where id = 1;

select current_time as "Inside ISQL, before QUIT:" from rdb$database;
quit;
===

Key expression for index is completely stupid: no matter what does it mean but  
it is allowed in such form by engine.

Then create batch:
===
@echo off
setlocal enabledelayedexpansion enableextensions

C:\MIX\firebird\fb25\bin\isql.exe /3255:e25 -i qq2.sql  

echo After ISQL: !time!
===

Substitute in this batch your path to isql, host/port and alias and run it.

On Windows 32-bit I get:

1) for WI-V2.5.5.26936:
===
update foo set id = -id where id = 1;
Statement failed, SQLSTATE = 54001
unsuccessful metadata update
-request depth exceeded. (Recursive definition?)
After line 21 in file qq2.sql

select current_time as "Inside ISQL, before QUIT:" from rdb$database;

Inside ISQL, before QUIT:       21:22:04.0000


quit;
After ISQL: 21:24:04,58
===

Message text seems not clear: what 'recursive' was too deep ? Also, 'QUIT' 
command performed about 2 minutes - too long.

2) for WI-V3.0.0.32084: the same STDERR & STDOUT, but 'QUIT' hangs infinitely.

Link to full dumps of firebird.exe and isql.exe (for 3.0) see here:  
https://yadi.sk/d/IMwFWgU5jjkPN


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

        

------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to