Package: sqlite3 Version: 3.7.11-3 Severity: normal Tags: upstream [nion@coredump:shm$] sqlite3 test.sqlite SQLite version 3.7.11 2012-03-20 11:35:50 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> create table foo (id integer primary key); sqlite> create table bar (id integer primary key, fooid int, foreign key (fooid) references foo(id)); sqlite> insert into foo (id) values (1); sqlite> insert into foo (id) values (2); sqlite> insert into foo (id) values (3); sqlite> insert into bar (fooid) values(NULL); sqlite> insert into bar (fooid) values(2); sqlite> select * from bar; 1| 2|2 sqlite> select id from foo where id not in (select fooid from bar); sqlite> delete from bar where fooid is null; sqlite> select id from foo where id not in (select fooid from bar); 1 3 sqlite>
This behaviour looks like a bug in sqlite to me. The NULL fooid column is preventing the WHERE NOT IN to work properly with the subquery. Please let me know if this is intended behaviour. I did not find anything in the documentation outlining this. Kind regards Nico -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org