From: Fabiano B. <fa...@pe...> - 2006-04-07 12:16:01
|
Fabiano Bonin escreveu: > Usually, i get a server crash when i run the SP below. > It counts the records of all non-systems tables. > Sometimes it works, but it crashes very often. > Tested with FB 1.5.3 and FB 2.0 RC 1. > > select * from sp_record_count(null); > > > Here is its code: > > set term !! ; > > create or alter procedure sp_record_count ( > p_table_name varchar(31) ) > returns ( > table_name varchar(31), > record_count integer ) > as > begin > for select > a.rdb$relation_name > from > rdb$relations a > where > ( :p_table_name is null or upper(a.rdb$relation_name) = > upper(:p_table_name) ) and > ( a.rdb$relation_name not like 'RDB$%' ) and > ( a.rdb$view_blr is null ) > into > :table_name > do > begin > execute statement 'select count(*) from "' || :table_name || '"' > into :record_count; > suspend; > end > end !! > > set term ; !! > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > Firebird-Devel mailing list, web interface at > https://lists.sourceforge.net/lists/listinfo/firebird-devel > I have two computers: One is using Fedora Core 3 and Firebird 1.5.3 Classic. Another is using Fedora Core 4 and Firebird 2.0 RC1 Classic. If i connect with isql using the ip address (isql <ip>:<database>), the error happens in FB 1.5.3 but doesn't happens in FB 2.0. If i connect with isql direct to the database (isql <database>), the error doesn't happens on both. If i connect using IBExpert, the error happens on both. PS: I noted a difference in the behaviour of this procedure in FB 2.0 when i connect using the IP address and when i connect directly. When i use the IP, after i type 'select * from sp_record_count(null)', i have to wait the server to process all records, and after some time, it returns all records in one time. If i connect directly, just after i execute the query, it starts to show the records, one at a time, while it's is counting the records. |