Subject Re: [Firebird-Architect] ORs in Where statement
Author Ann W. Harrison
> > > Chris Meelhuysen wrote:
> > > >Is Firebird constructed in such a way that when one OR condition is true
> > > >that it doesn't calculate the rest since we already know it can be used?
> > >
>Ann wrote:
> >
> >In the interim, it occurred to someone
> >that the evaluation of a boolean might have side-effects that
> >altered the state of the database, so full evaluation was done
> >even after the result was determined.
Helen Borrie wrote:

>I have to confess that I've read and re-read the note in firebird.conf,
>cudgelled my tiny brain, and can't come up with any scenario where
>subsequent OR conditions could override a preceding True...somebody must
>have thought of one, I suppose.

Sorry, I was unclear. The concern was not that subsequent expressions
could change the result of the boolean operation, but that they could
have side-effects in the database. For example, part of the boolean
could invoke a stored procedure and that procedure might do some logging
or other operations. There would be no change in the current statement,
but subsequent statements could get different results depending on what
parts of the boolean expression were evaluated.

Jim will probably have something to say about that kind of programming.