>On May 2, 2014, at 8:54 PM, Richard Hipp <d...@sqlite.org> wrote:

>> I'm guessing that Mr. Abeille is upset that SQLite ...

>... doesn't even bother with SQL syntax and will happily accept any old
>junk as a sorry excuse for a query.

>select 1 where null;
>select 1 where not null;

What is the problem?

The logical value of a NULL is false.
Any operation on a NULL (including NOT) is a NULL and therefore false. ** 
special rules for AND and OR
A numeric value of 0 is false.
Any value that is not 0 is true.

Strings are, however, handled incorrectly:

sqlite> select 1 where 'A';
sqlite> select 1 where not 'A';
1

^^^ are inverted 'A' should be true, whereas not 'A' should be false; and,

sqlite> select 1 where '';
sqlite> select 1 where not '';
1

an empty string should be false, and applying the not operator should result in 
true (that is, a string is true if its length is non-zero and false if the 
length is zero).  Truth values of strings appears to be incorrectly handled 
everywhere, and logical operations (AND/OR) work as expected even with NULL but 
are incorrect in the presence of a string (since the conversion of strings to 
truth values is incorrect).




_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to