Check for null pointer returned from get_opname().
Don't bother checking for alternate strategies if so since it was more likely a function or some other non-operator anyway.
This commit is contained in:
parent
0f19904360
commit
4c91723d35
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.29 1998/08/14 16:13:07 thomas Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.30 1998/08/16 05:37:04 thomas Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -642,7 +642,10 @@ match_clause_to_indexkey(RelOptInfo *rel,
|
|||||||
Operator newop;
|
Operator newop;
|
||||||
|
|
||||||
opname = get_opname(restrict_op);
|
opname = get_opname(restrict_op);
|
||||||
newop = oper(opname, ltype, ltype, TRUE);
|
if (opname != NULL)
|
||||||
|
newop = oper(opname, ltype, ltype, TRUE);
|
||||||
|
else
|
||||||
|
newop = NULL;
|
||||||
|
|
||||||
/* actually have a different operator to try? */
|
/* actually have a different operator to try? */
|
||||||
if (HeapTupleIsValid(newop) && (oprid(newop) != restrict_op))
|
if (HeapTupleIsValid(newop) && (oprid(newop) != restrict_op))
|
||||||
@ -698,7 +701,10 @@ match_clause_to_indexkey(RelOptInfo *rel,
|
|||||||
restrict_op = ((Oper *) ((Expr *) clause)->oper)->opno;
|
restrict_op = ((Oper *) ((Expr *) clause)->oper)->opno;
|
||||||
|
|
||||||
opname = get_opname(restrict_op);
|
opname = get_opname(restrict_op);
|
||||||
newop = oper(opname, rtype, rtype, TRUE);
|
if (opname != NULL)
|
||||||
|
newop = oper(opname, rtype, rtype, TRUE);
|
||||||
|
else
|
||||||
|
newop = NULL;
|
||||||
|
|
||||||
if (HeapTupleIsValid(newop) && (oprid(newop) != restrict_op))
|
if (HeapTupleIsValid(newop) && (oprid(newop) != restrict_op))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user