On Fri, Nov 09, 2001 at 11:35:32AM -0600, Ed Grimm wrote:
> On Fri, 9 Nov 2001, Gerald Richter wrote:
> 
> >> Is this a known bug:
> >>  querying with primary keys ignores conditions for other fields
> >> ?
> >
> > No, that's really a feature. Since a primary key has to be unique (otherwise
> > it isn't a primary key), it's the only thing you need to find a record (at
> > least if you compare with equality). So there is no need to pass all the
> > other fields to the where expression. This is an optimazation for the case
> > where you pass a hash with a bunch of fieldnames. In this way only the
> > necessary one gets to the SQL engine.
> 
> Yes, but what if you want to test the values of those other fields, and
> conditionally *not* find it?  This is important functionality,
> therefore, this is a mis-classified bug.
> 
You can override the initial primary key by setting '$primkey' to ''.
IMHO it's just a surprising definition for the behaviour of a primary key.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to