Bugs item #1714809, was opened at 2007-05-08 11:17
Message generated for change (Comment added) made by romulog
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1714809&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: SQL CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Romulo Goncalves (romulog)
Assigned to: Niels Nes (nielsnes)
Summary: Infinite loop....

Initial Comment:
Just run the example:

create table t1(id int, name varchar(1024), age int);
create table t2(id int, age int);

create PROCEDURE p1(id int, age int)
BEGIN
        insert into t2 values(id, age);
END;

create PROCEDURE p1()
BEGIN
        declare id int, age int;
        set id = 1;
        set age = 23;
        call p1(id, age);
END;

create trigger test_0 after insert on t2
        BEGIN ATOMIC
                insert into t1 values(1, 'monetdb', 24);
                call p1();
        END;

insert into t2 values(0, 24);

There is a infinite loop due the call of p1(). The infinite loops created by 
triggers (an update operation from one trigger which fires another trigger) 
were killed. However, when the update comes from a procedure the infinite loop 
is not avoided.

Regards,
Romulo

----------------------------------------------------------------------

>Comment By: Romulo Goncalves (romulog)
Date: 2007-05-10 17:04

Message:
Logged In: YES 
user_id=1498628
Originator: YES

This bug is fixed for M4-SQL. 

The test to cover it can be found:
sql/src/test/BugTracker/Tests/infinite_loop.SF-1714809.sql

However, in M5 the infinite loop continue.

with optimizer='off' I get:

#~ MAPI  = [EMAIL PROTECTED]:37605
=QUERY = insert into t2 values(0, 24);
ERROR = !TypeException:user.p1[21]:'user.p1' undefined in: _39:any :=
user.p1()
#~ MAPI  = [EMAIL PROTECTED]:37605
=QUERY = insert into t2 values(0, 24);
ERROR = !ERROR: Syntax error in script
# the original non-normalized output was: ERROR =
!MALException:user.p1[0]:Syntax error in script

Niels, to who I should assign this BUG? TO you or Martin?

Regards,
Romulo

----------------------------------------------------------------------

Comment By: Romulo Goncalves (romulog)
Date: 2007-05-10 12:15

Message:
Logged In: YES 
user_id=1498628
Originator: YES

The new error for this bug after updating my M5 and SQL (cvs branch).

#~ MAPI  = [EMAIL PROTECTED]:35709
=QUERY = insert into t2 values(0, 24);
ERROR = !TypeException:user.p1[21]:'user.p1' undefined in: _39:any :=
user.p1()
#~ MAPI  = [EMAIL PROTECTED]:35709
=QUERY = insert into t2 values(0, 24);
ERROR = !ERROR: Syntax error in script
# the original non-normalized output was: ERROR =
!MALException:user.p1[0]:Syntax error in script
 
# 12:13:20 >  
# 12:13:20 >  Done.
# 12:13:20 >  
 
I assign the bug to Niels....


Regards,
Romulo

----------------------------------------------------------------------

Comment By: Niels Nes (nielsnes)
Date: 2007-05-10 10:42

Message:
Logged In: YES 
user_id=43556
Originator: NO

reassigned to romulo, seems dependency list related.

----------------------------------------------------------------------

Comment By: Martin Kersten (mlkersten)
Date: 2007-05-08 22:34

Message:
Logged In: YES 
user_id=490798
Originator: NO

The lastest error is not confirmed when all optimizers are on.
It looks more like a typo.
[note, I also added cleanup code]

set optimizer='off';
create table t1(id int, name varchar(1024), age int);
create table t2(id int, age int);

create PROCEDURE p1(id int, age int)
BEGIN
insert into t2 values(id, age);
END;

create PROCEDURE p1()
BEGIN
declare id int, age int;
set id = 1;
set age = 23;
call p1(id, age);
END;

create trigger test_0 after insert on t2
BEGIN ATOMIC
insert into t1 values(1, 'monetdb', 24);
call p1();
END;

drop trigger test_0;
drop procedure p1();
drop procedure p1(int,int);
drop table t1;
drop table t2;


----------------------------------------------------------------------

Comment By: Romulo Goncalves (romulog)
Date: 2007-05-08 20:31

Message:
Logged In: YES 
user_id=1498628
Originator: YES

When I set off the optimizers I get:
>set optimizer='off';
>insert into t2 values(0, 24);
!TypeException:user.p1[21]:'user.p1' undefined in: _39:any := user.p1()
&2 1
!MALException:user.p1[0]:Syntax error in script
>

What does it mean?

Regards,
Romulo

----------------------------------------------------------------------

Comment By: Martin Kersten (mlkersten)
Date: 2007-05-08 17:04

Message:
Logged In: YES 
user_id=490798
Originator: NO

A defense line is to call language.assertSpace(N)
where the stack space is limited to N*variables in current block.
This could could be included in the start of a (recursive)
function body, or those that call at least one other SQL function/proc.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1714809&group_id=56967

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to