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. I think a better option would be to pass a hash which only contains what you want to check. Ed --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
