Re: Backend 8.0.0B4 crash on SELECT ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Robinson <jlrobins(at)socialserve(dot)com>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Backend 8.0.0B4 crash on SELECT ...
Date: 2004-11-05 20:46:53
Message-ID: 12658.1099687613@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

James Robinson <jlrobins(at)socialserve(dot)com> writes:
> I can reproduce a 8.0.0B4 backend crash on OSX 1.3.5.

Fixed; thanks for the test case. If you need the patch right away,
here it is.

regards, tom lane

*** src/backend/optimizer/path/indxpath.c.orig Mon Oct 11 18:56:56 2004
--- src/backend/optimizer/path/indxpath.c Fri Nov 5 15:27:18 2004
***************
*** 848,860 ****

foreach(item, restrictinfo_list)
{
- RestrictInfo *restrictinfo = (RestrictInfo *) lfirst(item);
-
- Assert(IsA(restrictinfo, RestrictInfo));
-
/* if any clause implies the predicate, return true */
if (pred_test_recurse_restrict(predicate,
! (Node *) restrictinfo->clause))
return true;
}
return false;
--- 848,856 ----

foreach(item, restrictinfo_list)
{
/* if any clause implies the predicate, return true */
if (pred_test_recurse_restrict(predicate,
! (Node *) lfirst(item)))
return true;
}
return false;
***************
*** 865,871 ****
* pred_test_recurse_restrict
* Does the "predicate inclusion test" for one element of a predicate
* expression. Here we recursively deal with the possibility that the
! * restriction-list element is itself an AND or OR structure.
*/
static bool
pred_test_recurse_restrict(Expr *predicate, Node *clause)
--- 861,868 ----
* pred_test_recurse_restrict
* Does the "predicate inclusion test" for one element of a predicate
* expression. Here we recursively deal with the possibility that the
! * restriction-list element is itself an AND or OR structure; also,
! * we strip off RestrictInfo nodes to find bare predicate expressions.
*/
static bool
pred_test_recurse_restrict(Expr *predicate, Node *clause)
***************
*** 874,880 ****
ListCell *item;

Assert(clause != NULL);
! if (or_clause(clause))
{
items = ((BoolExpr *) clause)->args;
foreach(item, items)
--- 871,884 ----
ListCell *item;

Assert(clause != NULL);
! if (IsA(clause, RestrictInfo))
! {
! RestrictInfo *restrictinfo = (RestrictInfo *) clause;
!
! return pred_test_recurse_restrict(predicate,
! (Node *) restrictinfo->clause);
! }
! else if (or_clause(clause))
{
items = ((BoolExpr *) clause)->args;
foreach(item, items)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James Robinson 2004-11-05 21:20:16 Re: Backend 8.0.0B4 crash on SELECT ...
Previous Message Heikki Linnakangas 2004-11-05 20:40:59 Re: [PATCHES] CVS should die