James Robinson <[EMAIL PROTECTED]> 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)

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to