Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA13771; Wed, 10 Jun 92 10:54:22 -0700
Message-Id: <9206101754.AA13771@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:54:18 PDT

In message <9206101713.AA13335@postgres.Berkeley.EDU> you write:

> bool sequal(s1,s2)
> struct varlena *s1, *s2;
> {
>         int i;
>         char *a, *b;
> 
> 
>         a = VARDATA(s1);
>         b = VARDATA(s2);
> 
>         i = strcmp(a,b);			***************
> 
>         if(i==0) return(true);
>         return(false);
> }

you should change the strcmp() to be:

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

to avoid a core dump.  varlenas are not guaranteed to be null-terminated,
and the vl->len field includes the size of that field itself.

> The following works:
> * retrieve (FILE.name, FILE.directory) where FILE.name = "heartbeatmov"\g
>
> The following fails with the indicated error:
> * retrieve (F1.name, F2.name) from F1 in FILE, F2 in FILE
>     where F1.name = F2.name \g
> WARN:Jun 10 11:13:07:fmgr: Cache lookup failed for procedure 0

can you show us the commands you used to define the '=' operator?  include
the c function definition.
					mike olson
					project sequoia 2000
					uc berkeley
					mao@cs.berkeley.edu
