[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: search with negation of undefined objectClass returns nothing

Charlie H writes:
> One of our programs searches for LDAP entries with a negation of
> certain object classes, so that extraneous entries are ignored.  In
> OpenLDAP, if the passed objectClass is not defined (as a valid
> objectClass in the schema), it returns back nothing every time.

Yes.  X.500 and LDAP use three-valued logic for filters:  They yield
true, false or undefined, and an entry is only returned if the filter
yields true.  (objectClass=<unknown name>) yields undefined.  Think
of undefined as "don't know the answer", or in some cases as "error":

  not undefined      = still undefined.
  true and undefined = undefined, false and undefined = false.
  true or undefined  = true,      false or undefined  = undefined.

'false and undefined' and 'true or undefined' have defined values
because the value would be the same regardless of whether undefined
was replaced with true or false.