mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-28 11:55:03 +03:00 
			
		
		
		
	Fix build_minmax_path() to cope if an IS NULL clause turns up in the
indexable-clauses list for a btree index. Formerly it just Asserted that all such clauses were opclauses, but that's no longer true in 8.3. Per bug #3796 from Matthias Schoeneich.
This commit is contained in:
		| @@ -8,7 +8,7 @@ | |||||||
|  * |  * | ||||||
|  * |  * | ||||||
|  * IDENTIFICATION |  * IDENTIFICATION | ||||||
|  *	  $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.34 2007/11/15 21:14:36 momjian Exp $ |  *	  $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.35 2007/12/03 22:37:17 tgl Exp $ | ||||||
|  * |  * | ||||||
|  *------------------------------------------------------------------------- |  *------------------------------------------------------------------------- | ||||||
|  */ |  */ | ||||||
| @@ -368,7 +368,9 @@ build_minmax_path(PlannerInfo *root, RelOptInfo *rel, MinMaxAggInfo *info) | |||||||
| 				RestrictInfo *rinfo = (RestrictInfo *) lfirst(ll); | 				RestrictInfo *rinfo = (RestrictInfo *) lfirst(ll); | ||||||
| 				int			strategy; | 				int			strategy; | ||||||
|  |  | ||||||
| 				Assert(is_opclause(rinfo->clause)); | 				/* Could be an IS_NULL test, if so ignore */ | ||||||
|  | 				if (!is_opclause(rinfo->clause)) | ||||||
|  | 					continue; | ||||||
| 				strategy = | 				strategy = | ||||||
| 					get_op_opfamily_strategy(((OpExpr *) rinfo->clause)->opno, | 					get_op_opfamily_strategy(((OpExpr *) rinfo->clause)->opno, | ||||||
| 											 index->opfamily[prevcol]); | 											 index->opfamily[prevcol]); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user