Hi everybody,
there is some strange behaviour in sqlite.
I create table with boolean type and everything is fine.
I can add some rows, and it's OK.
sqlite> create table t(val boolean);
sqlite> insert into t values(0);
sqlite> insert into t values(1);
sqlite> insert into t values('true');
sqlite> insert into t values('false');
sqlite> insert into t values(false);
Error: no such column: false
sqlite> insert into t values(true);
Error: no such column: true
So OK, only I can't use: false, and true.
But when I try do it this:
sqlite> select * from t where val = 0;
I get only rows with val == 0.
Why sqlite doesn't show rows with value 0 or, false?
Why sqlite cast this values to one single representation?
On webpage: http://www.sqlite.org/datatype3.html is:
1.1 Boolean Datatype
SQLite does not have a separate Boolean storage class.
Instead, Boolean values are stored as integers 0 (false)
and 1 (true).
That say to me: "You can use false and/as 0, or true and/as 1".
But I get different results, when I use this...
This is so wrong, because I was a lot of problems to find an issue in my
program.
PS: I use sqlite with version (in ArchLinux):
3.7.10 2012-01-16 13:28:40 ebd01a8deffb5024a5d7494eef800d2366d97204
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users