Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA13849; Wed, 10 Jun 92 10:58:20 -0700
Message-Id: <9206101758.AA13849@postgres.Berkeley.EDU>
From: <mao@postgres.berkeley.edu>
Subject: Re: Operation fails when both sides are Record elements
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: Your message of Wed, 10 Jun 92 10:13:53 PST.
             <9206101713.AA13335@postgres.Berkeley.EDU> 
Date: Wed, 10 Jun 92 10:58:20 PDT

cheez, i should think before i type.  in my previous message, i said you
should use

	len = (VARSIZE(s1) > VARSIZE(s2) ? VARSIZE(s1) : VARSIZE(s2));
	len -= sizeof(VARSIZE(s1));
	i = strncmp(a,b);

but that's wrong.  for equality, you want

	if (VARSIZE(s1) != VARSIZE(s2))
		return (false);

	i = strncmp(a, b, VARSIZE(s1) - sizeof(VARSIZE(s1)));

this does the right equality comparison, and passes the right number
of arguments to strncmp().  sorry about that.

					mike olson
					project sequoia 2000
					uc berkeley
					mao@cs.berkeley.edu
