> So 1 can be equal to '1' and can be not. It's terrible behaviour. Don't use word 'terrible' for things that you don't understand completely. To understand it read once more about SQLite datatypes, affinity and about cases when datatype is changed automatically in expressions: http://www.sqlite.org/datatype3.html. It will explain to you why 1 ='1' doesn't work but a = 1 and a = '1' work.
Although I can admit that your case with trigger and my own tests show that for some reason affinity rules do not work in the "instead of" trigger but work in simple selects and all other types of triggers (I've tested "after insert" and "before insert"). Pavel On Fri, Oct 30, 2009 at 10:55 AM, Alexey Pechnikov <[email protected]> wrote: > Hello! > > $ sqlite3 > SQLite version 3.6.19 > Enter ".help" for instructions > Enter SQL statements terminated with a ";" > sqlite> select 1='1'; > 0 > sqlite> create table test(a text); > sqlite> insert into test values (1); > sqlite> select * from test where a='1'; > 1 > sqlite> select * from test where a=1; > 1 > > So 1 can be equal to '1' and can be not. It's terrible behaviour. > > Best regards, Alexey Pechnikov. > http://pechnikov.tel/ > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

