|
9 | 9 | *
|
10 | 10 | *
|
11 | 11 | * IDENTIFICATION
|
12 |
| - * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.144 2008/03/26 21:10:38 alvherre Exp $ |
| 12 | + * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.145 2008/04/01 00:48:33 tgl Exp $ |
13 | 13 | *
|
14 | 14 | *-------------------------------------------------------------------------
|
15 | 15 | */
|
@@ -47,7 +47,8 @@ boolconstraint_exclusion = false;
|
47 | 47 | get_relation_info_hook_typeget_relation_info_hook=NULL;
|
48 | 48 |
|
49 | 49 |
|
50 |
| -staticList*get_relation_constraints(OidrelationObjectId,RelOptInfo*rel, |
| 50 | +staticList*get_relation_constraints(PlannerInfo*root, |
| 51 | +OidrelationObjectId,RelOptInfo*rel, |
51 | 52 | boolinclude_notnull);
|
52 | 53 |
|
53 | 54 |
|
@@ -462,7 +463,8 @@ estimate_rel_size(Relation rel, int32 *attr_widths,
|
462 | 463 | * point in caching the data in RelOptInfo.
|
463 | 464 | */
|
464 | 465 | staticList*
|
465 |
| -get_relation_constraints(OidrelationObjectId,RelOptInfo*rel, |
| 466 | +get_relation_constraints(PlannerInfo*root, |
| 467 | +OidrelationObjectId,RelOptInfo*rel, |
466 | 468 | boolinclude_notnull)
|
467 | 469 | {
|
468 | 470 | List*result=NIL;
|
@@ -497,7 +499,7 @@ get_relation_constraints(Oid relationObjectId, RelOptInfo *rel,
|
497 | 499 | * stuff involving subqueries, however, since we don't allow any
|
498 | 500 | * in check constraints.)
|
499 | 501 | */
|
500 |
| -cexpr=eval_const_expressions(cexpr); |
| 502 | +cexpr=eval_const_expressions(root,cexpr); |
501 | 503 |
|
502 | 504 | cexpr= (Node*)canonicalize_qual((Expr*)cexpr);
|
503 | 505 |
|
@@ -561,7 +563,8 @@ get_relation_constraints(Oid relationObjectId, RelOptInfo *rel,
|
561 | 563 | * it can be called before filling in other fields of the RelOptInfo.
|
562 | 564 | */
|
563 | 565 | bool
|
564 |
| -relation_excluded_by_constraints(RelOptInfo*rel,RangeTblEntry*rte) |
| 566 | +relation_excluded_by_constraints(PlannerInfo*root, |
| 567 | +RelOptInfo*rel,RangeTblEntry*rte) |
565 | 568 | {
|
566 | 569 | List*safe_restrictions;
|
567 | 570 | List*constraint_pred;
|
@@ -600,7 +603,7 @@ relation_excluded_by_constraints(RelOptInfo *rel, RangeTblEntry *rte)
|
600 | 603 | * OK to fetch the constraint expressions. Include "col IS NOT NULL"
|
601 | 604 | * expressions for attnotnull columns, in case we can refute those.
|
602 | 605 | */
|
603 |
| -constraint_pred=get_relation_constraints(rte->relid,rel, true); |
| 606 | +constraint_pred=get_relation_constraints(root,rte->relid,rel, true); |
604 | 607 |
|
605 | 608 | /*
|
606 | 609 | * We do not currently enforce that CHECK constraints contain only
|
|