|
From: Alessandro P. <pet...@in...> - 2004-09-17 13:48:11
|
Hi everyone
I know the following SP have no-sense, but instead of rejecting the query it
crashes the engine.
I'm using Fb 1.5.1 Classic under Windows XP SP 2.
CREATE PROCEDURE CRASH_ENGINE (
TABLE_NAME VARCHAR(100))
RETURNS (
MYCOUNT INTEGER)
AS
BEGIN
EXECUTE STATEMENT 'select count from ' || :TABLE_NAME INTO :MYCOUNT;
END
Any idea?
Ciao,
Alessandro Petrelli.
|
|
From: Alex P. <pe...@in...> - 2004-09-20 07:28:23
|
Alessandro Petrelli wrote:
>Hi everyone
>
>I know the following SP have no-sense, but instead of rejecting the query it
>crashes the engine.
>I'm using Fb 1.5.1 Classic under Windows XP SP 2.
>
>CREATE PROCEDURE CRASH_ENGINE (
> TABLE_NAME VARCHAR(100))
>RETURNS (
> MYCOUNT INTEGER)
>AS
>BEGIN
> EXECUTE STATEMENT 'select count from ' || :TABLE_NAME INTO :MYCOUNT;
>END
>
>Any idea?
>
>
>
Couldn't reproduce in HEAD. More details required. The behaviour is 'as
designed'.
SQL> set term ^;
SQL> CREATE PROCEDURE CRASH_ENGINE (
CON> TABLE_NAME VARCHAR(100))
CON> RETURNS (
CON> MYCOUNT INTEGER)
CON> AS
CON> BEGIN
CON> EXECUTE STATEMENT 'select count from ' || :TABLE_NAME INTO :MYCOUNT;
CON> END
CON> ^
SQL> commit^
SQL> set term ;^
SQL> select * from CRASH_ENGINE('rdb$databases');
MYCOUNT
============
Statement failed, SQLCODE = -104
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, char 15
-from
SQL>
Alex.
|
|
From: Nando D. <na...@de...> - 2004-09-20 07:42:25
|
Alex, AP> Couldn't reproduce in HEAD. More details required. The behaviour is 'as AP> designed'. what Alessandro forgot to add is that the crash only happens when you pass null to the procedure (that's what "makes no sense", not the procedure "per se"). I can confirm it for SS as well. Ciao -- Nando mailto:na...@de... |
|
From: Holger K. <hk...@h-...> - 2004-09-20 09:33:04
|
here is also a way that always crashes the server
(was lready reported in firebird support list)
just run the following procedure:
CREATE PROCEDURE SP
RETURNS (
RET VARCHAR(100))
AS
declare variable sql varchar(200);
begin
sql=null;
execute statement sql into ret;
suspend;
end
I use Firebird 1.5.1.4481 on Windows
--
Best Regards
Holger Klemt
HK-Software Roadshow 2004 in Germany: Vom Daten-Chaos zur
Information, Datenbankstrategien für Ihr Unternehmen
Teilnahme kostenlos, Termine, Orte und Anmeldung www.h-k.de
The most Expert for InterBase and Firebird --- www.ibexpert.com
HK Software - Huntestrasse 15 - 26135 Oldenburg - Germany
Phone/Fax +49 700 IBEXPERT (42397378) www.h-k.de
Training and Support for Delphi, InterBase, Firebird, AS/400
|
|
From: Claudio V. C. <cv...@us...> - 2004-09-21 01:49:54
|
Holger Klemt wrote: > here is also a way that always crashes the server > (was lready reported in firebird support list) > > just run the following procedure: > > CREATE PROCEDURE SP > RETURNS ( > RET VARCHAR(100)) > AS > declare variable sql varchar(200); > begin > sql=null; > execute statement sql into ret; > suspend; > end > > I use Firebird 1.5.1.4481 on Windows It seems it has to be put in the tracker, so it's documented and marked as fixed in the HEAD: F:\fb2dev\fbbuild\firebird2\temp\debug\firebird\bin>isql -z ISQL Version: WI-T2.0.0.8308 Firebird 2.0 UNSTABLE Use CONNECT or CREATE DATABASE to specify a database SQL> create database 'holger'; SQL> set term ^; SQL> CREATE PROCEDURE SP CON> RETURNS ( CON> RET VARCHAR(100)) CON> AS CON> declare variable sql varchar(200); CON> begin CON> sql=null; CON> execute statement sql into ret; CON> suspend; CON> end CON> ^ SQL> select * from sp^ RET ================================================================== Statement failed, SQLCODE = -904 Invalid argument in EXECUTE STATEMENT - cannot convert to string -At procedure 'SP' SQL> ^Z I did exactly what you suggested. C. |
|
From: Alessandro P. <pet...@in...> - 2004-09-20 07:42:28
|
"Alex Peshkov" <pe...@in...> ha scritto nel messaggio news:414...@in...... Hi Alex, >>I know the following SP have no-sense, but instead of rejecting the query >>it crashes the engine. >>I'm using Fb 1.5.1 Classic under Windows XP SP 2. >> >>CREATE PROCEDURE CRASH_ENGINE ( >> TABLE_NAME VARCHAR(100)) >>RETURNS ( >> MYCOUNT INTEGER) >>AS >>BEGIN >> EXECUTE STATEMENT 'select count from ' || :TABLE_NAME INTO :MYCOUNT; >>END sorry but something's gone wrong with copy&paste, should be: EXECUTE STATEMENT 'select count(*) from ' || :TABLE_NAME INTO :MYCOUNT; Ciao, Alessandro Petrelli. |
|
From: Alex P. <pe...@in...> - 2004-09-20 14:50:02
|
Alessandro Petrelli wrote:
>sorry but something's gone wrong with copy&paste, should be:
>
>EXECUTE STATEMENT 'select count(*) from ' || :TABLE_NAME INTO :MYCOUNT;
>
>
Guys, PLEASE - give exact details!
In current HEAD:
SQL> set term ^;
SQL> CREATE PROCEDURE CRASH_ENGINE (
CON> TABLE_NAME VARCHAR(100))
CON> RETURNS (
CON> MYCOUNT INTEGER)
CON> AS
CON> BEGIN
CON> EXECUTE STATEMENT 'select count(*) from ' || :TABLE_NAME INTO
:MYCOUNT;
CON> END
CON> ^
SQL> commit^
SQL> select * from CRASH_ENGINE(NULL)^
MYCOUNT
============
Statement failed, SQLCODE = -904
Invalid argument in EXECUTE STATEMENT - cannot convert to string
-At procedure 'CRASH_ENGINE'
SQL> select * from CRASH_ENGINE('rdb$database')^
SQL> execute procedure CRASH_ENGINE^
Statement failed, SQLCODE = -902
Dynamic SQL Error
-parameter mismatch for procedure CRASH_ENGINE
SQL>
WHAT parameter should be passed? Yopu see passing NULL makes no harm,
call w/o parameter impossible.
WHAT engine version? I check against HEAD...
A.
|
|
From: Nando D. <na...@de...> - 2004-09-20 15:04:46
|
Alex, AP> Guys, PLEASE - give exact details! Alessandro specified that he was using Firebird 1.5.1 CS on Windows. I added that I verified the problem on SS as well. I meant 1.5.1 SS on Windows. AP> WHAT engine version? I check against HEAD... I guess you can safely classify it as fixed in 2.0, unless it is deemed important enough to be backported to the forthcoming 1.5.2. Ciao -- Nando mailto:na...@de... |