Bugs item #1848553, was opened at 2007-12-11 12:51
Message generated for change (Comment added) made by romulog
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1848553&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 2.20
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Romulo Goncalves (romulog)
Assigned to: Niels Nes (nielsnes)
Summary: select crashes in the optimization

Initial Comment:
The following queries crash the Mserver5-SQL:

create table s ( snr int, sname varchar(30) );
create table sp ( snr int, pnr varchar(30) );

select 24;
SELECT  DISTINCT S.SNAME
      FROM     S, SP
      GROUP   BY S.SNR, S.SNAME, SP.SNR, SP.PNR
      HAVING SP.SNR = S.SNR
      AND        SP.PNR = 'P2';

drop table s;
drop table sp;


Regards,
Romulo

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

>Comment By: Romulo Goncalves (romulog)
Date: 2007-12-18 16:59

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

After some debug lets pump some information...

These two queries crash for different reasons. The firs one presented
creates an infinite loop due the pivot stmt...

The second query crashes after 4 iterations (in the optimization). A pivot
is missing so the find_pivot returns a empty stmt.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1107310912 (LWP 23037)]
0x00002aaabc70308c in optimize (c=0x1ace498, s=0x1aa1af8) at
/ufs/goncalve/MonetDB/Stable/sql/src/server/sql_optimize.mx:1542
1542                    s->optimized = np->optimized = 1;
(gdb) l
#0  0x00002aaabc70308c in optimize (c=0x1ace498, s=0x1aa1af8) at
/ufs/goncalve/MonetDB/Stable/sql/src/server/sql_optimize.mx:1542
1542                    s->optimized = np->optimized = 1;
(gdb) l
1537                    stmt *ns = optimize(c, s->op2.stval);   /*
optimize ptable */
1538                    stmt *np = find_pivot(ns, s->t);
1539
(gdb) p np
$2 = (stmt *) 0x0
(gdb) 

Looking to the query it is easy to see that no table or column reference
is used in the where clause. If I do:
...a between 4 and 6;
instead of:
...5 between 4 and 6;
The Mserver does not crash.

Regards,
Romulo

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

Comment By: Romulo Goncalves (romulog)
Date: 2007-12-14 12:49

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

Another query which crashes the mserver in the same place...

create table crash_me (a integer not null,b char(10) not null);
insert into crash_me (a,b) values (1,'a');

This is the query:
select a from crash_me where 5 between 4 and 6;

drop table crash_me;

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1107310912 (LWP 31989)]
0x00002aaabc702fe0 in optimize (c=0x16a6508, s=0x1a68928)
    at /ufs/goncalve/MonetDB/Stable/sql/src/server/sql_optimize.mx:1542
1542                    s->optimized = np->optimized = 1;
(gdb) up
#1  0x00002aaabc702dc3 in optimize (c=0x16a6508, s=0x1a418b8)
    at /ufs/goncalve/MonetDB/Stable/sql/src/server/sql_optimize.mx:1487
1487                            stmt *ns = optimize(c, os);
(gdb) up
#2  0x00002aaabc702f11 in optimize (c=0x16a6508, s=0x1a419a8)
    at /ufs/goncalve/MonetDB/Stable/sql/src/server/sql_optimize.mx:1523
1523                            stmt *ns = optimize(c, n->data);
(gdb)



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

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

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to