On 2013/12/20 06:11, David Bicking wrote:
But isn't NULL and 0 a NULL? So wouldn't it need to evaluate X to determine if
it was null, and thus discover it wasn't a valid column name and return an
error?
David
It's hard to make a case for it though. I could argue both sides from first
principles -
If I have it right, the effective statement (when using AND) becomes a Boolean type evaluate, and while it might be represented by
0, it really means "false", so that (X and 0) = (X and false) = false for any X, even if it is Null, as opposed to X + 0 which
evaluates to X for any X and NULL if X is NULL - ok, that seems superfluous to even mention but it is significant, in that X + 5
evaluates to X + 5 for any X and NULL if X is NULL because NULL + 5 has no footing in arithmetic reality since the sets are not of
the same kind and is equivalent to trying to evaluate Apple + Wednesday. In contrast, (X AND 0) is a logic statement and not an
arithmetic one, meaning that (Apple AND false) is still false, regardless of the base of the sets.
On the other hand, you are not wrong and a case can be made for your suggestion and one could argue it would be closer following of
the standard to check operands for validity prior to any evaluation.
My point being that it's really an edge case and probably fair to go for "whatever is most efficient", and I for one would prefer
saving the clock cycles, few as it may be. Is this causing your systems to not work correctly? I imagine at the very least you
spent a lot of debugging time trying to hunt down this peculiarity for whatever dissonance it caused, but now that you've
successfully caught it and know the system's logic, is it still a big problem?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users