Re: Small fix for _equalValue() REPOST - Mailing list pgsql-patches

From Fernando Nasser
Subject Re: Small fix for _equalValue() REPOST
Date
Msg-id 3C878A9D.36475683@redhat.com
Whole thread Raw
In response to Small fix for _equalValue()  (Fernando Nasser <fnasser@redhat.com>)
List pgsql-patches
Tom Lane wrote:
>
> This is not the idiomatic way to do it; there is an equalstr() macro
> in equalfuncs.c that does this pushup for you.  So "return
> equalstr(a->val.str, b->val.str)" would be the appropriate fix.
>

Here it is.  Thanks again.

--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9Index: src/backend/nodes/equalfuncs.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v
retrieving revision 1.114
diff -c -p -r1.114 equalfuncs.c
*** src/backend/nodes/equalfuncs.c    2002/03/06 20:34:48    1.114
--- src/backend/nodes/equalfuncs.c    2002/03/07 15:43:28
*************** _equalValue(Value *a, Value *b)
*** 1771,1777 ****
          case T_Float:
          case T_String:
          case T_BitString:
!             return strcmp(a->val.str, b->val.str) == 0;
          default:
              break;
      }
--- 1771,1777 ----
          case T_Float:
          case T_String:
          case T_BitString:
!             return equalstr(a->val.str, b->val.str);
          default:
              break;
      }

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Small fix for _equalValue()
Next
From: Tom Lane
Date:
Subject: Re: Small fix for _equalValue()