Skip site navigation (1) Skip section navigation (2)

BUG #5145: Complex query with lots of LEFT JOIN causes segfault

From: "Bernt Marius Johnsen" <bernt(dot)johnsen(at)sun(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5145: Complex query with lots of LEFT JOIN causes segfault
Date: 2009-10-28 18:53:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      5145
Logged by:          Bernt Marius Johnsen
Email address:      bernt(dot)johnsen(at)sun(dot)com
PostgreSQL version: 8.3.8
Operating system:   Linux 2.6.27-14 (Ubuntu Interpid)
Description:        Complex query with lots of LEFT JOIN causes segfault

The below query generated by the Random Query Generator
( causes a segfault. It was caused running

./ --dsn=dbi:Pg:user=bernt --gendata --queries=100000 --threads=1

(I'll follow up with a mail with xx.yy as attachment)


SELECT * from   B AS alias0  LEFT JOIN        BB AS alias1  LEFT JOIN    B
AS alias2  LEFT JOIN     A AS alias3  LEFT JOIN   AA AS alias4  LEFT JOIN  B
AS alias5 ON alias4.int_key = alias5.int_key  ON alias3.int_key =
alias4.int_key   LEFT JOIN    AA AS alias6  LEFT JOIN  A AS alias7 ON
alias6.int_key = alias7.int_key   LEFT JOIN  BB AS alias8 ON alias7.int_key
= alias8.int_key  ON alias3.int_key = alias8.int_key   LEFT JOIN  AA AS
alias9 ON alias6.int_key = alias9.int_key  ON alias2.int_key =
alias8.int_key   LEFT JOIN   BB AS alias10  LEFT JOIN   AA AS alias11  LEFT
JOIN  B AS alias12 ON alias11.int_key = alias12.int_key  ON alias10.int_key
= alias11.int_key  ON alias9.int_key = alias10.int_key  ON alias1.int_key =
alias8.int_key   LEFT JOIN    BB AS alias13  LEFT JOIN      A AS alias14 
LEFT JOIN    AA AS alias15  LEFT JOIN  A AS alias16 ON alias15.int_key =
alias16.int_key   LEFT JOIN  B AS alias17 ON alias15.int_key =
alias17.int_key  ON alias14.int_key = alias16.int_key   LEFT JOIN  AA AS
alias18 ON alias14.int_key = alias18.int_key   LEFT JOIN  B AS alias19 ON
alias15.int_key = alias19.int_key   LEFT JOIN  AA AS alias20 ON
alias16.int_key = alias20.int_key  ON alias13.int_key = alias19.int_key  
LEFT JOIN  A AS alias21 ON alias13.int_key = alias21.int_key  ON
alias3.int_key = alias17.int_key   LEFT JOIN  B AS alias22 ON alias7.int_key
= alias22.int_key   LEFT JOIN  A AS alias23 ON alias20.int_key =
alias23.int_key   LEFT JOIN  A AS alias24 ON alias14.int_key =
alias24.int_key   LEFT JOIN     BB AS alias25  LEFT JOIN  BB AS alias26 ON
alias25.int_key = alias26.int_key   LEFT JOIN      A AS alias27  LEFT JOIN 
A AS alias28 ON alias27.int_key = alias28.int_key   LEFT JOIN   B AS alias29
 LEFT JOIN   BB AS alias30  LEFT JOIN   B AS alias31  LEFT JOIN    A AS
alias32  LEFT JOIN  B AS alias33 ON alias32.int_key = alias33.int_key   LEFT
JOIN  A AS alias34 ON alias32.int_key = alias34.int_key  ON alias31.int_key
= alias33.int_key  ON alias30.int_key = alias33.int_key  ON alias29.int_key
= alias34.int_key  ON alias27.int_key = alias34.int_key   LEFT JOIN   AA AS
alias35  LEFT JOIN  A AS alias36 ON alias35.int_key = alias36.int_key  ON
alias34.int_key = alias36.int_key   LEFT JOIN  A AS alias37 ON
alias33.int_key = alias37.int_key  ON alias25.int_key = alias32.int_key  
LEFT JOIN  A AS alias38 ON alias37.int_key = alias38.int_key  ON
alias15.int_key = alias37.int_key  ON alias0.int_key = alias9.int_key


pgsql-bugs by date

Next:From: Tom LaneDate: 2009-10-28 19:00:41
Subject: Re: BUG #5144: Issue changing password
Previous:From: George FrancisDate: 2009-10-28 18:23:50
Subject: BUG #5144: Issue changing password

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group